Subject Re: [firebird-support] Dynamic SQL Error SQL error code = -804
Author Jojakim Stahl
Quoted from list of FB 2.0 error codes:

-804 335544380 wronumarg Wrong number of arguments on call
-804 335544583 dsql_sqlda_err SQLDA missing or incorrect version, or
incorrect number/type of variables
-804 335544586 dsql_function_err Function unknown
-804 335544713 dsql_sqlda_value_err Incorrect values within SQLDA structure
-804 336397205 dsql_too_old_ods ODS versions before ODS%d are not supported

Please verify your code for above reasons. Your SQL statement seems to be
OK.

Hope this helps a little.

--
Jojakim

Am 13.10.2008, 17:51 Uhr, schrieb Kurt Federspiel <federonline@...>:

> I'm just bumping to see if I can get some help...
>
> Kurt.
>
>
>
>
> ----- Original Message ----
> From: Kurt Federspiel <federonline@...>
> To: firebird-support@yahoogroups.com
> Sent: Saturday, October 11, 2008 3:05:39 PM
> Subject: [firebird-support] Dynamic SQL Error SQL error code = -804
>
>
> Greets:
>
> I'm on Ubuntu using 2.1-super (Marius install).
>
> I know I'm missing something very mundane, but I've been at this for a
> couple days, and I can't seem to get my hands around why I'm having this
> issue. I added a STATUS table that maintains the current Status for
> Devices (PK to the Device table).
>
> Thanks in advance...
> Kurt.
>
> All I want to know is if device 212 is on, and it looks like this:
>
> int IS_ON = -1;
>
> memset( szStatement, 0, sizeof(szStatement) );
> sprintf( szStatement, "select IS_ON "
> "from STATUS where DEVICE=%d ", iDevice );
>
> #ifdef __DEBUG
> // IF WE'RE DEBUGGING, KEEP A COPY...
> strcpy( FACSDBQuery, szStatement );
> #endif
>
> SQLDA1 = (XSQLDA*)malloc( XSQLDA_LENGTH( 1) );
> SQLDA1->version = 1;
> SQLDA1->sqln = 1;
>
> // SET UP THE FIELDS RETURNED BY QUERY....
> SQLDA1->sqlvar[ 0].sqldata = (char *) &IS_ON;
> SQLDA1->sqlvar[ 0].sqltype = SQL_LONG;
> SQLDA1->sqlvar[ 0].sqllen = sizeof(int);
>
> // START THE TRANSATION.. ..
> bRetVal = StartQuery(STAT1, SQLDA1, szStatement, ErrorMsg );
>
> // PROCESS THE RESULTS...
> if( bRetVal == true )
> {
> memset( &ThisAHU, 0, sizeof(ThisAHU) );
> if( 0 == isc_dsql_fetch( STAT1, &STMT1, 1, SQLDA1) )
> {
> ThisDEVICE.DEVICE = iDevice;
> ThisDEVICE.IS_ ON = IS_ON;
>
> }
> else
> {
> bRetVal = false;
> }
> }
>
> // CHECK FOR AN ERROR MESSAGE...
> StatError( STAT1, ErrorMsg );
> isc_commit_transact ion( STAT1, &TR1 );
> isc_dsql_free_ statement( STAT1, &STMT1, DSQL_drop);
>
> free( SQLDA1 );
> return bRetVal;
> }
>
>
>
>
> [Non-text portions of this message have been removed]
>