How to use string variable onside quotes

Hi,
i would like to know how to use string variable onside quotes. what i mean is if i have a LOV variable P_STATUS as character string.
and in my PL/SQL function i give a query as
Q AS VARCHAR2(1000) := 'SELECT * FROM EMP
WHERE STATUS = :P_STATUS';
Is this correct. I Know that the above statement works when the LOV is an integer, but when i use a character LOV return value the above statement does not work. how can i get in the character LOV value.
Can someone help me please.
Thanks,
Philip.

916753 wrote:
Yes I tried binding all the values separately. It is working, but, I am trying to pass all values by variableBut you can't. The variable is holding a single string value.... that is just 1 value. Your binding are expecting multiple values. You can't bind 1 string value and expect Oracle to magically know how to break your string up into seperate values for the bind variables. What if one of your bind variables actually needed e.g. a comma seperated string as it's value? How would Oracle know that?
You must bind each thing seperately. That's the way cursors work.
, because i have more than 150 tables in which data will be load. that's why i m trying to create a unique procedure to load data one by one table. Otherwise I have to write individual procedures for per procedures.It's a hard life being a software programmer, but somebody's got to do it. Unfortunately there are too many people who try and write "generic" procedures and expect them to just work. I mean why don't Oracle just implement some SQL command so you can do...
execute immediate 'load all my tables';save us all the hassle eh!? ;)
when i write all the columns like
execute immediate (insert_string) using rc1.TOLL_ID, rc1.LANE_ID, rc1.RECEIVED_DATETIME, rc1.LANE_QUERY, c1.EXECUTED_DATETIME
but it is not possible to generate runtime variable thats why I m trying to assign all values to a single variable and use it like
execute immediate (insert_string) using (v_string)
how can I separate the values and ho to use it .Don't use execute immediate. Use the DBMS_SQL package instead and bind your values dynamically with loops to cover all the columns you need etc.

