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



Check if your database is registered via WRKRDBDIRE. If not, run:

ADDRDBDIRE RDB(yourSysName) RMTLOCNAME(*LOCAL)

Other than that... I'm not sure. Perhaps the RDB compile parm on CRTSQLRPGI
is being used and it should not.

HTH, Elvis

Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com


-----Original Message-----
Subject: SQL0900 Application process not in a connected state.


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


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