|
|
|
|
|
- How to lock a table or the query records?
- Native ORACLE Access
- Native MySQL Access
SQLLock (Function)
Disponible solo con este tipo de conexión
Used to lock: - The entire data table, in read and write mode. This data cannot be accessed by the other computers.
- The records selected by the query. This data cannot be accessed by the other computers. This method can be used to update records for example. The query result is not returned.
SQLLock can be used on all Native Accesses (except SQLite and XML) and on some OLE DB providers (according to the capacities of provider and database). This function has no effect for the tables accessed by ODBC drivers. Qry is string // Start of transaction for lock SQLTransaction(sqlStart) // Locks the entire table SQLLock("CUSTOMER", "Table") // Runs the query Qry = "UPDATE CUSTOMER SET CUSTOMERNAME = 'DOE' WHERE CUSTOMERREF = 1043" SQLExec(Qry, "QRY1") // Unlock the file SQLTransaction(sqlCommit)
QryLock, QryUpdate are strings // Start of transaction for lock SQLTransaction(sqlStart) // Definition of Query QryLock = "SELECT * FROM CUSTOMER WHERE CUSTOMERREF = 1043" // Lock the result of SELECT query SQLLock(QryLock) // Define an update query QryUpdate = "UPDATE CUSTOMER SET CUSTOMERNAME = 'DOE' WHERE CUSTOMERREF = 1043" // Run an update query SQLExec(QryUpdate, "QRY1") // Unlock the records SQLTransaction(sqlCommit)
Sintaxis <Result>: Boolean - True if the lock was performed,
- False otherwise.
<Table name>: Character string Name of data table to lock. <"Table">: Character string "Table": Character string used to block an entire data table.. <Result>: Boolean - True if the lock was performed,
- False otherwise.
<Query text>: Character string Text of query used to select the records to lock. Observaciones How to lock a table or the query records? To lock a table (or the query records): - Start a transaction (SQLTransaction associated with the sqlStart constant).
- Lock the records (SQLLock).
Warning: if you block the records of a query, the query is executed but the result is not returned. - Unlock the records by ending the transaction (SQLTransaction associated with the sqlEnd constant).
Esta página también está disponible para…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|