How to use variable in the LIKE function along with % operators

Hi,
Is there any way i can use the variable in the Like function. That means i have query like
SELECT * FROM Device WHERE DeviceName LIKE %v_MediaName%;
Here "v_MediaName" is the userdefined variable which contains string. I want to retrieve all the records from the "DEVICE" table whose DeviceName LIKE %v_MediaName%;
If i put it in a single quotes '%v_MediaName%' then the v_MediaName will be treaded as a string instead of a variable. I am using this query in a Procedure.
please help me out to resolve the issue.
thanks

LIKE '%'||v_MediaName||'%';
Will not make use of the indexes though.
Message was edited by:
satishkandi

Similar Messages

  • Using variable in the Like Search

    Hello,
    I am having some trouble in writing the query for the below requirement.
    I have a variable @LineName whose value is 'WEP3' and the datatype is varchar(50).
    I have a table called CacheStore which has the below columns
    ID            SearchWord          
    1              Ant
    2              WEP
    3              WE
    Now I want to know the search words which are similar to @LineName value. In the output, When I write a query I just want to see
    ID               SearchWord
    2                 WEP
    3                  WE
    The bottom line is I want to get the records from CacheStore table which are similar to the @LineName value.
    Please help me with the query. Thank you so much.

    Thank you all for your replies. The above proposed solution partially resolved my issue. But I am still seeing some problem.
    I have a search word in the cachestore table which is 'WEP3-SEG-1'
    When I execute the below query, I am expecting to see 'WEP3-SEG-1' in the output
    Declare @LineName varchar(50)  = 'WEP3-SEG-1A'
    Select * From
    CacheStore where @LineName like 
    '%' + SearchWord 
    + '%'
    But I am getting all the below search words along with 'WEP3-SEG-1'
    ID           SearchWord
    2                P
    3               %
    4               -
    5               3
    6             'WEP3-SEG-1'
    I just want to see this in the output
    ID              SearchWord
    6               'WEP3-SEG-1'
    How to achieve this? Thanks again for all your help.

  • How to use variables in the mail text while sending mails through workflows

    Dear All,
                   I had prepared a workflow in which i am sending mail to a administrator if personnel data of any employee is changed.But i want to send the personnel no of employee whose data have been changed.How can i send this personnel no in the mail.
                  Points will be rewarded for useful answer.

    Hi Anand,
    You have the "EmployeeNumber" field in the event container. Pass this into the workflow container by defining a Workflow Container element and subsequently use this container as a variable in your email using insert fields option and you will have the PersonNumber visible in your mail sent to the administrator.
    Regards,
    Karthik

  • HT1841 How to disable some of the automatic function from my bluetooth (jabra) while iphone does not have the capacity to set up the bluetooth property like BB?

    How to disable some of the automatic function from my bluetooth (jabra) while iphone does not have the capacity to set up the bluetooth property like BB?

    Sorry. You're not making sense. Please re-phrase the question or post in your native language.

  • How to use variables with

    I need to get the number of lines in internal table, which would
    be easy, using DESCRIBE TABLE itab LINES lines. But the problem
    is, that I get the name of this internal table in the field of
    another internal table, so I have to use the name of internal
    table as variable, but I don't know how to use variables with
    DESCRIBE TABLE (or if this is possible).

    Hi,
    REPORT ZPRUEBA782 .
    define two tables with diferent structures.
    data: begin of table1 occurs 0,
    registro type i,
    end of table1.
    data: begin of table2 occurs 0,
    registro type i,
    repid like sy-repid,
    end of table2.
    data: rows type i.
    start-of-selection.
    fill them with data
    do 1000 times.
    table1-registro = sy-tabix.
    append table1.
    enddo.
    do 1757 times.
    table2-registro = sy-tabix.
    table2-repid = sy-repid.
    append table2.
    enddo.
    call a form that receives as input the table and returns the number
    of rows as output.
    perform howmanyrows tables table2 changing rows.
    break-point. "evaluate the number of rows
    perform howmanyrows tables table1 changing rows.
    break-point. "evaluate the number of rows
    end-of-selection.
    form howmanyrows tables itable changing rows.
    rows = 0.
    loop at itable.
    add 1 to rows.
    endloop.
    endform.
    You can try it if you don't find a better solution.
    Cheers,
    Chaitanya.

  • How to use database look up table function in xsl mapping

    Can anybody tell me how to use database look up table function while mapping xsl between 2 nodes.
    I have an XML file coming in and depending on one of XML elements we need to decide which further path to take. But, using this XML element, we need to query database table, get metadata and accordingly take appropriate path. I have written lookup function which returns metadata value.
    Now, the issue is how do I pass the XML element valu as input to look up function? When I tried to drag it to the input node of lookup function, it throws an error like "Maximum number of parameters exceeded"
    Thanks,

    If the lookup table is always going to remain the same (e.g. a character generator or something similar) you can place the values in a 2D array constant on your diagram, with the input value as one column, the equivalent as the other. When you need to perform the lookup you use an index array to return all the values in the "input column", search it using "search 1D array" and use the resulting index number to index the other column's data. If the values may change, then it would probably be best to load an array control with your equivalent values from a file.
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • How to include variable in the text column in report painter?

    Dear Expert,
    Would like to seek for your help to include How to include variable in the text column in report painter?Please advice.
    Thank you.
    Regards,
    Karen
    Edited by: Karen Swee Ping Ho on Jun 17, 2011 2:48 AM

    Hi,
    Thank you for the promt reply.
    1) How I include the variable in the column header to display fiscal year which I have selected from the selection screen?
    which variable should i use?
    2) Where can i find more information about the characteristic and which variable to be use base on the characteristic?
    For example: I would like to display the fiscal year from the selection screen/input screen when execute the report which also will reflected to the element definition and will display the fiscal year also in the column text?
    3) Kindly advise base on question 2, the variable that i use in element definition it will also display  in selection screen?
    4) When execute the report the first selection screen input parameter it obtain from where it is from element definition?
    5) Please advice how to be done when report execute with first screen input selection will also reflect the element definition of column and rom with the selection of the fiscal year?
    Please help.
    many thanks
    Edited by: KH on Jun 18, 2011 7:18 AM

  • Using variables in the title of the graph

    Hi Gurus,
    I would like to use - for example a presentation- variable in the title of a graph.
    I assign a value for that variable in dashboard prompt.
    Does anybody know the syntax of using variable in the title of a graph
    (Not in a Title view!)
    Thanks in advance .
    Regards
    Laszlo

    You can reference presentation variables in the following areas :
    Title Views
    Narrative Views
    Column Filters
    Column Formulas
    Conditional Formatting conditions
    Chart scale markers.
    Gauge range settings.
    Static text.
    Direct Database Requests
    Dashboard prompts
    iBot Headlines and text

  • How to put decimal in the substring function

    Hi Friends
    I am having a input value which is a UDF named GetValue which is mapped with a substring (0,4) which is again mapped to a split by value and then to the target field MENGE
    My problem is when value is coming from GetValue and i am mapping it to substring there i want to take the decimals also
    forexample let us value coming is 2 than in the substring and then to the target field i want to send as 2.000.
    Please help me how it can be done.
    Thanks

    Hi Aquarian,
    The value which is coming from GetValue UDF, map that to a FormatNumber Function
    Use the standard function 'formatnumber' with number format 0.00
    double click on 'formatnumber' function in mapping editor to get number format field.
    you need not put anything in the 'decimal separator' field.
    this function is available in arithmetic set of standard functions.
    I believe this should be it.
    Let me know if you need more help.
    Thanks,
    Varun

  • How to create Variables for the Key Figures

    Hi All,
    How to create Variables for the Key Figures
    Thanks
    Bhaskar

    Hi,
    It is not possible to create the variables on Key figures directly. But we can create a formula variable with processing type 'User Entry' ,SO that the user entered value can be used in the calculations of the query.
    With rgds,
    Anil Kumar Sharma .P

  • How to use @variable(bouser) in Universe to get BOE userid in Xcelsius

    Dear Expert,
    I have request that need to display BOE userid to displayed in Dashboard using Xcelsius,
    after searching in Internet, i found that it can be done by using @variable(bouser) in an object in the Universe, and use the object in Qaaws, but i don't how to use it.
    already tried insert /* @variable('BOUSER') */ in END_SQL universe parameter, but still no luck.
    my question is :
    how to use @variable(bouser) in universe? and then my Xcelsius can display the BOE userid?
    thanks in advance for any answer.
    I Using SAP Integration KIT to create universe from Query BEX
    Luqman
    Edited by: luqman hakim on Jun 29, 2010 4:03 PM

    >
    Didier Mazoue wrote:
    > Hi,
    >
    > You are mentioning that you are using SAP Integration Kit.
    > Does it mean that the source you are targeting is SAP BW?
    >
    > If it is the case, this is unfortunately not supported.
    > SAP BW MDX does not support calculated expressions that return string or date: this is a limitation of SAP BW engine.
    > This is one of the reason why a lot of user exit are used to address these needs.
    >
    > Regards
    > Didier
    Didier Mazoue 
    yes, my Data source is SAP BW, and connected to BOE via SAP INT KIT.
    It's too bad that SAP doesn't support so simple requirement.
    you said : user exit 
    are used to address these needs.
    so there are possibility to solve my problem.
    would you give me the logic of user exit?  which part I should create the user exit
    I'm quiet familiar with user exit in BW
    thanks

  • How to use variable in source path of an image  in flex

    hello
    i just want to know that how to use variable in source path
    of an image in flex

    I am doing exactly that with data binding at the moment. This
    is my Image element
    <mx:Image width="50" minHeight="50" height="76"
    source="{Application.application.parameters.api}/rest/entity/{data.Slug}/Image"
    />
    Note the curly brackets
    HTH
    Pat

  • How to use variable in topology

    Hi every one..
    how to use variable in topology

    The normal way you use in interface or procedure. But the package you are executing should have the variable in 1st step with set or refresh mode.

  • How do I turn off the yelp function In maps or Siri?

    How do I turn off the yelp function on maps?  Instead of locating all the McDonalds on a map, the way Siri used too, she gives me a ( useless) list.  Please help!

    you dont

  • How does the sync functionality work with large libraries on small devices?

    How does the sync functionality work with large libraries?
    Say I sync 100gb of photos with the new Photos app and turn on sync on a 16gb iphone. Will it fill the device up to 16gb? Can I tell it to limit to xgb so I leave room for music and apps? How does this work? Will it slow down my phone if its trying to sync 100gb across smaller devices?

    "Will the Apple TV now read directly from the Time Capsule?" ATV does not 'read' from the TC. It connects to the Mac and itunes library associated with the Mac. Of course the itunes program can 'point' to a library on the TC. You'll still need to have itunes open and the Mac powered on and not sleeping with the TC mounted to the Desktop to use ATV properly. So bottom line the use of TC just adds one more step to view files on the ATV.

