Re: [GENERAL] insert serial numbers

2006-01-04 Thread Sven Willenberger
Albert Vernon Smith presumably uttered the following on 01/03/06 13:36: I figured it out myself. Not TOO difficult. I was just having a hard time wading through the documentation before. Giving the answer out here, just in case any one else wants to see the solution (not using reserved

Re: [GENERAL] insert serial numbers

2006-01-04 Thread Alban Hertroys
Albert Vernon Smith wrote: CREATE FUNCTION "return_one_id" () RETURNS "trigger" AS ' Is there any reason you force your identifiers to be case sensitive? > CREATE TRIGGER return_one_id BEFORE INSERT OR UPDATE ON two FOR EACH >> CREATE TABLE "one" ( >> "one_id" BIGSERIAL, >> "text" text

Re: [GENERAL] insert serial numbers

2006-01-03 Thread Albert Vernon Smith
I figured it out myself. Not TOO difficult. I was just having a hard time wading through the documentation before. Giving the answer out here, just in case any one else wants to see the solution (not using reserved words ;-)). 1. Made function: CREATE FUNCTION "return_one_id" () RETURN

Re: [GENERAL] insert serial numbers

2006-01-03 Thread Albert Vernon Smith
Realized. It was just a dummy-example, and I made a poor choice for my example. Replaced reserved word, but the question still stands. -a Rewritten info without the reserved word: CREATE TABLE "one" ( "one_id" BIGSERIAL, "mytext" text NOT NULL, CONSTRAINT "iu_mytext" UNIQUE (myt

Re: [GENERAL] insert serial numbers

2006-01-03 Thread codeWarrior
Don't use reserved words for column names. "Albert Vernon Smith" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have two tables, listed as below. I'm inserting values for "text" into >table "two" (which must already exist as "text" values in table "one"). >When I do that, I'

[GENERAL] insert serial numbers

2006-01-03 Thread Albert Vernon Smith
I have two tables, listed as below. I'm inserting values for "text" into table "two" (which must already exist as "text" values in table "one"). When I do that, I'd like to also insert the associated "one_id" value from table "one" into the field "two.one_id". How is best to go about tha