Even better idea.  <grin>

Charles Wilt
iSeries Systems Administrator / Developer
Mitsubishi Electric Automotive America
ph: 513-573-4343
fax: 513-398-1121
 

> -----Original Message-----
> From: Erhardt, Bill [mailto:Bill.Erhardt@xxxxxxxxx]
> Sent: Tuesday, December 07, 2004 4:55 PM
> To: 'Midrange Systems Technical Discussion'
> Subject: RE: embedded sql .. error check..
> 
> 
> I generally set up a field called APOST and set it to the hex 
> equivalent of
> the ' sign (X'7D).  Then when I build my SQL select statement 
> I use APOST +
> Value + Apost.
> Why are you doing a dynamic select.  You can do this as
> 
> c/Exec Sql Declare c1 cursor for
> C+ Select Distinct prpoid
> C+ From pmppr 
> C+ WHERE 
> C+  prhreq = Digits(julian) and
> C+  prco < '090'
> c/End-Select
> 
> -----Original Message-----
> From: midrange-l-bounces@xxxxxxxxxxxx
> [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Hatzenbeler, Tim
> Sent: Tuesday, December 07, 2004 4:38 PM
> To: 'Midrange Systems Technical Discussion'
> Subject: embedded sql .. error check..
> 
> 
> I'm attempting to write some embedded sql skeleton code, and 
> I want to make
> sure I do it right...
> 
> I was wondering, if I could have someone look at this, and make any
> suggestion, that would make the process better than what I have...
> 
> >From what I read from the infocenter, there are a few sql 
> variables to 
> >check
> to make sure there were no errors...  But I was wondering if 
> sqlcod was
> enough...
> 
> Thanks, tim
> 
> 
> 
>      c/exec sql
> 
>      c+ declare  c1 cursor for DynSqlStmt
> 
>      c/end-exec
> 
>  
> 
>      c                   eval      sql = 'SELECT DISTINCT prpoid '+
> 
>      c                             'FROM pmppr WHERE prhreq = '+
> 
>      c                             %editc(julian:'Z') +
> 
>      c                             ' and prco < ''  090'''
> 
>  
> 
>  
> 
>      c/exec sql
> 
>      c+ Prepare DynSqlStmt from :sql
> 
>      c/end-exec
> 
>  
> 
>      c/EXEC SQL OPEN C1
> 
>      c/END-EXEC
> 
>  
> 
>      c                   dow       1=1
> 
>      c/EXEC SQL
> 
>      c+ FETCH next from c1 INTO :po#
> 
>      c/END-EXEC
> 
>      c                   if        sqlcod <> 0
> 
>      c                   leave
> 
>      c                   endif
> 
> 
> .... work with po# here....
>  
> 
>      c                   enddo
> 
> 
>      c/EXEC SQL
> 
>      c+ CLOSE C1
> 
>      c/END-EXEC
> 
>  
> 
> This e-mail message, including any attachments, is for the 
> sole use of the
> intended recipient(s) and may contain confidential or privileged
> information.  Any unauthorized review, use, disclosure or 
> distribution is
> prohibited.  If you are not the intended recipient, please contact the
> sender by reply e-mail and destroy the message.
> --
> This is the Midrange Systems Technical Discussion 
> (MIDRANGE-L) mailing list
> To post a message email: MIDRANGE-L@xxxxxxxxxxxx To 
> subscribe, unsubscribe,
> or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/midrange-l
> or email: MIDRANGE-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/midrange-l.
> 
> -----------------------------------------
> This message was scanned for viruses.
> 
> --
> This is the Midrange Systems Technical Discussion 
> (MIDRANGE-L) mailing list
> To post a message email: MIDRANGE-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/midrange-l
> or email: MIDRANGE-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/midrange-l.
> 

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.