Lookup-Error

Since the latest SC-update i had an issue with this lookup statement:

SELECT op_users.name
FROM op_users, op_users_groups
WHERE op_users.login = op_users_groups.login
and op_users_groups.group_id = ‘[opuser_group]’
ORDER by name

Generation of this form-application rans to endless loop! No error message!

Wouldn’t be:

SELECT op_users.name
FROM op_users, op_users_groups
WHERE op_users.login = op_users_groups.login
and op_users_groups.group_id = ‘[opuser_group]’
ORDER by op_users.name

?

Thank you for your advice. Your sql-instruction may be the correct expression but the result is the same. The generation of my form application hungs. Till the SC Version 9.13.08 there are no such problems.

Have you tried this SQL instruction in your database directly? If so, there is another place which is giving you this kind of error.
Try to comment all codes inserted in the events (onLoad, onScriptInit, etc) and see what happens. If it works, try to put pieces of code until you discover whats is hanging your app.

It is definitly the lookup-instruction in a text-field. This instruction works directly in a database very well (naturally with a fix value instead of the variable [opuser_group]).

Just confirming this is a form application?
A lookup (select / radio / checkboks … and so on) on a form requires the return of 2 fields, key and value.
On a grid or other lookups, it is fine to just return one value. Forms / Control apps though need both values for the lookups to work.

There are other ways, but that is the standard.

[quote=“Dirk, post:6, topic:38057, full:true”]

Hello Dirk,

This concerns a function that has worked perfectly so far.

Jup, I understand the frustration. Over the years you get use to its quirks.

If it is a lookup on a form select field, then you need the two fields, key value

Also, I did notice that with the last update the field names are interpreted by scriptcase is a bit different, especially when it comes to the dot notation. It now tries to match field names as much as possible dropping the table name in some instances.

So a suggestion to try: SELECT aa.bb as new_field_name FROM … in your lookup, all it does is modify the way the result set is handled by SC. It would be interesting to see what it does.

I will try it tomorrow…

Your advice brings no change.

Are you performing any code in any of the events? Or have you included any internal libs?

If so… just as a test , comment all of them out … retry.