Home » SQL & PL/SQL » SQL & PL/SQL » Database Link Insert with Function
Database Link Insert with Function [message #399573] Thu, 23 April 2009 01:21 Go to next message
sysman2007
Messages: 24
Registered: March 2009
Junior Member
Hi

I want insert data from 2 tables to another table on other database.
I use this code to insert my data but I get error:
ORA-04054: database link SALES.ISACO.IR does not exist
ORA-02063: preceding line from SAMAND

when I change function "co_fnc_cur_date" to
TO_CHAR(SYSDATE,'YYYY/MM/DD')
then I can insert data to another table.
insert into tbl_fnv_ins@samand(itemno,itemnoname,itemnostate,upddate, itemnounit)
select wgdm_gdm, wgdm_far_des, wgdm_act_flg,co_fnc_cur_date,wgdm_gume_ume from wgdhs,wgdms
where wgdm_wgds_gds = wgdh_wgds_gds
and wgdh_far_des is not null


Why I can't use function in insert command?
Re: Database Link Insert with Function [message #399575 is a reply to message #399573] Thu, 23 April 2009 01:25 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Because the function at the other end refers to a non-existing database link.
Your problem is not that you cannot use your function, but that that function itself has a problem.
Re: Database Link Insert with Function [message #399576 is a reply to message #399573] Thu, 23 April 2009 01:26 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
I do not know for sure but I suspect]
>Why I can't use function in insert command?
Privs acquired via ROLE do not apply within PL/SQL procedures
Re: Database Link Insert with Function [message #399578 is a reply to message #399575] Thu, 23 April 2009 01:28 Go to previous message
sysman2007
Messages: 24
Registered: March 2009
Junior Member
Frank wrote on Thu, 23 April 2009 01:25
Because the function at the other end refers to a non-existing database link.
Your problem is not that you cannot use your function, but that that function itself has a problem.


Why?
I can use that function without any problem in select from dual;
Previous Topic: NULLIF
Next Topic: How to write query for this
Goto Forum:
  


Current Time: Sat Dec 10 05:27:08 CST 2016

Total time taken to generate the page: 0.11485 seconds