Flavio Suguimoto wrote: > Hi all, > > I need to mark a row with a value in a column, but first i need to > select the first row without this mark. But in some concurrents cases > i mark the row twice. How can i lock the row to avoid others session > get it? > > TABLE TICKET > TICKET_NUMBER | MARK > 00001 | 1 > 00002 | 0 > > I need to select the first row with 0 in MARK column and then mark it > with 1.
look at the FOR UPDATE in the select docs. -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 512-248-2683 E-Mail: ler@lerctr.org US Mail: 430 Valona Loop, Round Rock, TX 78681-3893 ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match