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 Search this Thread Display Modes
  #1 (permalink)  
Old 02-18-02, 01: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, 18: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, 00: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
  #4 (permalink)  
Old 03-09-12, 09:15
rvndmore rvndmore is offline
Registered User
 
Join Date: Mar 2012
Posts: 1
inserting value in db2 table using oracle sequence by creating dblink

Hi sethu,

Can you plz explain which databases you are using? is db1 also DB2 database?

i have created db link between oracle and DB2. i am able to fetch/insert data into DB2 from oracle. however i want to use oracle sequence to insert data in db2 table in one of the column. but it is giving error "ORA-02070: database TEMPDB does not support sequence references in this context".


Can anyone help on this?
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