× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Try using

           Exec SQL
                 Insert into VendSmall
                 Values(:VR1.VNID, :VR1.VNNAME)
           End-Exec.

Sachin Gupta.
CSC

----- Original Message -----
From: "Jon Paris" <Jon.Paris@Partner400.com>
To: "Cobol400-L@Midrange. Com" <cobol400-l@midrange.com>
Sent: Tuesday, July 30, 2002 7:21 PM
Subject: Problems with Insert in Embedded SQL


> I know this is going to be a duh! when I find the answer but .... I posted
> an earlier  version of this question on the Midrange list but thought that
> since it appears that the problem is likely Cobol specific .....
>
> This code compiles OK:
>
>        Working-Storage Section.
>            Exec SQL
>               Include SQLCA
>            End-Exec.
>
>        01 VENDR1.
>           03  VR1.
>             05  VNID   PIC X(6).
>             05  VNNAME PIC X(30).
>
>        Procedure Division.
>            Exec SQL
>                 Insert into VendSmall
>                 Values(:VR1)
>            End-Exec.
>
> Of course when I add this second structure
>
>       *01 VENDR2.
>       *   03  VR1.
>       *     05  VNID   PIC X(6).
>       *     05  VNNAME PIC X(30).
>
> The compile fails because VR1 is not unique.  My understanding is that I
> should be able to code the Values clause as:
>
>        Values(:VENDR1.VR1)
>
> and everything should be fine.  Try telling that to the pre-compiler.  It
> insists that VENDR1 and VR1 are "not defined or not usable.  In fact I get
> this error even when the second structure is removed.  I've read the
> manuals, checked the archives, and can't find a thing - I'm hoping someone
> here will have an answer.
>
> PS.  This code is a simplification of the problem - I'm really trying to
use
> data definitions generated by COPY DDS.
>
> Also posted in the SQL area just in case !!
>
> Jon Paris
> Partner400
>
>
> _______________________________________________
> This is the COBOL Programming on the iSeries/AS400 (COBOL400-L) mailing
list
> To post a message email: COBOL400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/cobol400-l
> or email: COBOL400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/cobol400-l.
>


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 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.