in reply to Re: DBD ERROR: error possibly near <*> indicator at char
in thread DBD ERROR: error possibly near <*> indicator at char

SQL statment runs and insert the requred input in the table , so SQL statment is not a problem

I can make it simpler by doing

Insert into prod (ss) select max_ss + 1 FROM (SELECT MAX (ss) max_ss FROM prod)

Replies are listed 'Best First'.
Re^3: DBD ERROR: error possibly near <*> indicator at char
by Lhamo Latso (Scribe) on Sep 20, 2010 at 21:53 UTC
    Better to use a sequence:
    create or replace sequence prod_seq minvalue 1 nomaxvalue start with x +xxx increment by 1 cache 20 noorder nocycle
    Then your insert select can use the nextval function:
    insert into prod (ss) select prod_seq.nextval from dual
    You need to create the sequence only once, but be sure to set the "start with xxxx" to a value higher than anything in your table.

    Paul

      Its not SQL statment issue...

      I guess its perl problem MY SQL statment runs fine but thx for updating me on sequence