Re: [SQL] One to many query question

2003-07-30 Thread Eric Clark
> This doesn't allow multiple genre's per CD, though, does it? A CD > can only have 1 genre_id. I would like the ability to have multiple > genres, in which case a third table is necessary: > > CREATE TABLE cd_genres ( > cd_id integer, > genre_id integer > ); > > cd_id references cd.id

Re: [SQL] One to many query question

2003-07-30 Thread Eric Clark
On Wed, 2003-07-30 at 12:35, Dave Dribin wrote: > CREATE TABLE cd ( > id integer unique, > artist varchar(25), > title varchar(25) > ); > > CREATE TABLE cd_genres ( > cd_id integer, > genre varchar(25) > ); I think you've got this backwards. There is no advantage i

Re: [SQL] locks and variable substitution

2003-07-25 Thread Eric Clark
On Fri, 2003-07-25 at 11:49, [EMAIL PROTECTED] wrote: > > lock table excl_table in exclusive mode; That probably wont work, but this will: EXECUTE ''LOCK TABLE '' || quote_ident(excl_table) || '' IN EXCLUSIVE MODE''; Eric ---(end of broadcast)--