I'm having a bit of a problem with using my sequence within a
c.customer_id IS NULL
- 00000 - "sequence number not allowed here"
*Cause: The specified sequence number (CURRVAL or NEXTVAL) is
here in the statement.
*Action: Remove the sequence number.
You cannot use sequences in queries with
ORDER BY or put in into a subquery:
SELECT q.*, customer_id_seq.nextval FROM ( SELECT c.cust_name, c.site FROM customer c WHERE c.customer_id IS NULL ORDER BY c.site_code ASC ) q