HI

> I'm trying to do the following :
> <esql:query>
> INSERT INTO foo(id,url,email,username,password)
> VALUES (<esql:parameter>NEXTVAL('id_seq')
> </esql:parameter>,'abcd','[EMAIL PROTECTED]','dfgdf','123');
> </esql:query>

NEXTVAL is function stored in postgresql.
Consider doing it like this:
1. define table like:
    a) sequence
        CREATE SEQUENCE id_seq;
    b) table
    CREATE TABLE foo (
        id    INT PRIMARY KEY DEFAULT nextval('id_seq'),
        [...]
        other columns
        [...]
    );

2. Inserting data using DEFAULT
    <esql:query>
        INSERT INTO foo (url,email,username,password)
            VALUES ('abcd','[EMAIL PROTECTED]','dfgdf','123');</esql:query>

You get what you wanted, and no error should be generated.
I haven't, because of configuration problems - my server is down, but it
should work.

Hope it helps.

hubert.


---
Ausgehende Mail ist zertifiziert virenfrei.
Uberpruft durch AVG Antivirus System (http://www.grisoft.com/de).
Version: 6.0.265 / Virendatenbank: 137 - Erstellungsdatum: 2001-07-18


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to