Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

solution for return clause not supported

650629Sep 2 2008 — edited Sep 2 2008
Hi all,
I am trying to insert into a table through a db link. The problem I have determined with the good help of this forum is that a returning clause cannot be used with a dblink. It is not supported and not possible. This is the original code:

declare
l_CALL_ID number;
begin
insert into TRK_CALLS@DBLINK_IM3
(USER_, ASSIGNED_TO, PROBLEM, SOLUTION, STATUS)
values
(:P3_USER_, :P3_ASSIGNED_TO, :P3_PROBLEM, :P3_SOLUTION, :P3_STATUS)
returning id into l_CALL_ID;

insert into TRK_CALLS_TIME@DBLINK_IM3
(CALL_ID, DATE_, TIME, TIME_ASSIGNMENT_TO)
values
(l_CALL_ID, to_date(:P4_DATE_,'MM/DD/YYYY'), :P4_TIME, :P4_ASSIGNED_TO);
end;

Can anyone help me determine how to do the same thing without the return clause? Probably with a select or other.
I have two tables with id being the PK for the TRK_CALLS and CALL_ID being where the PK should be inserted into the second table TRK_CALLS_TIME.

As suggested on this forum, I have tried:
removing the return clause and putting in
select TRK_CALLS_SEQ.nextval into l_CALL_ID FROM DUAL;
after begin
and I get ORA-01400: cannot insert NULL into ("G6IMXGSC"."TRK_CALLS"."ID") ORA-02063: preceding line from DBLINK_IM3

Any ideas as to the exact code that needs to be implemented.
I am quite a dummy when it comes to the PL/SQL so please spell it out for me if anyone has a solution.
Thanks,
Kirk
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 30 2008
Added on Sep 2 2008
3 comments
633 views