Rick wrote:
>I've never learned how to create sequences in oracle

Its easy, actually.  On a table that exists named my_filename, create it
like this:

<cfquery datasource="#request.myDSN#">
CREATE SEQUENCE seq_my_filename
INCREMENT BY 1
START WITH 1
MINVALUE 0
CACHE 10;
</cfquery>

The sequence name is just the filename with "seq_" prepended to it.
This is a convention I made up; probably everyone does it I bet.  Every
sequence must have a unique name, just like an Oracle index.

Then when you insert something, you insert the value like so:

<cfquery
datasource="#request.myDSN#">
INSERT INTO my_filename
(
ID,
myCharField
)
VALUES
(
seq_my_filename.nextval,
<cfqueryparam cfsqltype="CF_SQL_VARCHAR"
value=#variables.TheValueFilter#>
)
</cfquery>

HtH,

--------------------------------------------
Matt Robertson       [EMAIL PROTECTED]
MSB Designs, Inc.  http://mysecretbase.com
--------------------------------------------
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to