Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

isc_dsql_exec_immed2

15 views
Skip to first unread message

brian.a...@gmail.com

unread,
Jun 8, 2006, 5:15:57 PM6/8/06
to
I had been having problems getting isc_dsql_exec_immed2() to work in
Firebird 1.5.3. Unless the correct parameters and the XSQLDA struct is
setup correctly isc_dsql_exec_immed2() will crash.

With the below code I got it working:

long tmpLong = 0;
short flag = 0;
out_data = (XSQLDA *) malloc( XSQLDA_LENGTH(1) );
out_data->version = SQLDA_VERSION1;
out_data->sqln = out_data->sqld = 1;
out_data->sqlvar[0].sqltype = SQL_LONG;
out_data->sqlvar[0].sqlscale = 0;
out_data->sqlvar[0].sqldata = (char *) &tmpLong;
out_data->sqlvar[0].sqllen = sizeof( long );
out_data->sqlvar[0].sqlind = &flag;

if( isc_dsql_exec_immed2(status, &m_dbhandle, &trans, 0, sqlstatement,
SQL_DIALECT_CURRENT, NULL, out_data) )
/* handle error */

This post is just a heads-up for others who may be having a similar
problem - AFAIK there is no bug in the implementation of the call,
though returning an error message instead of crashing would have been
nicer.

Brian

0 new messages