eww, that is ugly :-)
But it shows that I might just be done by now if I had just done multiple queries to accomplish the task.  I guess I could do a cflock around them to group'em.

>I don't know the proper way to do this, but I can tell you the hideously
>unattractive and effective three-query way that I do it.  I use various
>items to create something that I know will be unique.  For example, I
>concatenate user ID and current time.  I put that in a local variable.  I
>run the insert query, putting this unique value into some field that really
>is for something else, say product_description.  I run a select query
>pulling the primary key for the row that has that unique value in
>product_description.  I then run an update query, putting the proper product
>description in the row at the primary key found.
>
>As I said, ugly, but effective.
>
>Good luck,
>Matthieu
>
>-----Original Message-----
>From: daniel kessler [mailto:[EMAIL PROTECTED]
>Sent: Thursday, September 16, 2004 10:54 AM
>To: CF-Talk
>Subject: Re: Using a value from one insert for another insert
>
>
>I'm now receiving an invalid character error.  I can do each of the inserts
>independently, but when I put them together with the RETURNING line, I get
>the error.
>
>INSERT INTO fsnep_polls
>(
>p_id,p_date_added,p_question,
>p_status,p_date_last_used
>)
>VALUES
>(
>unique_poll_Num_s.NEXTVAL,#Now()#,'#Form.p_question#',
>#Form.p_status#,#p_date_last_used#
>)
>RETURNING p_id INTO new_p_id;
>
>INSERT INTO fsnep_pollAnswers
>(
>pA_ID,pA_answer
>)
>VALUES
>(
>unique_pollAnswers_Num_s.NEXTVAL,
>'#Form.p_answer1#'
>)
>
>  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to