Maybe you are looking for

  • I was LIED to regarding a SERVICE UPGRADE. UNBELIEVABLY disappointing and dishonest

    I have been a loyal verizon customer for over a year. Was excited to have my new service installed at my new place. $106 a month including DVR. Very pleased.  I could not view my bill or change services within the first month but wanted to look into

  • How to structure a multiple business WM solution in SAP

    Hi there, I am in a preparation phase to show our business the merits of SAP WM, replacing a third party system. As I'm new to WM I'm struggling a bit with the possible structures to use for our DC. I understand the SAP and standard WM structures how

  • Error while trying to duplicate a database

    I've got the following problem with rman-duplicate (oracle 10gR2) (see also: [this thread|http://forums.oracle.com/forums/thread.jspa?messageID=4446855#4446855]) RMAN-00571: =========================================================== RMAN-00569: ====

  • Add JavaScript to boxes and buttons

    This question was posted in response to the following article: http://help.adobe.com/en_US/captivate/cp/using/WS5b3ccc516d4fbf351e63e3d119e9581edd-7feb.h tml

  • Transferring pics from ipad2 to PC

    I do not have iphoto on my PC and itunes will not allow me to export photos. So how do I export files from my iPad2 device to my windows PC. Can anyone recommend an app, a software, or some sort of procedure to do so. Please and thank guys because i