× 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.




I am receiving SQL0900 when trying to issue an insert statement from an RPG program. I tried Google and the SQL Reference but couldn't find anything other than connect to the database first. That doesn't make sense because the statement is being issued against the DB2 database. I don't have to connect when I use query statements.

Is the insert different and I really do need to issue a connect or is it something else?

This is the code for the insert.

p AddSequential b Export
d AddSequential pi
d Attributes LikeDS(ORIOAttributes)
d Record LikeDS(ORTITLE)
d Status LikeDS(ORIOStatus)

d RecordOut ds LikeDS(ORTITLE) Occurs(1)
d RowsToAdd s 10i 0

c Eval RecordOut = Record
c Eval RowsToAdd = Attributes.atOprReq

c/Exec SQL
c+ Insert into ORTITLE :RowsToAdd rows values (:RecordOut)
c/End-Exec

c If SQLStt <> Success
c CallP csrError()
c EndIf

//-----------------------------------------------------------------
// sqlOptions - Set SQL options
//-----------------------------------------------------------------
c sqlOptions BegSr

c/Exec SQL
c+ Set Option
c+ AlwBlk = *Read,
c+ Commit = *None,
c+ CloSQLCsr = *EndMod
c/End-Exec

c EndSr

p AddSequential e

Rick Chevalier
<<Chevalier, Rick.vcf>>


Privileged and Confidential. This e-mail, and any attachments there to, is intended only for use by the addressee(s) named herein and may contain privileged or confidential information. If you have received this e-mail in error, please notify me immediately by a return e-mail and delete this e-mail. You are hereby notified that any dissemination, distribution or copying of this e-mail and/or any attachments thereto, is strictly prohibited.

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.