Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: using sequences with dbi

by gbarr (Monk)
on Oct 03, 2001 at 18:44 UTC ( [id://116463]=note: print w/replies, xml ) Need Help??


in reply to using sequences with dbi

It sounds like you are trying to add SQL to a statement using placeholders.

Placeholder can only be used to insert values, you cannot use a placeholder to insert an SQL expression.

You will have to put blah_seq.nextval directly into the SQL and only pass $blah_name to execute.

If you want to be able to specify either to get the next value or a value of your own, without having to SQL statements then you could use

... VALUES( NVL(?,blah_seq.nextval),?)

Then passing undef as the first argument will use the next value from the sequence.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://116463]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-04-25 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found