problem with n_settexisparam API

Post Reply
acoulson0
Posts: 8
Joined: Thu Dec 21, 2000 8:01 am

problem with n_settexisparam API

Post by acoulson0 »

I don't appear to be having any luck using the n_setttexisparam API followed by n_texis to execute the query.
This code fragment:
if (!n_settexisparam(se,1,"KR",(int *)NULL,SQL_C_CHAR,SQL_LONGVARCHAR)) {
printf("setparam failed\n");
} else if(!n_texis(se, "select id from patent where length(pabstract)=?;", sql)) {
FREE_CONFIG();
printf("%s\n", errorString);
}

Produces this result:
SQL: Needed parameters not supplied in the function: execntexis
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

problem with n_settexisparam API

Post by John »

While initializing the database for the first n_texis call the parameters are getting removed. We will work on getting that resolved, but the simplest workaround would be to run a simple query first, e.g.

n_texis(se, "set likeprows=100;");

before calling n_settexisparam.
John Turnbull
Thunderstone Software
acoulson0
Posts: 8
Joined: Thu Dec 21, 2000 8:01 am

problem with n_settexisparam API

Post by acoulson0 »

Would I encounter the same problem using n_preptx and n_exectx?
User avatar
John
Site Admin
Posts: 2622
Joined: Mon Apr 24, 2000 3:18 pm
Location: Cleveland, OH
Contact:

problem with n_settexisparam API

Post by John »

No you won't. You can use n_settx and n_runtx to get the same functionality as n_texis, but without the problem you were seeing with parameters.
John Turnbull
Thunderstone Software
sbeavers
Posts: 9
Joined: Wed Jan 31, 2001 7:31 pm

problem with n_settexisparam API

Post by sbeavers »

I notice in this example the programmer was able to get an error text message using "errorString" which appears to be something he defined in his program. How do I get the error text from an unsuccessful call to n_texis?
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

problem with n_settexisparam API

Post by mark »

Post Reply