|
-
Sep 12th, 2001, 03:30 PM
#1
Thread Starter
Addicted Member
locking a record with SQL
I want to lock (read-only) a record with an SQL statement.
How can I do that ?
I'm not an expert in sql....
-
Sep 13th, 2001, 06:58 AM
#2
Thread Starter
Addicted Member
is it possible do to that with a select statement ??
-
Sep 13th, 2001, 07:03 AM
#3
Fanatic Member
Well ...
Yeah, with SQL Server you can put (UPDLOCK) after the table name in the FROM clause to lock the data you've selected until you update it.
What database are you using?
-
Sep 13th, 2001, 07:12 AM
#4
Thread Starter
Addicted Member
That's complicated..
My database is on an AS/400 server.
I'm using an activeX called ActiveObject/400
With this activeX , there's a control wich can be use to send sql commands on the server. This is why I wanted to know if it was possible to do so...
Maybe I should use a ADO or something like this to send my command...
Thanks for any help
-
Sep 13th, 2001, 07:31 AM
#5
Fanatic Member
Locking is not supported by standard SQL - there may be extensions that support it (as with SS7) but it is application specific. The locking is almost always defined by the database engine and can be passed off to the driver (e.g. OLE DB or ODBC). It is not possible to give you an outright answer because it depends upon your specific database.
Cheers,
P.
Not nearly so tired now...
Haven't been around much so be gentle...
-
Sep 13th, 2001, 07:34 AM
#6
Thread Starter
Addicted Member
that's what I thought, but I wanted to be sure that it was impossible to do this with a standard sql command..
thanks for help
-
Sep 13th, 2001, 09:45 AM
#7
Thread Starter
Addicted Member
But I heard that it was a pissibility to use locking with the command Set Transaction ...
But Ì don't know much more about this command..
-
Sep 13th, 2001, 10:03 AM
#8
Fanatic Member
Well ...
BEGIN TRANSACTION starts a transaction and COMMIT ends it. You could try these in your SQL, everything must be done in the same session though.
-
Sep 14th, 2001, 06:07 AM
#9
Addicted Member
TRANS
Hi,
I think you will find that TRANSACTIONS do not neccessarily lock the records. Without going into too much detail you would need to consider the Transactional Level being enforced.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|