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 > Database Server Software > Oracle > Using the sequence of db2 from db1 for inserting a record

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-18-02, 02:01
sethu sethu is offline
Registered User
 
Join Date: Feb 2002
Posts: 17
Using the sequence of db2 from db1 for inserting a record

From db1 ...I am trying to insert into db2...All the columns inserting correctly ...except the field with sequence value...

I have a sequence created in db2 named 'seq_request'.

I am not able to use the sequence of db2('seq_request')...Pls see the below insert statement
Is there any specfic way to use the sequence...do i have to give the db link name also..


"INSERT INTO TESTUSER.AUDIT123@MAINLINK(AUDITFIELD2,AUDITFIELD1 ,SEQ_REQUEST) VALUES ("test1","test2",SEQ_REQUEST.NEXTVAL)";
Reply With Quote
  #2 (permalink)  
Old 02-18-02, 19:26
alligatorsql.com alligatorsql.com is offline
Registered User
 
Join Date: Jul 2001
Location: Germany
Posts: 189
Hello,

there many ways to use the sequenz object of a remote database.

1) Use the link directly in the insert statement - as you already mentioned

2) Use a stored function with a pragma statement to do that for you

3) Use a public synonym with a dblink

Hope this help.

Manfred Peter
Alligator Company
http://www.alligatorsql.com

* did you ever use multiple RDBMS with one tool - try AlligatorSQL *
Reply With Quote
  #3 (permalink)  
Old 02-20-02, 01:00
sethu sethu is offline
Registered User
 
Join Date: Feb 2002
Posts: 17
IT IS WORKING FINE NOW

I tried as below and it is working fine Now..


Thanks for the Inputs....

INSERT INTO TESTUSER. AUDIT123@MAINLINK(AUDITFIELD2,AUDITFIELD1,SEQ_REQU EST)
VALUES ('t1','t2',testuser.seq_request.nextval@mainlink)



Reply With Quote
Reply

Thread Tools
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