Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

SQL QPAC

Avatar

Former Community Member
Hi I am trying to make the following query using the SQL QPAC:



SELECT NoVendor,Contacto,Tiposervicio,DescServ,

CostoServ,FechaContratacion,FechaInicioServ,

ReqEsp,RepresentanteLeg,RFC

from empresas

where

empresa = '{$/process_data/@empresa$}'

AND

ancla = '{$/process_data/@ancla$}'



But it does not work if I use "AND" it just work using the first field, it works with either one of the fields but not with the two, and it also works if I hard code the values, I also checked that I am passing the values correclty and they do,

Thanks

Roberto
2 Replies

Avatar

Level 9
Hi

It's difficult to know exactly what's going on, but here are a couple of thoughts:

- Do the process variables empresa and ancla contain any non-ascii characters, or a "'" character. Either of these may cause problems.

- What are the datatypes of empresa and ancla? Depending on the database, it might do some weird casting behaviour

- The SQL QPAC only returns the first row of data that it finds - are you sure that it's not just returning the first valid value that it finds?



You may want to try our SQLPLus QPAC at:

http://www.avoka.com/avoka/qpac_library.shtml

It

a) gives you a test tab where you can test your query and see what's happening

b) returns multiple results

c) uses parameterized queries, which are a little more reliable than embedding strings into your query.



Good luck...

Howard

Avatar

Former Community Member
I found the problem, the problem was that I added the second "In" variable after connecting the WSDL to the form (I was using the workflow as a web service), I refresh the Data View in the Form Designer and the variable appeared in the Invoke section,I bind it correctly, but it did not send the value, I had to delete the connection and do the bindings again



I used the variable logger QPAC to realize that the value was not being sent



Thanks anyway

Roberto