Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2005

    Unanswered: loop with dblink

    I have one more quesiton regarding for loops:

    This table is in the Other Schema and Iam accessing it through the DBLINK.

    A (Other Schema)

    USER_ID are the columns

    Here ES_ID and ROLES_ID both are different, Iam just getting the ROLES_ID from the SEQUENCE

    So For each ES_ID ,user_id in the Table A, I want to create an entries at the other table called B
    execute immediate 'select ES_id,user_id from' ||a||'@'||dblink into e,f;

    for k in (e,f ) loop

    insert into table B(User_Id,ROLES_ID);

    Table A
    1 john
    1 paul
    2 kim

    I want to insert like

    John 101
    Paul 101
    Kim 102

    This 101 and 102 are the ROLE_ID which Iam generating from the sequence. Any help would be great.

  2. #2
    Join Date
    Feb 2004
    Is the schema in the same instance?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts