Page 1 of 1

SELECT_SQL with iASP

Posted: Wed Apr 22, 2020 4:25 am
by atostaine
I'm trying to use SQL_SELECT freeform like I've done 100's of times This is my first time using it on IBM i with iASP.

This file name format and error:

select LOTID ,PRPTYPCDE from MYIASP/MYDTALIB/MYFILE where myField = ' + #quote + #myfield.trim + #quote
atshot1.png
atshot1.png (22.91 KiB) Viewed 13178 times


This format MYIASP.MYDTALIB.MYFILE causes this error:
atshot2.png
atshot2.png (21.14 KiB) Viewed 13178 times

Re: SELECT_SQL with iASP

Posted: Wed Apr 22, 2020 8:58 am
by KevinW
... and you are executing it directly in Windows as against directly on IBM i because?

Re: SELECT_SQL with iASP

Posted: Wed Apr 22, 2020 8:59 am
by atostaine
Was wondering about the mention of MSSQL. It’s a vlf-win app and we connect to IBM I only. During debug it crashes at select_sql statement

Re: SELECT_SQL with iASP

Posted: Wed Apr 22, 2020 10:02 am
by KevinW
Where is the code (function, component etc) that is executing the SELECT_SQL actually running? If not IBM i then I am not sure how it would work.

Re: SELECT_SQL with iASP

Posted: Wed Apr 22, 2020 10:05 am
by atostaine
It’s windows vlf-win super server connected to IBM i. The code executes in RP compiled as windows only.

No other database or anything weird. Only iASP is different.

If I debug and take sqlselect variable I can execute with any SQL client or green screen.

Re: SELECT_SQL with iASP

Posted: Wed Apr 22, 2020 10:32 am
by KevinW
The documentation on SELECT_SQL states this:

"Do NOT use this command to connect from Visual LANSA to a database on the IBM i. If you use the SELECT_SQL command to connect from Visual LANSA to an IBM i Database, it will access the Database on the PC and not on the IBM i. For this type of connection, you should use a remote procedure call (i.e call_server_function)."

This backs up what I have already been saying.

Also this:

"The use of imbedded SQL features and facilities may introduce platform dependencies into your applications. Not all SQL facilities are supported by all DBMSs. By bypassing the IOM/OAM associated with the table, you are bypassing the feature isolation it provides. Using SQL features and facilities that are DBMS defined, platform dependent extensions, is solely at the discretion of, and the responsibility of, the application designer. "

I believe that use of IBM i iASP in your SQL is IBM i only.

Re: SELECT_SQL with iASP

Posted: Wed Apr 22, 2020 10:43 am
by atostaine
Oh now i see the light. I’ve done this lately always in server modules for VL-web.

Thank you for setting me straight.