Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Yang Yang got cursor error SQLSTATE 07003 / SQLCODE -404 using ESQL in an NSAPI program; the real cause was a failed connection (error -27000). Alan Caldera advised named connections, getpid() as the name, and wrapping CONNECT with NSAPI crit_init(), crit_enter() and crit_exit() around a global CRITICAL variable. He also advised network connections over shared memory. Solved.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Yang Yang — — source: Informix-list mailing list archive (1991-1998)
Hi,
Does anyone has the experience of using informix esql in NSAPI program?
Recently I have been trying but encountered a cursor error with SQLSTATE
07003 and SQLCODE -404. Anyone has clue about this?
Thanks in advance.
Cheers,
Yang Yang
↪ replying to Yang Yang
Alan Caldera — — source: Informix-list mailing list archive (1991-1998)
At what point do you get this message? If its on the fetch, your cursor is not open.
If its on the open you probably have no connection to the database. It is best to
use named connections (via CONNECT TO AS ...). I would recommend using the getpid() call to serve as
your connection name, and protect the EXEC SQL CONNECT with the crit*() NSAPI functions.
Hope this helps.
Alan
Yang Yang wrote:
> Hi,
>
> Does anyone has the experience of using informix esql in NSAPI program?
> Recently I have been trying but encountered a cursor error with SQLSTATE
> 07003 and SQLCODE -404. Anyone has clue about this?
>
> Thanks in advance.
>
> Cheers,
> Yang Yang
↪ replying to Alan Caldera
Yang Yang — — source: Informix-list mailing list archive (1991-1998)
Hi Alan,
Thanks for your help. After further investigating the program, I realized that the DB connection is not
established successfully, an error message -27000 is generated. I should be able to resolve this. Is it
possible to give me an example on how to use crit*() functions? Really appreciate it.
Cheers,
Yang Yang
Alan Caldera wrote:
> At what point do you get this message? If its on the fetch, your cursor is not open.
> If its on the open you probably have no connection to the database. It is best to
> use named connections (via CONNECT TO AS ...). I would recommend using the getpid() call to serve as
> your connection name, and protect the EXEC SQL CONNECT with the crit*() NSAPI functions.
> Hope this helps.
>
> Alan
>
> Yang Yang wrote:
>
> > Hi,
> >
> > Does anyone has the experience of using informix esql in NSAPI program?
> > Recently I have been trying but encountered a cursor error with SQLSTATE
> > 07003 and SQLCODE -404. Anyone has clue about this?
> >
> > Thanks in advance.
> >
> > Cheers,
> > Yang Yang
↪ replying to Yang Yang
Alan Caldera — — source: Informix-list mailing list archive (1991-1998)
Yang Yang,
There are 3 basic calls that you will need to make.
crit_init() must be called in a NSAPI style init function registered in the same manner as the NSAPI
function you are calling. A line such like this:
Init fn=myfunc_init
in your obj.conf file will call the init function. The crit_init() function returns
a variable of type CRITICAL whose definition can be found in the NSAPI header files. This CRITICAL variable
must be global.
The other 2 calls: crit_enter() and crit_exit() need to surround your CONNECT statement. Those 2 functions
take 1 argument which is the CRITICAL variable that you defined globally.
By the way, multithreaded programs such as Netscape really should use your network connection instead of
shared mem. Switch your connect statement to utilize your tli or soc connection depending on your platform.
For more information on the crit() functions consult the Netscape NSAPI Programmers Guide.
Alan
Yang Yang wrote:
> Hi Alan,
>
> Thanks for your help. After further investigating the program, I realized that the DB connection is not
> established successfully, an error message -27000 is generated. I should be able to resolve this. Is it
> possible to give me an example on how to use crit*() functions? Really appreciate it.
>
> Cheers,
> Yang Yang
>
> Alan Caldera wrote:
>
> > At what point do you get this message? If its on the fetch, your cursor is not open.
> > If its on the open you probably have no connection to the database. It is best to
> > use named connections (via CONNECT TO AS ...). I would recommend using the getpid() call to serve as
> > your connection name, and protect the EXEC SQL CONNECT with the crit*() NSAPI functions.
> > Hope this helps.
> >
> > Alan
> >
> > Yang Yang wrote:
> >
> > > Hi,
> > >
> > > Does anyone has the experience of using informix esql in NSAPI program?
> > > Recently I have been trying but encountered a cursor error with SQLSTATE
> > > 07003 and SQLCODE -404. Anyone has clue about this?
> > >
> > > Thanks in advance.
> > >
> > > Cheers,
> > > Yang Yang
↪ replying to Alan Caldera
Y. Yang — — source: Informix-list mailing list archive (1991-1998)
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.