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.shtmlIt
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