DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: Dynamic sql problem - Using "IN" in where clause

  1. #1
    Join Date
    Oct 2002
    Location
    london
    Posts
    41

    Dynamic sql problem - Using "IN" in where clause

    I have a dynamic query that is using the IN function in the where clause.
    The query looks like this

    l_SqlString := 'SELECT version FROM DatabaseInfo WHERE Name = :1 AND '
    || ' Version IN ( :2 )';


    The values are specfied at runtime in the format ('val1', 'val2', 'val3')

    However I get a: ORA-01403 no data found error when I try to execute this query using the execute immediate command

    EXECUTE IMMEDIATE l_SqlString INTO l_StaticDataType USING
    'StaticDataType', l_FormattedStaticDataList;

    If I hard code the query and run it from sqlplus (using the same runtime values) data is returned. Is this a bug in dynamic sql or am I missing something?

    btw. Im running 9i release 2
    OCP 8i DBA

  2. #2
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    It's not a bug - it simply works that way. You might want to check this thread:
    http://www.dbasupport.com/forums/sho...threadid=40576
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

Posting Permissions

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


Click Here to Expand Forum to Full Width