0

"USE DB TO GET SEQUENCE" step is not working in ADD SEQUENCE in Pentaho. Even if the connection and schema is correct and sequence is available the 'SEQUENCE NAME' showing no sequence is available. Is there any other way to get the max value of an 'ID' column and set a variable with max value+1 to START VALUE of the ADD SEQUENCE.

Ms13
  • 151
  • 2
  • 2
  • 14
  • The specific DBMS used is sometimes important when talking about stored sequences. Which DB are you using? It's very difficult to find a generic solution when working with sequences and the JDBC driver isn't helping by identifying the available sequences. – Brian.D.Myers Sep 22 '16 at 17:33
  • i am working on postgresql 9.3.. @Brian.D.Myers – Ms13 Sep 23 '16 at 04:57
  • Ok. Is your column one of the `serial` data types? If so why do you need to generate the values in PDI? You can just run your data to a `Table Output` step and don't map the serial column. This will cause number to be auto generated. – Brian.D.Myers Sep 23 '16 at 06:36
  • i am not using table output instead using INSERT/UPDATE as i do not want to truncate the table every time i run the job .so only new records will get inserted with non duplicate ids @Brian.D.Myers – Ms13 Sep 23 '16 at 06:51
  • `Table Output` does not have to truncate the target table; just uncheck the truncate table check box. Is your ID column a serial type? – Brian.D.Myers Sep 23 '16 at 07:34
  • ya but my id column is of number type and getting generated from add sequence.. – Ms13 Sep 23 '16 at 10:27
  • Please post table DDL. – Brian.D.Myers Sep 23 '16 at 16:27

0 Answers0