Results 1 to 7 of 7

Thread: lock rows

  1. #1
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1

    Thumbs down Unanswered: lock rows

    Hi,

    I have a select where this statement return more one rows and i nedd lock this row, but i want not use for update, how can to do this activity.

    Thank you.

  2. #2
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    780
    Hi Georgipa,

    Please test running SET ISOLATION TO REPEATABLE READ;
    SELECT .......

    Gustavo.

  3. #3
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Hi,
    You can give me an example for this activity, for example seudo code.

    Than you for your help.

  4. #4
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    780
    Hi,

    Please test:

    Begin work;
    set isolation to repeatable read;
    select * from anytable
    where .....

    This lock all read rows.

    Gustavo.

  5. #5
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Hi,

    I test this statements in a session and other user login in other session and execute this same statements and no lock row.

    thank you for you help.

  6. #6
    Join Date
    Aug 2003
    Location
    Argentina
    Posts
    780
    Hi Georgipa,

    The lock is put. Tried you to rewrite the row ??

    Gustavo.

  7. #7
    Join Date
    Dec 2002
    Location
    Madrid - Spain
    Posts
    422
    Provided Answers: 1
    Hi,
    In this case is fine, but I need execute
    begin work;
    set isilation to repeatable read;
    select * from table1
    where codigo_tabla = "XX";


    and lock this rows thar return this select, whether other user execute

    begin work;
    set isilation to repeatable read;
    select * from table1
    where codigo_tabla = "XX"

    in this case the program will be show a messge that rows is locked for other user.

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •