I'm able to use BCI (UniBasic SQL Client Interface) with one statement environment, but when I try to add a second one it stops working.
The manual says "You allocate the SQL statement environment with the SQLAllocStmt function. This function allocates memory for an SQL statement environment and returns its address, or handle, in a variable. You can establish more than one SQL statement environment for the same connection environment." If I remove the query, then the update works. Both the query and the update work fine if I paste them into a SQL query tool. Is there something else I need to do to get multiple statement environments to work? Code: STATUS = '' STATUS<-1> = SQLAllocEnv(database.env) STATUS<-1> = SQLAllocConnect(database.env,connection.env) STATUS<-1> = SQLConnect(connection.env, DATASOURCE, USERNAME, PASSWD) STATUS<-1> = SQLAllocStmt(connection.env,query.stmt.env) STATUS<-1> = SQLAllocStmt(connection.env,update.stmt.env) GOSUB CHECK.STATUS ;* Try querying before updating... STATEMENT = 'select * from FoundationFamilyDataCollection' CRT STATEMENT STATUS<-1> = SQLExecDirect(query.stmt.env,STATEMENT) MSG = 'Executing query' GOSUB CHECK.STATUS DATESTAMP = OCONV(@DATE,"D4/MDY") STATEMENT = "UPDATE tPAMemberInfo SET updatedDatetime = '":DATESTAMP:"' WHERE rowId = '1'" CRT STATEMENT STATUS<-1> = SQLExecDirect(update.stmt.env,STATEMENT) MSG = 'Executing update' GOSUB CHECK.STATUS Output: : XWDS.TEST.BCI.WRITE select * from foundationfamilydatacollection UPDATE tPAMemberInfo SET updatedDatetime = '02/08/2006' WHERE rowId = '1' STATUS IS -1 MSG IS Executing update ERROR, STOPPING. Thanks, Wendy Smoak ------- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/