Copy/paste didn't work correctly. I have corrected the code: Brian Vraamark
-----Oprindelig meddelelse----- Fra: Brian Vraamark [mailto:[email protected]] Sendt: 26. juni 2015 14:20 Til: For discussion among Firebird Developers Emne: Re: [Firebird-devel] SQL_LONG is filled with 8 bytes. I do. This is the complete code regarding XSQLDA: paramBuffer = new char[XSQLDA_LENGTH(1)]; if (paramBuffer==NULL) { internalError = BERR_OUT_OF_MEMORY; return 0; }; tmpXSQLDA = (XSQLDA *) paramBuffer; tmpXSQLDA->version = SQLDA_VERSION1; tmpXSQLDA->sqln = 1; tmpXSQLDA->sqld = 1; tmpXSQLDA->sqlvar[0].sqltype = SQL_LONG; tmpXSQLDA->sqlvar[0].sqldata = (char *)&returnedID; status=database->fec.isc_dsql_allocate_statement_f(statusVector,&database->dbHandle,&tmpStmtHandle); if (status!=IB_NO_ERROR) { delete [] paramBuffer; internalError=BERR_STATUS_ERROR; return 0; }; status = database->fec.isc_dsql_prepare_f(statusVector,&(tmpTrans->transHandle),&tmpStmtHandle,0,sqlStr.cstr(), 3, tmpXSQLDA); if (status!=IB_NO_ERROR) { delete [] paramBuffer; database->fec.isc_dsql_free_statement_f(tmpStatusVector,&tmpStmtHandle,DSQL_drop); internalError=BERR_STATUS_ERROR; return 0; }; status=database->fec.isc_dsql_execute2_f(statusVector,&(tmpTrans->transHandle),&tmpStmtHandle,1,NULL,tmpXSQLDA); if (status!=IB_NO_ERROR) { delete [] paramBuffer; database->fec.isc_dsql_free_statement_f(tmpStatusVector,&tmpStmtHandle,DSQL_drop); internalError=BERR_STATUS_ERROR; return 0; }; I have to correct myself. It's not after prepare I get 0 in the second array element. It is if I set sqlData and sqltype *Before* prepare I. Brian Vraamark -----Oprindelig meddelelse----- Fra: Dimitry Sibiryakov [mailto:[email protected]] Sendt: 26. juni 2015 14:11 Til: For discussion among Firebird Developers Emne: Re: [Firebird-devel] SQL_LONG is filled with 8 bytes. 26.06.2015 14:06, Brian Vraamark wrote: > Only difference is putting it after prepare always results in 0 in the second > element: I see that you don't set sqllen. -- WBR, SD. ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel **************************************************************************** Denne mail er blevet scannet for virus af TDC Mailfilter. **************************************************************************** ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel **************************************************************************** Denne mail er blevet scannet for virus af TDC Mailfilter. **************************************************************************** ------------------------------------------------------------------------------ Monitor 25 network devices or servers for free with OpManager! OpManager is web-based network management software that monitors network devices and physical & virtual servers, alerts via email & sms for fault. Monitor 25 devices for free with no restriction. Download now http://ad.doubleclick.net/ddm/clk/292181274;119417398;o Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
