SELECT_SQL with iASP

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
atostaine
Posts: 565
Joined: Wed Jan 20, 2016 7:38 am

SELECT_SQL with iASP

Post by atostaine » Wed Apr 22, 2020 4:25 am

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 3043 times


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

KevinW
Posts: 31
Joined: Thu May 26, 2016 11:18 am

Re: SELECT_SQL with iASP

Post by KevinW » Wed Apr 22, 2020 8:58 am

... and you are executing it directly in Windows as against directly on IBM i because?

atostaine
Posts: 565
Joined: Wed Jan 20, 2016 7:38 am

Re: SELECT_SQL with iASP

Post by atostaine » Wed Apr 22, 2020 8:59 am

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
Art Tostaine

KevinW
Posts: 31
Joined: Thu May 26, 2016 11:18 am

Re: SELECT_SQL with iASP

Post by KevinW » Wed Apr 22, 2020 10:02 am

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.

atostaine
Posts: 565
Joined: Wed Jan 20, 2016 7:38 am

Re: SELECT_SQL with iASP

Post by atostaine » Wed Apr 22, 2020 10:05 am

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.
Art Tostaine

KevinW
Posts: 31
Joined: Thu May 26, 2016 11:18 am

Re: SELECT_SQL with iASP

Post by KevinW » Wed Apr 22, 2020 10:32 am

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.

atostaine
Posts: 565
Joined: Wed Jan 20, 2016 7:38 am

Re: SELECT_SQL with iASP

Post by atostaine » Wed Apr 22, 2020 10:43 am

Oh now i see the light. I’ve done this lately always in server modules for VL-web.

Thank you for setting me straight.
Art Tostaine

Post Reply