Skip to Content
avatar image
Former Member

WILD CARDS

hi,

for a database field CHAR(18), if i fill wild card character i.e *, or placeholders i.e +'s will i have any problem while reading the table

thanks in advance

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    May 12, 2006 at 06:13 AM

    i THINK YOU HAVE TO CONVERT THE SAP WILDCARD (*) to the sql wildcard (%) if you are using the 'like' comparison with a character CONSTANT, variable or parameter.

    eg, select SINGLE * from mara where matnr like 'ABC%'.

    But if the variable holding the "*" is a select-option or 'range' you do not need to convert as long as you use 'IN' for the compariosn.

    EG, select SINGLE * from mara where matnr IN S_MATNR.

    Add comment
    10|10000 characters needed characters exceeded

  • May 12, 2006 at 06:05 AM

    Hi surendra,

    if you are using wild card in your select statement then you have to add 'like' keyword in place of = then it will work fine

    Regards

    Sumit Bhutani

    <b>Ps reward points if helpful</b>

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      i have tried using LIKE in select query. but it doesnt fetch any records for '*'. actually * should replace any characters and fetch me all the records. am i right ?

      but a '%' works well.

      what do u say ?

  • avatar image
    Former Member
    May 12, 2006 at 06:14 AM

    Hi Surendra,

    There wont be any issue in using wildcard characters from the table. You have to use LIKE instead of '=' while doing retrieveing data based on wildcard character from the table. You can also use wild card character for pattern based search using CP (Contain Pattern)in the table.

    Cheers,

    Vikram

    Pls reward helpful replies!!

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 12, 2006 at 06:17 AM

    HI

    GOOD

    AS YOU HAVE MENTIONED WHERE DO YOU WANT TO USE THE WILD CARD CHARACTERS ACTUALLY IN THE SELECT STATEMENT OR IN THE DECLARITION OF FIELD TYPE.

    IF YOU R ACCESSING THE DATABASE TABLE THROUGH QUERY USING THE WILD CARD CHARACTER LIKE * THAN VERY MUCH YOU CAN DO THIS BUT NOT LIKE + AND IF YOU WANT TO DECLARE THE FIELD LIKE CHAR(*) THAN IT WILL GIVE YOU A ERROR.

    THANKS

    MRUTYUN

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 12, 2006 at 06:06 AM

    I don't think you will have a issue as such.

    If you have a WHERE the data is WILD char's, you might have to use the ESCAPE SEQ char.

    Regards,

    Ravi

    Note : Please mark the helpful answers

    Add comment
    10|10000 characters needed characters exceeded