Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2003
    Posts
    30

    Unanswered: SQL for getting data thru OTG for DB2

    Hi,

    Following is the query:

    "select count(*) into no_of_rec_db2
    from JJDB2.SUP@ORASUP
    where CHANGE_TIMESTAMP<=&start_timestamp;

    Orasup is the DB link created via OTG to access remote DB2 data.

    This query gives the following error from a PL/SQL block .
    DECLARE
    *
    ERROR at line 1:
    ORA-04052: error occurred when looking up remote object JJDB2.SUP@ORASUP.WORLD
    ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-320: the declaration of the type of this expression is
    incomplete or malformed

    The same query works for all other tables. The only difference I can find in this table from rest all is the key column name is 'NUMBER" which is a keyword in Oracle. The query works fine from SQL. It gives error only from PL/SQL block.

    DId anyone came across this issue and found a solution. Please share.
    I tried to use cursors, DBMS_SQL package too. No use.

    Thanks
    Santhi

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    What happens with...
    select count(rowid) into no_of_rec_db2
    from JJDB2.SUP@ORASUP
    where CHANGE_TIMESTAMP<=&start_timestamp;
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Nov 2003
    Posts
    30
    I am just trying to get number of records based on some criteria from DB2 via OTG from a PL/SQL block.
    I get the error as posted above.

Posting Permissions

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