Part of Database drivers: the hub. 31 entries under this heading; every entry opens as its own topic.
- MS SQL: wrapping updates to several tables in one LOGOUT / COMMIT / ROLLBACK, as with TPS - UseLogout = false, one transaction per connection, keep it short.
- Firebird: a stored procedure called through PROP:SQL does not save its changes - commit it yourself.
- Calling a stored procedure with an OUTPUT parameter through PROP:SQL: "Cannot use the OUTPUT option when passing a constant" - the CALL form with a bound variable.
- Error 56 "LOGOUT already active" - find the unmatched LOGOUT with the driver trace.
- Stored procedure with [INOUT] parameters returned 22001 (Reported, not reproduced) - separate IN and OUT parameters worked for the posters in 2010; a user report, not a confirmed defect.
- MS SQL: reading and incrementing a "next number" row without two users getting the same value - a stored procedure that reads and updates inside one serializable transaction.
- MSSQL: one user blocks another, and when the blocker exits their work since the block began is gone (Reported, not reproduced) - read as an open transaction that was never committed; find the missing COMMIT; no cause was confirmed.
- Two stored procedures fill a queue, one works and one does not: quote marks around string parameters in the call - string parameters need apostrophes around them in the call text you build.
- QODBC (QuickBooks): a stored procedure sent through the ODBC driver returns no data and no error (Reported, not reproduced) - CALL was needed and the driver setting CALLODBC was tried; results are read with NEXT; no outcome was posted.
- PostgreSQL ODBC: a deferred foreign key fails on COMMIT, then every LOGOUT returns error 48 "Unable to Log Transaction" (Reported, not reproduced) - the database rolled back but Clarion kept treating a transaction as active until the program restarted; the ABC relation manager expects no error from COMMIT; no fix was found.
- PostgreSQL: error 48 "Unable to Log Transaction" on a transaction of three updates (Reported, not reproduced) - the posters asked about the role used and whether two LOGOUTs (own code and templates) were active; no outcome was posted.
- PostgreSQL: calling a stored procedure with PROP:SQL gives "is a procedure; Error while executing the query" - declare it as a FUNCTION and call it with SELECT (a function returning void for no result); NORESULTCALL was a third lead that was not tried on the failing procedure.
- Process template handles only every second record when the code deletes the record inside a transaction - the poster sent BEGIN TRAN, ROLLBACK and COMMIT through the file's PROP:SQL instead of LOGOUT, ROLLBACK and COMMIT; untested ideas were a delete queue and processing backwards.
- Calling a stored procedure for every record of a file loop is slow: it is the result handling, not the procedure - avoid the row-by-row loop; have the server return complete result sets through a view, a temp table or one call with IN or BETWEEN; if you keep the loop, FLUSH() the dummy file.
- MSSQL: an app blocks the database once or twice a day, only when it runs as a Windows service (Reported, not reproduced) - a dialog waiting for input a service never gets was the main suspect; ErrorManager logging, the debugger, Profiler and the dynamic management views were suggested; no cause was reported.
- MS SQL: calling a stored procedure with CALL and & parameters gives "Incorrect syntax near '&'" - BIND the variables - BIND both variables under the names written after the &, and the call worked for the poster.
- MySQL: CALL of a stored procedure through PROP:SQL fails while UPDATE and DELETE statements work - SEND(file,'/ODBCCALL=FALSE') before the PROP:SQL, and the call "worked perfectly"; the thread does not say why.
- MS SQL: a stored procedure that runs many UPDATEs and a DELETE with rollback on any error, and calling it with PROP:SQL - Wrap the updates in BEGIN TRAN and COMMIT TRAN, test for an error after each, roll back and return 1; call it with CALL through PROP:SQL.
- MSSQL: a NetTalk web server freezes with a list of SQL record locks after a photo upload - how to find where it stops (Reported, not reproduced) - No cause was found; the posters advised proving the driver is at fault by checking each thread's stack under the debugger or BreakIn when the server freezes.
- Transact-SQL: BEGIN...END versus BEGIN TRANSACTION...COMMIT after an IF, and where GO belongs - BEGIN...END blocks the statements an IF controls, BEGIN TRANSACTION does not; combine them if both are needed, and leave GO out of code sent from Clarion.
- MSSQL: capturing a stored procedure's return value in Clarion - end the procedure with a SELECT and call it with PROP:SQL - End the procedure with a SELECT of the value, call it with CALL and bracketed parameters through PROP:SQL, then NEXT; check ERRORCODE after the call.
- MSSQL: with BUSYHANDLING=2 a Crystal Report hangs on data opened in the calling procedure (Reported, not reproduced) - With BUSYHANDLING=2 a Crystal Report hung on data open in the caller; a PROP:SQL commit freed the locks, the cause was never settled.
- Calling a Clarion program from a SQL trigger to update ISAM files: write to a table and let a scheduled job do it - Do not run a program from a trigger; write the change to a table and let a scheduled job update the ISAM files.
- MSSQL: one generic trigger script to stamp a change date on every table, and what to watch for - Let the template write each table's identity column name into the trigger text; guard against a trigger re-firing itself, and consider a smalldatetime for the stamp.
- MSSQL 2008 R2: a stored procedure called through a dummy file returns no rows, trace shows "Cursor concurrency changed" 01S02 (Reported, not reproduced) - A procedure called through a dummy file returned no rows only on SQL Server 2008R2; the trace showed Cursor concurrency changed 01S02, and no fix was found.
- SQL Server application roles from Clarion: sp_setapprole works, but the role password shows in the trace (Reported, not reproduced) - sp_SetAppRole through SEND works, but the secret appears in the trace log, and the bound CALL form failed with an ad hoc level error; EXECUTE AS untried.
- MSSQL: getting return values from a stored procedure, and showing progress while it runs - Return values by ending the procedure with a SELECT read through PROP:SQL; show progress via a global temporary table and a second connection polling while it runs.
- MSSQL: updating several rows in two tables in one transaction - Clarion LOGOUT around the ABC updates, or a stored procedure? - Keep Clarion's own transactions for low volume, use the TransactionManager template instead of hand-written LOGOUT and COMMIT, and a queue cannot be passed to a procedure without the ODBC API.
- MSSQL: LOGOUT on one thread sets "transaction isolation level serializable" on the main thread's connection too (Reported, not reproduced) - A LOGOUT on one thread set serializable isolation on the main thread's connection too; the /ISOLATIONLEVEL=1 driver option was suggested but not adopted, and no cause was found.
- Running a long stored procedure from Clarion and knowing when it has finished - PROP:SQL cannot run asynchronously; use ODBC asynchronous execution at the API level with polling, or a windowless thread that blocks on PROP:SQL and signals when done.
- SQL: is there a "delete without RI" like Access:Table.DeleteRecord(0) when the RI is done in triggers? - Triggers always fire; steer them with a flag, use cascade constraints or a stored procedure with a parameter, and Relate Delete(True) applies dictionary RI rules.