Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2008
    Posts
    7

    Unanswered: Exporting data with wildcards

    Hello,

    I am facing difficulty in exporting data from a table wherein I need to export data starting with "BLCS_%".

    Query that I am using to export is

    ************************************************** ****
    exp User/Password@SID file=Filename.dmp grants=y compress=y indexes=y log=export.log TABLES=TABLEDETAILS QUERY=""" WHERE
    TDIDCODE IN (SELECT TDIDCODE FROM TABLEDETAILS WHERE TDIDCODE IN ('ACTIONS','BLCS_%'))""" statistics=none

    ************************************************** *****

    The combination of above query fetches 39 records, but only 36 records are exported. The wildcard entry "BLCS_%" fails.

    Please help me in rectifying above query.

    Regards,
    Priyesh

  2. #2
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    It should, I guess, be
    Code:
    where tdidcode = 'ACTIONS' or tdicode like 'BLCS_%'
    IN and LIKE don't work the same way.

  3. #3
    Join Date
    Jul 2006
    Location
    Bangalore
    Posts
    57
    Yes, The 'IN' clause doesn't support wild card as 'LIKE' does.

    To be safer side check your query
    HTML Code:
    SELECT TDIDCODE FROM TABLEDETAILS WHERE TDIDCODE IN ('ACTIONS','BLCS_%')
    and see if it is giving you desiered result.
    Ritesh Kumar Singh
    IBM Certified DB2 DBA for LUW
    **Knowledge Is Theft If Not Shared !!**

Posting Permissions

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