Ask a Question

Please fill in the below form and I shall try to reach you as soon as possible

One thought on “Ask a Question

  1. here is my problem in detail:

    I have table test_table.

    create table test_table1 (a number primary key, b number, c number);

    I have the below function in a remote DB. This function is fetching a record from test_table and returning this to calling program.

    create or replace function gettesttablerec(p_a number)
    return test_table%rowtype is
    v_testtablerec test_table%rowtype;
    select *
    into v_testtablerec
    from test_table
    where a = p_a;
    when others then
    return v_testtablerec;

    I have below procedure here in my DB. Where I am trying to call above function from remote DB (through DB link) and insert the same record in another table with same structure. I have written below procedure but giving me some compilation issue. Probably I have never tried such things before so dont have idea about the proper syntax of that.

    create or replace procedure insertintonewtable(p_a number) is
    v_testtablerec test_table%rowtype;
    execute immediate ‘begin :RETVAL := gettesttablerec(:1)@; end;’
    using IN p_a, OUT v_testtablerec;

    insert into test_table1
    values v_testtablerec;

    I hope above info would be sufficient to answer my question, if you you still feel that this not enough please do let me know.

    Bold part is the problematic area.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s