xTuple.com xTupleU Blog & News Customer Support

toolbox.executeQuery

Using windows 5.1

I am executing an Insert query with folders paths such as
\\secretserver\file$\1207229\1031686\50000134\

The toolbox.executeQuery() fails to execute and using a messagebox like

QMessageBox.information(mywidget, qsTr("Ins File Query "), qsTr("The raw query: " + qry ));

returns nothing

I can assure you that the string of the query ( using the message box) returns the correct query that I can execute in DB Beaver.

After removing the path column from the query, the executeQuery ran correctly.

So what do I have to do to delimit the \ in the folder path string, so that this runs correctly.

Thank you

It would be a nightmare to try to wrap the whole thing so I am assuming the path is a parameter and you are just trying to get the path into a string without the 's escaping. in that case for js you would simply add \ before each \ so this string would turn into

“\\\\secretserver\\file$\\1207229\\1031686\\50000134\\”

or you could do

String.raw’\\secretserver\file$\1207229\1031686\50000134\’;

Its hard to say exactly how you would get this escaped because I don’t know how you get the string.

Once you have it in a variable sat filepath then you just do
toolbox.executeQuery(qry,{'filename':filepath})
Then in your sql you use it with
<? value("filename") ?>

Thank you Caleb,

I decided to place my query in a postgresql function so That I would not have to worry about back and forward slashes

Bob