[PHP] Re: SQL question, getting error and not sure why

2002-05-31 Thread Michael Virnstein
This Read does not block read. read does not block write. write does not block read. write blocks write on the same column. should read: Oracle has a row locking mechanism, so the following blocking mechanisms apply, when two or more oracle sessions want to operate on the same row: read does

[PHP] Re: SQL question, getting error and not sure why

2002-05-31 Thread Michael Virnstein
and don't do something like insert into (col1, col2) values ('1', '2'); to oracle. this is deadly if you do insert into (col1, col2) values ('3', 4'); afterwards, oracle will not know this query. it'll have to parse it again, because you used literals. you have to use bindvars, if it is

[PHP] Re: SQL question, getting error and not sure why

2002-05-30 Thread Michael Davey
insert into acteursenc (nuacteur,nomacteur) (select AA, BB from (select max(nuacteur)+1 AA from acteursenc), (select 'Michael Sweeney' BB from acteursenc)) produces an ORA-1: unique constraint error. The primary key is

[PHP] Re: SQL question, getting error and not sure why

2002-05-30 Thread Michael Sweeney
lol sorry, buttons are too close together in OE. Anyon ehave a sugestion on a different way of doing what I want to do? Should be easy but i;m starting to get a headache from this (6-7 years not doing SQL doesn't help either) [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL

[PHP] Re: SQL question, getting error and not sure why

2002-05-30 Thread Michael Virnstein
the problem is, that the second sql produces more than one row. To be exactly the amount of select count(*) from acteursenc rows, with 'Michael Sweeney' as value in BB. Perhaps you have a unique key on nomacteur?! I could help further, if i know what you want to do with your query. if nuacteur

[PHP] Re: SQL question, getting error and not sure why

2002-05-30 Thread Michael Davey
Is the key a numeric sequence (1001, 1002, etc...)? If so, you could do a select count(*) from table and add your offset to that (1000 from the example above) Does this help? Mikey Michael Sweeney [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... lol sorry,

[PHP] Re: SQL question, getting error and not sure why

2002-05-30 Thread Michael Virnstein
with second sql i meant: (select 'Michael Sweeney' BB from acteursenc) if you want one row and you need a dummy table, use dual. Michael Michael Virnstein [EMAIL PROTECTED] schrieb im Newsbeitrag [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... the problem is, that the second sql produces more

Re: [PHP] Re: SQL question, getting error and not sure why

2002-05-30 Thread Rouvas Stathis
I would use a trigger with a sequence, as in: CREATE SEQUENCE sequence_name_SEQ INCREMENT BY 1 START WITH -99 MAXVALUE 99 MINVALUE -9 CYCLE

Re: [PHP] Re: SQL question, getting error and not sure why

2002-05-30 Thread Michael Virnstein
yes, in that way the query i suggested would look like: insert into acteursenc (nomacteur) values ('Michael Sweeney') and nuacteur would be provided by the before insert trigger automatically. that's like mysqls autoincrement. Michael Rouvas Stathis [EMAIL PROTECTED] schrieb im