×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Field qualification should allowed be allowed by the SQL precompiler so long as it isn't beyond one level of qualification.
http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_71/rzajp/rzajphoststrucirpg.htm


Kurt Anderson
Sr. Programmer/Analyst - Application Development, Service Delivery Platform

-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Michael Ryan
Sent: Wednesday, October 15, 2014 2:55 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Qualified Data Structure with SQL Insert

Thanks Sam.

On Wed, Oct 15, 2014 at 2:53 PM, Sam_L <lennon_s_j@xxxxxxxxxxx> wrote:

As I recall, the SQL precompiler doesn't like qualified data structures.
I believe I ran into this at v7R1 and had to solve it with pointers. I
don't have access to that code or a V7R1 machine now, however and your
code is, I think, complicated in that SQLCA is defined and used by the
SQL insert. So even a pointer solution might not work.

You could probably solve the problem quickly by using RLA...

Sam


On 10/15/2014 1:08 PM, Michael Ryan wrote:

I thought I was being clever...perhaps not...I can't get the
variables in the INSERT clause right. I've tried using pIn_SQLCA
subfields or In_SQLCA subfields and I get the :In_SQLCA.SQLWRN ->
SQL0312: Position 21 Variable IN_SQLCA not defined or not usable as well as the other side SQL0312:
Position 30 Variable SQLWRN not defined or not usable. Why can't I
do this?

D In_SQLCA DS LikeDS(SQLCA)

P WSV_Logger...
P B Export
D WSV_Logger...
D PI Like(rc)
D pIn_SQLCA Value
D LikeDS(SQLCA)

D rc S 10I 0

/Free
In_SQLCA = pIn_SQLCA;

Exec SQL
Insert Into WEBSVC/WSVLOGP (WSV_SQLCAID,
WSV_SQLCABC,
WSV_SQLCODE,
WSV_SQLERRML,
WSV_SQLERRMC,
WSV_SQLERRP,
WSV_SQLERR,
WSV_SQLWRN,
WSV_SQLSTATE)
Values ( :In_SQLCA.SQLCAID,
:In_SQLCA.SQLCABC,
:In_SQLCA.SQLCODE,
:In_SQLCA.SQLERRML,
:In_SQLCA.SQLERRMC,
:In_SQLCA.SQLERRP,
:In_SQLCA.SQLERR,
:In_SQLCA.SQLWRN,
:In_SQLCA.SQLSTATE) ;

Return 1;

P WSV_Logger...
P E


---
This email is free from viruses and malware because avast! Antivirus
protection is active.
http://www.avast.com


--
This is the RPG programming on the IBM i (AS/400 and iSeries)
(RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.