Re: SQL question, getting error and not sure why

From: Date: Thu, 30 May 2002 15:11:29 +0000
Subject: Re: SQL question, getting error and not sure why
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-99945@lists.php.net to get a copy of this message
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" <mike_sweeney@videotron.ca> wrote in message news:20020530150737.21542.qmail@pb1.pair.com... > 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) > > > > <mikey@splatted.net> wrote in message > news:HAEFKPCKLBGCHCLFKKENCEGLCCAA.mikey@splatted.net... > > Maybe it does in Oracle - you should check your documentation though... > > > > BTW, please post your replies to the list rather than me personally :-) > > > > > -----Original Message----- > > > From: Michael Sweeney [mailto:mike_sweeney@videotron.ca] > > > Sent: 30 May 2002 15:58 > > > To: Michael Davey > > > Subject: Re: SQL question, getting error and not sure why > > > > > > > > > I thought it gave you the highest record value, IE recrods > > > containing values > > > 1-10, it would return 10 > > > > > > > > > ----- Original Message ----- > > > From: "Michael Davey" <mikey@splatted.net> > > > Newsgroups: php.general > > > To: <php-general@lists.php.net> > > > Sent: Thursday, May 30, 2002 10:52 AM > > > Subject: Re: SQL question, getting error and not sure why > > > > > > > > > > > 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-00001: unique constraint error. > > > > > > > > > > The primary key is nuacteur, but by setting AA to max(nuacteur)+1 I > > > should > > > > > be getting a new key that is unique, however it does not seem > > > that way. > > > > > > > > > > What am I doing wrong here? > > > > > > > > I'm not an Oracle expert, but surely max(field) + 1 is one > > > higher than the > > > > maximum value possible for the column? > > > > > > > > (Probably irrelevant snippet from mySQL manual: > > > > MAX(expr) > > > > Returns the minimum or maximum value of expr. MIN() and MAX() may take > a > > > > string argument; in such cases they return the minimum or maximum > string > > > > value.) > > > > > > > > regards, > > > > > > > > Mikey > > > > > > > > > > > > > > > > > > > > >

« previous php.general (#99945) next »