• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

not able to use sequence number with GROUP BY

 
Ranch Hand
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
insert into TABLE1( ID, COL1, COL2) select id_seq.nextval, COL1,COL2, from TABLE2 GROUP BY id_seq.nextval,COL1, COL2

this gives an error saying
ORA-02287: sequence number not allowed here

Because of performance issues, I am not using a ResultSet to get the data and iterate and generate the Id.
Is there any other way i can achieve this?

What I want to do is, select columns from one table with group by, and then insert into the second table with generated ids.
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vivek,
What would it mean to group by sequence number? A sequence number is unique, so you wouldn't actually be grouping anything. It looks like your query would work exactly the same way without the group by clause.
 
reply
    Bookmark Topic Watch Topic
  • New Topic