Similar Messages

  • How to use string Variables for data provider names

    Really what I need to be able to do is insert the variable
    name in this:
    dataProvider="{chartXML2.lastResult.month.day}"
    I need to replace the "month" with a string variable name
    (i.e public var monthName = "January";)
    I also need to do the same for the categoryfield as it will
    not let me do categoryfield=$String.
    In PHP this is incredibly easy to do. You just say
    blah=$string . In fact, in PHP you can embed variable names
    everywhere. Its very powerful. For instance, in php, for the
    dataprovider issue above, i'd just do
    dataProvider="{chartXML2.lastResult.$StringName.day}"
    and it'd work just fine. Whats the syntax for doing this in
    Flex?

    You can use bracket notation. But don't. Use a reuslt handler
    to wrap the xmllist in an XMLListCollection instance variable and
    bind to that.
    Tracy

  • How  can use a variable in the folowing code?

    How  can use a variable 'W_ROWNUM2' in the folowing code?
    MOVE '1' TO CNT.
    LOOP AT L_T_PM2.
                  CONCATENATE '0' CNT INTO W_ROWNUM2.CONDENSE W_ROWNUM2.
                   CONCATENATE 'F110V-VARI'W_ROWNUM2'(01)' INTO FLD2.
        perform  DYNPRO_FIELD       using FLD2
                                     L_T_PM2-vari12_con.
                   CNT = CNT + 1.
                   CONDENSE CNT.                                                              
    ENDLOOP.
    I need to increment the value of W_ROWNUM2.
    Please ,it is urgent!!

    Hello
    CONCATENATE 'F110V-VARI'W_ROWNUM2'(01)' INTO FLD2.
    Try using spaces between parts of the resulting string.
    CONCATENATE 'F110V-VARI'  W_ROWNUM2  '(01)'   INTO FLD2
    Regards
    Greg Kern.

  • Set "url" in HTTPService using String variable

    Hi,
    How can I set "url" in HTTPService using String variable (see below). I've tried different formats of string & variable concatenations.
    privtate var myurl:String = "http://localhost/";
        <mx:HTTPService id="post_submit_service"
            url="{myurl+'test.php'}"
            method="POST"
            resultFormat="text"
          result="result_handler(event)"
          fault="fault_handler(event)">
            <mx:request xmlns="">
          </mx:request>
        </mx:HTTPService>
    Thanks,
    ASM

    try following:
    url="{myurl}test.php"

  • How to use the variables used in the message mapping

    Hi ,
    In the message mapping we can declare variables in the JAVA section , these variables could be used across the mapping .
    I have tried using it but I am unable to retrieve the values assigned to the variables in one UDF into the another UDF .
    Please guide me how to use the variables declared in the JAVA section in the message mapping .
    Thanks
    Anita Yadav

    Anita,
    I have worked on the Global variables and i found no issues. Make sure that the variable is declared in the Declaration Section and then initlaized in the Initialization section.
    If you declare a variable in the Declaration Section ,
    int i;
    then in any udf you can use if directly. No need to re declare  the variable in the UDF. If you do this, then it becomes a local variable.
    Regards,
    Bhavesh

  • Using environment variable / double quotes in "Arguments" in "Server Start"

    I have an admin server, NodeManager, and 1 managed server, all on the same machine (windows). I am trying to enter something similar to this to the arguments field in the Server Start tab:
    -Dmy.property=%USERPROFILE%\someDir\someJar.jar
    But when the managed server is started it throws this exception:
    Error opening zip file or JAR manifest missing : %USERPROFILE%\someDir\someJar.jar
    It appears that the environment variable is not being translated into it's value. It is just passed on to the managed server as plain-text. I tried surrounding the path with double quotes (") but the console validates the input and does not allow this: *"Arguments may not contain '"'"*
    Even editing the config.xml file manually cannot work, as the admin server fails to startup after this:
    <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason: [Management:141266]Parsing failure in config.xml: java.lang
    .IllegalArgumentException: Arguments may not contain '"'.>
    I also tried using %20 to no avail, it is just passed as %20.
    I thought that perhaps this had something to do with the spaces in the value of %USERPROFILE% (which is "C:\documents and settings.."), but the same thing happens with other env. variables which point to other directories with no spaces.
    _My question:_
    Is there any supported way of :
    using double quotes? what if i have to reference a folder with spaces in it's name?
    reference an environment variable? What if i have to rely on it's value for distributed servers where i do not know in advance the variable's value?
    Edited by: 937622 on Sep 28, 2012 1:02 AM

    There is workaround : http://stackoverflow.com/questions/12629395/weblogic-using-environment-variable-double-quotes-in-arguments-in-server
    Just posting here for reference. Let's see if we get a different answer from anyone else.

  • How to use bind variables in the following query

    CREATE OR REPLACE PROCEDURE MMDB.test IS
    sel_qtn VARCHAR2 (10);
    CURSOR PT_QUANTITY IS select * from mmdb.product_tree WHERE QUANTITY_CHECK ='E'
    AND run_id = 100
    a PT_QUANTITY%ROWTYPE;
    BEGIN
    FOR i IN PT_QUANTITY
    loop
    sel_qtn := i.quanttity-1;
    While sel_qtn>=1
    loop
    insert into mmdb.product_tree (BILLING_ACCOUNT_NO ,S_CODE) values (i.BILLING_ACCOUNT_NO ,i.S_CODE||'E');
    sel_qtn :=sel_qtn -1;
    End loop;
    commit;
    end;

    Don't duplicate threads: How to use bind variables in the following query

  • How to use bind variables in this procedure

    Hi Experts,
    How to use bind variables in this procedure for static queries.
    PROCEDURE DELETE_MER_PROC (M_id IN NUMBER)
    IS
    BEGIN
    V_date DATE;
    SELECT PD_DATE INTO v_date FROM PD_MAINTAIN;
        DELETE FROM MER_CLEAR
        WHERE MER_DT < v_date
        AND ID = M_ID;
    COMMIT;
    END;   
    How to use  v_date and m_id as bind variables in this procedure to avoid hard parsing.
    Please help me.
    Thanks.

    976208 wrote:
    How to use  v_date and m_id as bind variables in this procedure to avoid hard parsing.
    You cannot avoid hard parsing - as the 1st time a SQL statement (like the SELECT or DELETE statements in your code) is encountered, it does not reside in the server's Shared Pool, and needs to be added into the pool via a hard parse.
    Bind variables does not prevent hard parsing. Hard parsing happens when the SQL statement (with or without bind variables) is a brand new statement encountered by the server.
    Bind variables enables the same SQL cursor to be reused, by simply changing the bind variable value.
    Not using bind variables means that each SQL statement is unique and not shareable - as the value is hardcoded into the statement and cannot be changed via a bind value. This typically means LOTS of different SQL statements (where the only difference is the changed value in the statement) are created - with each statement being a new statement not seen before in the Shared Pool and needing to be hard parsed.
    One does not design one's code not to be hard parsed. There ALWAYS will be a hard parse in order to get a SQL statement into the Shared Pool. One designs one's code to REUSE cursors in the Shared Pool.

  • How to use Bind Variables in Essbase data control

    Hi,
    I am trying to use Bind Variables in MDX query while creating the Essbase Data Control. I have used the below query with the Bind Variable.. this query is working in Essbase admin console..but it is throwing error (*Invalid MDX Query)* while creating Essbase Datacontrol in JDeveloper.
    MDX Query : SELECT {[Measures].Msr_2} ON COLUMNS, [Time].Children ON ROWS FROM cube
    where ($name)
    Could any body suggest me on how to use bind variables with Essbase Data control.
    Thanks,
    Swathi

    Hello Swathi, can you please help me how you created Essbase DataControl? Also were you able to figure out this?
    Thanks, Praveen.

  • How to use bind variable

    Hi,
    I have the below cursor 1 which is working already.For my requirement i want to use bind variable like second cursor.But its telling Bind Variable "p_col_list" is NOT DECLARED.Please any onehelp me on this.
    How to use bind variable Here.
    Cursor1:
    DECLARE
    emp_cv sys_refcursor;
    iid NUMBER := 1;
    i_sql varchar2(100);
    p_col_list varchar2(2000) := 'aaa,bbb,ccc,ddd';
    BEGIN
    i_sql := 'select '''||REPLACE(p_col_list, ',', ''',''')||''' from dual '||CHR(10) ;
    dbms_output.put_line(i_sql);
    OPEN emp_cv FOR i_sql ;
    END;
    Cursor2:
    DECLARE
    emp_cv sys_refcursor;
    iid NUMBER := 1;
    i_sql varchar2(100);
    p_col_list varchar2(2000) := 'aaa,bbb,ccc,ddd';
    BEGIN
    i_sql := 'select '''||REPLACE(:p_col_list, ',', ''',''')||''' from dual '||CHR(10) ;
    dbms_output.put_line(i_sql);
    OPEN emp_cv FOR i_sql using p_col_list;
    END;

    hello,
    the reports parameterform capabilities are limited. if you want
    to create sophisticated parameterforms, you should do that with
    oracle forms or html forms.
    regards,
    the oracle reports team --pw                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to use ADF variables in C:when test?

    I have a <af:iterator in my page fragment as follows
    <af:iterator id="i1" value="#{queryModel.currentDescriptor.conjunctionCriterion.criterionList}" var="criterion" varStatus="vs">
    Within this iterator, I want to make a decision absed on the index of the iterator. To do this test, I am using jstl as follows
    <c:when test="${vs.index == '0' or vs.index == '2' or vs.index == '4'}">
    This test is however always evaluating to false. I have tried cahnging my code using various combiantion as below ...
    <c:when test="#{vs.index == '0' or vs.index == '2' or vs.index == '4'}">
    <c:when test="${vs.index == 0 or vs.index == 2 or vs.index == 4}">
    <c:when test="${vs.index == '0' || vs.index == '2' || vs.index == '4'}">
    But nothign seems to be working fine.
    Can some one help me with what I am doing wrong?
    Thanks.

    How to use ADF variables in <C:when test?

  • How to use a variable on columns using Oracle Data Integrator

    How to use a variable in oracle Data Integrator expically on colums.

    yes exactly,i selected update on new column,if i didn't select update on new colum then error is not coming regarding update.
    but this time error is coming on "insert new rows".
    java.lang.NullPointerException
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.bindSessVar(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.bindSessVar(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskPreTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Unknown Source).
    Can u please tell me what stpes i have to follow to solve this

  • How to use shared variables?

    Hello..
            Can anybody please guide me in using shared variables... I'm learning LabVIEW 8.5.... But did not understand how to use shared variables... I tried to read web pages regarding shared variables but got confused.... So anyone can please help me...?
             Thanks for any help from you...

    You will have to give us the whole picture. What is your client computer; a PAC, desktop etc? What are you running on the client computer; a VI or an executable? Where are you going to deploy your library? On the host machine or the client machine?
    If I assume that you are running a VI on the client machine and are depolying the library on the host, all you have to do is to create another shared variable and bind it to the variable on the host machine. You can do this by checking the Bind to Source option when creating the variable and browsing to the network item in options. Be sure to have the library deployed on the host side before you attempt to do this otherwise you won't be able to find the variable.
    Adnan Zafar
    Certified LabVIEW Architect
    Coleman Technologies

  • How to use string format in TextInput?

    How to use string format in TextInput?
    Ex.
    HH:MM:SS when typing message appear in 12:34:56 form.
    N,NNN when typing message appear in 1,234,567 form.

    look up for "Using formatters" in the FB help.
    Essentially you'll instantiate a format, NumberFormatter for
    numbers for example, and set it's properties like e.g. showing a
    thousand separator and then one some event of the TextInput --
    valueCommit for example -- you'll do something like:
    ti.text = nf.format(ti.text)
    this is would also give you opportunity to validate user
    input using the same formatter and valid event.
    ATTA

  • How to use xsl-variables

    I have the following piece of code. The numbers are the number of the code lines.
    In line 17 I want to assign a value to the attribute value of the node options. The value should be the value of the xsl-variable "wildart" which i declared in line 7. How can use the value of this variable in line 17 correctly?
    1     String xsl =
    2      + "<form name=\"wildart\" action=\"/servlet/model/ServletTransformerTest\"  method=\"post\">"
    3      + "<select name=\"wildart\" onChange=\"form.submit()\">"
    4      + "<option>Bitte Ausw�hlen</option>"
    5      + "<xsl:for-each select=\"//tier\">"
    6      + "<xsl:sort select=\"@wildart\" data-type=\"text\"/>"
    7      + "<xsl:variable name=\"wildart\" select=\"@wildart\"/>"
    8      + "<xsl:variable name=\"name\" select=\"@name\"/>"
    9      + "<xsl:variable name=\"anzahl\" select=\"count(//tier[@wildart=$wildart])\"/>";
    10                
    11     if(optionSelected == null) {
    12
    13        xsl = xsl           
    14        + "<xsl:for-each select=\"//tier[@wildart =$wildart]\">"
    15        + "<xsl:if test=\"position()=last()\">"
    16        + "<xsl:if test=\"@name=$name\">"         
    17        + "<option value=\"$wildart\">"
    18        + "<xsl:value-of select=\"@wildart\"/>"
    19        + "</option>"
    20        + "</xsl:if>";
    21     }

    use : "<option value=\"{$wildart}\">"

Maybe you are looking for