Subject | Re: describe_bind |
---|---|
Author | blahclayton |
Post date | 2004-08-20T08:07:02Z |
sorry, the errors you have pointed out were errors in the message not
in the code so it still doesn't work!!!
I have now cut & pasted the correct code instead of trying to retype
it.
unsigned int nSize = 1;
XSQLDA* sqlda = (XSQLDA *) malloc(XSQLDA_LENGTH(nSize));;
sqlda->version = 1;
sqlda->sqld = nSize;
sqlda->sqln = nSize;
char* text = NULL;
for(unsigned int i = 0; i < nSize; i++)
{
short nullid = -1;
// sets up each parameter
if(text != NULL)
{
sqlda->sqlvar[i].sqllen = strlen(text);
nullid = 0;
}
sqlda->sqlvar[i].sqldata = text;
sqlda->sqlvar[i].sqltype = SQL_TEXT;
sqlda->sqlvar[i].sqlind = &nullid;
}
Again any help would be much appreciated!!
Thanks in advance!!
--- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov"
<SD@t...> wrote:
in the code so it still doesn't work!!!
I have now cut & pasted the correct code instead of trying to retype
it.
unsigned int nSize = 1;
XSQLDA* sqlda = (XSQLDA *) malloc(XSQLDA_LENGTH(nSize));;
sqlda->version = 1;
sqlda->sqld = nSize;
sqlda->sqln = nSize;
char* text = NULL;
for(unsigned int i = 0; i < nSize; i++)
{
short nullid = -1;
// sets up each parameter
if(text != NULL)
{
sqlda->sqlvar[i].sqllen = strlen(text);
nullid = 0;
}
sqlda->sqlvar[i].sqldata = text;
sqlda->sqlvar[i].sqltype = SQL_TEXT;
sqlda->sqlvar[i].sqlind = &nullid;
}
Again any help would be much appreciated!!
Thanks in advance!!
--- In firebird-support@yahoogroups.com, "Dimitry Sibiryakov"
<SD@t...> wrote:
> On 19 Aug 2004 at 14:01, blahclayton wrote:to -
>
> >However when I set the null indicator (sqlda->sqlvar[i].sqlind)
> >1, i get the error again (-804 - An error was found in application
> >input parameters for the SQL statement!!).
>
> Some more mistakes.
>
> >
> >e.g.
> >
> >unsigned int nSize = 1;
> >short nullid = 0;
> >XSQLDA* sqlda = (XSQLDA *) malloc(XSQLDA_LENGTH(nSize));;
> >sqlda->version = 1;
> >sqlda->sqld = nSize;
> >sqlda->sqln = nSize;
> >char* text = NULL;
> >for(unsigned int i = 0; i < nSize; i++)
> >{
> >
> >
> > if(text != NULL)
> > {
> > nullid = -1;
> Should be 0 there.
> > sqlda->sqlvar[i].sqllen = strlen(text);
> > }
> else
> {
> nullid = -1;
> }
> > // sets up each parameter
> > sqlda->sqlvar[i].sqldata = text;
> > sqlda->sqlvar[i].sqltype = SQL_TEXT;
> > sqlda->sqlvar[i].sqlind = &nullid;
> >}
>
> SY, Dimitry Sibiryakov.