>-----Original Message-----
>Subject: Get New Record ID in ORACLE
>From: Douglas Knudsen <[EMAIL PROTECTED]>
>Date: Tue, 7 Jun 2005 10:41:52 -0400
>Thread: 
>http://www.houseoffusion.com/cf_lists/index.cfm/method=messages
>&threadid=40571&forumid=4#208799
>
>select mysequence.nextval into newid from dual 
>
>You are using a sequence for your IDs, no? 
>
>DK

LOL. Yes i am using sequences for my IDs.

I have a sequence called s. This code:

<cfquery name="nextval" datasource="trademak">
select s.nextval into newid from dual
</cfquery>

fails with error [Macromedia][Oracle JDBC Driver][Oracle]ORA-00905:
missing keyword 

This code:

<cfquery name="nextval" datasource="trademak">
select s.nextval from dual
</cfquery>

works just fine. So i am assuming that you insert a new row like this:

<cfquery name="nextval" datasource="trademak">
select s.nextval from dual
</cfquery>

<cfquery name="testinsert" datasource="trademak">
insert into t (id,name) values(#nextval.nextval#,'this is a test')
</cfquery>

i was just wondering whether you had found a way to make "select
mysequence.nextval into newid from dual" work in a cfquery block (like
anonymous pl/sql or something). Have you?

/t

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:208807
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to