GilbertoJunior
Programmer
Hi,
i will send again and try explain exactly problem happens when i try read the same data in SQL Server 2000 at Machine with Windows 2000 Server SP3.
I need test the LOCK of SQL Server. In native files, when i try read a registry with the open I-O clause, the FILE STATUS of this file, return the code "93" or "99". Well, i´m trying get this STATUS of SQL Server, but i don´t get! How to i´m doing this:
EXEC SQL
DECLARE EDT CURSOR FOR
SELECT CODIGO, DESCRICAO FROM NATUREZAS WHERE CODIGO = 16
END-EXEC
*=================================================================
* DEFINE ACTION WHEN AN 'SQLERROR' EXCEPTION OCCURS
*=================================================================
EXEC SQL
WHENEVER SQLERROR GO TO
-END (according with explanations of Brad, but LOCK is NOT A ERROR, correct? )
END-EXEC.
*=================================================================
* RECEIVE THE NUMBER OF ITEMS IN THE TABLE BY USING THE COUNT FUNCTION.
*=================================================================
EXEC SQL
OPEN EDT
END-EXEC.
EXEC SQL
FETCH EDT INTO :TNAT-CODIGO, :TNAT-DESCRICAO
END-EXEC
DISPLAY SQLCODE SQLSTATE SQLMSG AT 2101
What´s happen. When two users, access for the same data the LOCK occurs in the SQL and my application stops in a FETCH clause. If the nobody user not liberate this data, my application don´t goback for my controller. How to resolve this?!
Regards,
i will send again and try explain exactly problem happens when i try read the same data in SQL Server 2000 at Machine with Windows 2000 Server SP3.
I need test the LOCK of SQL Server. In native files, when i try read a registry with the open I-O clause, the FILE STATUS of this file, return the code "93" or "99". Well, i´m trying get this STATUS of SQL Server, but i don´t get! How to i´m doing this:
EXEC SQL
DECLARE EDT CURSOR FOR
SELECT CODIGO, DESCRICAO FROM NATUREZAS WHERE CODIGO = 16
END-EXEC
*=================================================================
* DEFINE ACTION WHEN AN 'SQLERROR' EXCEPTION OCCURS
*=================================================================
EXEC SQL
WHENEVER SQLERROR GO TO
END-EXEC.
*=================================================================
* RECEIVE THE NUMBER OF ITEMS IN THE TABLE BY USING THE COUNT FUNCTION.
*=================================================================
EXEC SQL
OPEN EDT
END-EXEC.
EXEC SQL
FETCH EDT INTO :TNAT-CODIGO, :TNAT-DESCRICAO
END-EXEC
DISPLAY SQLCODE SQLSTATE SQLMSG AT 2101
What´s happen. When two users, access for the same data the LOCK occurs in the SQL and my application stops in a FETCH clause. If the nobody user not liberate this data, my application don´t goback for my controller. How to resolve this?!
Regards,