Subject | Re: [firebird-support] Dynamic SQL Error SQL error code = -804 |
---|---|
Author | Kurt Federspiel |
Post date | 2008-10-13T18:52:32Z |
Hi, Anderson.
These produce the same query in C/C++ as long as there is a ' ' at the end of each part of the string.
I had an issue with indicators and had this working for IS_ON. So, I added the time stamp to it (so I could find out when we turned the device on).
That query looks like this:
sprintf( szStatement, "select IS_ON, IS_ON_SINCE "
"from AHU_STATUS where DEVICE=%d ", iDevice );
SQLDA looks like this:
SQLDA1->sqlvar[0].sqldata = (char *) &ThisDEVICE.IS_ON;
SQLDA1->sqlvar[0].sqltype = SQL_LONG;
SQLDA1->sqlvar[0].sqllen = 8;
SQLDA1->sqlvar[1].sqldata = (char *) &iscIS_ON;
SQLDA1->sqlvar[1].sqltype = SQL_TIMESTAMP;
SQLDA1->sqlvar[1].sqllen = sizeof(ISC_TIMESTAMP);
And I get:
Query: select IS_ON, IS_ON_SINCE from AHU_STATUS where DEVICE=212
Call Returned: Dynamic SQL Error SQL error code = -303 conversion error from string "0"
This is driving me crazy.
Kurt.
----- Original Message ----
From: Anderson Farias <peixedragao@...>
To: firebird-support@yahoogroups.com
Sent: Monday, October 13, 2008 10:07:17 AM
Subject: Re: [firebird-support] Dynamic SQL Error SQL error code = -804
Hi,
Anderson Farias
[Non-text portions of this message have been removed]
These produce the same query in C/C++ as long as there is a ' ' at the end of each part of the string.
I had an issue with indicators and had this working for IS_ON. So, I added the time stamp to it (so I could find out when we turned the device on).
That query looks like this:
sprintf( szStatement, "select IS_ON, IS_ON_SINCE "
"from AHU_STATUS where DEVICE=%d ", iDevice );
SQLDA looks like this:
SQLDA1->sqlvar[0].sqldata = (char *) &ThisDEVICE.IS_ON;
SQLDA1->sqlvar[0].sqltype = SQL_LONG;
SQLDA1->sqlvar[0].sqllen = 8;
SQLDA1->sqlvar[1].sqldata = (char *) &iscIS_ON;
SQLDA1->sqlvar[1].sqltype = SQL_TIMESTAMP;
SQLDA1->sqlvar[1].sqllen = sizeof(ISC_TIMESTAMP);
And I get:
Query: select IS_ON, IS_ON_SINCE from AHU_STATUS where DEVICE=212
Call Returned: Dynamic SQL Error SQL error code = -303 conversion error from string "0"
This is driving me crazy.
Kurt.
----- Original Message ----
From: Anderson Farias <peixedragao@...>
To: firebird-support@yahoogroups.com
Sent: Monday, October 13, 2008 10:07:17 AM
Subject: Re: [firebird-support] Dynamic SQL Error SQL error code = -804
Hi,
> sprintf( szStatement, "select IS_ON "Shouldn't it be:
> "from STATUS where DEVICE=%d ", iDevice );
> sprintf( szStatement, "select IS_ON from STATUS where DEVICE=%d ",Regards,
> iDevice );
Anderson Farias
[Non-text portions of this message have been removed]