If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > New Members & Introductions > 02291 - integrity constraint using SEQ.CURRVAL

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-13-11, 06:09
jeffries jeffries is offline
Registered User
 
Join Date: Nov 2010
Posts: 5
02291 - integrity constraint using SEQ.CURRVAL

INSERT INTO BRANCH VALUES ('B'||''||BRANCH_SEQ.NEXTVAL, 'FROOD STREET', 'PAISLEY', 'G65 3TA', 01418251070);

INSERT INTO STAFF VALUES ('S'||''||STAFF_SEQ.NEXTVAL, 'WULLIE', 'BROWN', 'TECHNICIAN', 20000, 'M', 'B'||''||BRANCH_SEQ.CURRVAL);

Cant get this to work
first insert creates branchno B10

if I replace the insert into staff for seq.currval to B10 it works

However using the BRANCH_SEQ.CURRVAL is gioving constraint error to do with parent key

Help me please
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On