Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: using sequences with dbi

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

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.