@variable syntax

(abc.xyz LIKE '%@variable('BOUSER')%'
OR
abc.mnp = @variable('BOUSER'))
is this a correct syntax....I get parsing error in universe conditions....says missing right parenthesis.....
any inputs appreciated.
Pali

Hi Pali,
In your second code statement:
abc.mnp = @variable('BOUSER'))
I can see a second parantheses. You would need to delete the second right parantheses-something like:
abc.mnp=@variable ('BOUSER')
In your first code statement, I think the @variable cannot be used within inverted commas since it would end up treated as a string. You need to create a final string that would concatenate the '%' symbols for you.
Off the top of my head, can you please check if this syntax works:
abc.xyz LIKE concat('%',concat(@variable('BOUSER'),'%'))

Similar Messages

  • Select SQL statement with variable syntax error

    Hi All,
    I am running a Web Application with a java bean to connect to a mysql database. i have compiled a test .java file whcih works using the same statement that has a problem in my web application. Taking the statement out of the Web App makes it work so it must be this stetment:
    String SQLStatement = "SELECT * FROM MASTER WHERE USERNAME LIKE '"+data+"' ";
    This works fine in testing a separate java file, but it does not compile when running ant build to compile the same line of code for my Web App.
    I have tried many possibilities of changing the syntax to no avail, its a puzzle!
    Many thanks for any swift reply.
    ChrisG

    prepare:
    copy:
    build:
    [javac] Compiling 1 source file to C:\jwsdp-1.3\garland\build\WEB-INF\classe
    s
    [javac] C:\jwsdp-1.3\garland\src\LogonBean.java:20: cannot resolve symbol
    [javac] symbol : variable data
    [javac] location: class logonApp.LogonBean
    [javac] String SQLState2 = "SELECT PASSWORD FROM MASTER WHERE PASSWORD L
    IKE '"+data+"' ";
    [javac]
    ^
    [javac] C:\jwsdp-1.3\garland\src\LogonBean.java:79: cannot resolve symbol
    [javac] symbol : variable SQLState1
    [javac] location: class logonApp.LogonBean
    [javac] rs = stmt.executeQuery(SQLState1);
    [javac] ^
    [javac] 2 errors
    Thats the compiler error, but it still works on a normal java file. ill try a prepared statement in the mean time.
    ChrisG

  • Cursor bind variable syntax err

    Any one help me in correcting the syntax, for cursor return.
    Oracle version 10g
    I am trying to execute the sproc and print the cursor results using bind variable, I am getting he below error
    Variable V_REFCUR REFCURSOR
    Variable V_REFCUR2 REFCURSOR
    variable swp_ret_value NUMBER
    exec  DELETE_POSITION(0,0,2,'U',:swp_ret_value,:V_REFCUR,:V_REFCUR2)
      print swp_ret_value
      Print v_refcur
      Print v_refcur2
    -- output
    Error starting at line 5 in command:
    exec  DELETE_POSITION(0,0,2,'U',:swp_ret_value,:V_REFCUR,:V_REFCUR2)
    Error report:
    Cursor is closed.
    SWP_RET_VALUE
    V_REFCUR
    V_REFCUR2
    ------Edited by: NeilCSE on Jan 18, 2011 4:08 AM

    it is calling another proc
    PROCEDURE Assign_outRefcur2 (CurrentCursor IN OUT SYS_REFCURSOR
                                                          , v_ref_cur IN OUT SYS_REFCURSOR
                                                          , v_ref_cur2 IN OUT SYS_REFCURSOR
    AS
       InitCursor SYS_REFCURSOR;
    BEGIN
    IF NOT v_ref_cur%IsOpen THEN v_ref_cur := CurrentCursor;
       ELSIF NOT v_ref_cur2%IsOpen THEN v_ref_cur2 := CurrentCursor;
    END IF;
    CurrentCursor:= InitCursor;
    END;

  • Reference Variable syntax??

    I have a large table that I want to filter on any field. I have the dataProvider array and the fieldname in a variable.  Can anyone point me in the right direction on how to set up a dynamic filter, all I can find are static item.arrayLabel in a filterFunction  where item is the dataProvider and arrayLabel is the "column" (item.city or item.state versus item[fieldName] where fieldname can be "data" or "label").  My ultimate goal is to eliminate [object Object] from the list if there are any NULL items in the database for that fieldname.  All help is appreciated.

    Thanks Gordon,  it seems my syntax was correct but my logic failing.  My filterFunction was (item[fieldName]!="" || item[fieldName]!=null) instead of &&  I had no confidence in the syntax. Hate it when I doubt myself
    Thanks again. This is going to be a pretty slick SQL generator for reporting once complete. Here we are selecting the WHERE criteria for the fields included in the report.  My previous question (unanswered) instead of rendering ComboBox for each row, only fields with lookup tables would have had a ComboBox and these other potentially null fields were going to render TextInputs - but never could get that working with dynamic dataProviders.  This may be a better solution, just need to make the non-lookup ComboBoxes editable.
    Thanks again.

  • Repository variable syntax

    What is the syntax for calling a rep variable in Answers?
    Using the "@{<variable_name>}" format described in the Answers documentation, I am unable to display the values of Repository Variabes (like "CURRENT_QTR") on reports.

    That looks like the right syntax:
    The syntax for calling a Presentation variable, whether in a column or a Title view, is @{VariableName}. Your results should look like this, as the variable has not been defined or populated yet:
    This tutorial might help you out as well:
    http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/saw/saw.html
    This section covers variables:
    http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/saw/saw.html#t8

  • Fixing this Scalar Variable Syntax question

    Please help me to correct this syntax for this practice question below.
    /* Create and set a Variable equal the number of Flights that were late.*/
    DECLARE @FlightsLate varchar(50)
    SET @FlightsLate = (SELECT* FROM
    Flights WHERE Ontime = 0)
    SELECT @FlightsLate

    If you want to get the total numbers that are late you need to do this
    DECLARE
    @FlightsLate varchar(50)
    SET
    @FlightsLate = (SELECT count(*) FROM
    Flights WHERE
    Ontime = 0)
    SELECT
    @FlightsLate
    Assuming that Ontime =0 means Late
    Javier Villegas |
    @javier_vill | http://sql-javier-villegas.blogspot.com/
    Please click "Propose As Answer" if a post solves your problem or "Vote As Helpful" if a post has been useful to you

  • Variable Syntax issue

    Hi Folks,
    I am trying to build a file delete function into my page. When I hard code the path values it works fine. When I try to pass in values it does not work. Here is the code:
    <c:set var="Dfolder_name" value="${sessionScope.Doc_Folder}"/>
    <c:set var="Dfile_name" value="${getRecord.rows[0].File_Name}"/>
    <%
    String DfolderName = (String)session.getValue("Dfolder_name");
    String DfileName = (String)session.getValue("Dfile_name");
    File myFile = new File("D:\\Sun\\WebServer6.1\\https-EBIZ_DEV\\webapps\\"+DfolderName+'\\'+DfileName);
    myFile.delete();
    %>I figure part of my problem is that I am blending JSTL and Scriptlet code. Anyway, the code runs error free but does not delete the file. I suspect the path is nort being built properly. When I force an error the DfolderName and DfileName variable calls do not conver over to the variable values.
    I could use a hand! Thanks!!

    You suspect those things? So do I. But if it were me, I would output that alleged file name to my page so I could see what it was.

  • Scalar Variable Syntax questions

    I am practicing Scalar  Variables in a workbook.  Can some help me answer these questions working with Variables.   The Table name is Flights.
    Create and set a Variable equal to the number of Flights that were late.
    Multiply that amount by the amount lost per late flight ($1,029) and store the amount in another variable.
    Take the total amount lost (#4) and subtract it from Total profit ($45,000) and store that number in a variable.
    Find out the Earliest FlightDate and add 10 years to it and store it in a variable.
    Find out the day of the week for the Latest FlightDate and store it in a variable.

    I'm not really sure how you would benefit from we giving the answers to your exercises. How would you learn from that?
    I will only point what I think is a misunderstanding. When they say Create and set a Variable equal to the number of Flights that were late., I think they mean a scalar variable, not a table variable.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Question with variable syntax

    Ok
    I run this;
    select name
    from shuttle_demo_category where id = 30;
    It returns this:
    name
    ITEM 10
    I am making this stored procedure:
    create or replace
    PROCEDURE loadname AS
    BEGIN
    declare
    f utl_file.file_type;
    V_dir varchar2(10);
    cursor c_item is
    select name
    from shuttle_demo_category where id = 30;
    r_item c_item%ROWTYPE;
    begin
    ----grant execute on utl_file to public; This must be done first
    ---USER_DIR is the oracle dir
    --- in this case USER_DIR is really c:\temp
    V_dir := 'USER_DIR';
    f := utl_file.fopen(V_dir, 'thing2.xml', 'w');
    utl_file.put_line(f, '<?xml version="1.0" ' ||r_item.name || 'encoding="utf-8"?>');
    utl_file.put_line(f, '<outline xmlns="http://xmlns.oracle.com/oxp/book/">');
    utl_file.put_line(f, '<!--');
    utl_file.put_line(f, 'The title-page element should point to a PDF title page inserted');
    utl_file.put_line(f, 'at the beginning of the book. (OPTIONAL)');
    utl_file.put_line(f, '<!-- So here is the title page reference, in this case it is going to use an RTF template -->');
    utl_file.put_line(f, '<title-page type="rtf">c:/temp/Tableofcontents.rtf</title-page>');
    utl_file.put_line(f, ' <!-- next follow all documents we want to combine -->');
    utl_file.put_line(f, '<item>');
    utl_file.put_line(f, ' <content-container>');
    utl_file.put_line(f, ' <content>c:\temp\mypage1.pdf</content>');
    utl_file.put_line(f, ' </content-container>');
    utl_file.put_line(f, ' </item>');
    utl_file.put_line(f, '<item>');
    utl_file.put_line(f, ' <content-container>');
    utl_file.put_line(f, ' <content>c:\temp\mypage2.pdf</content>');
    utl_file.put_line(f, ' </content-container>');
    utl_file.put_line(f, ' </item>');
    utl_file.put_line(f, '<item>');
    utl_file.put_line(f, ' <content-container>');
    utl_file.put_line(f, ' <content>c:\temp\mypage3.pdf</content>');
    utl_file.put_line(f, ' </content-container>');
    utl_file.put_line(f, '</item>');
    utl_file.put_line(f, '</outline>');
    utl_file.fclose(f);
    end;
    END loadname;
    It returns this in the file:
    <?xml version="1.0" encoding="utf-8"?>
    <outline xmlns="http://xmlns.oracle.com/oxp/book/">
    <!--
    The title-page element should point to a PDF title page inserted
    at the beginning of the book. (OPTIONAL)
    <!-- So here is the title page reference, in this case it is going to use an RTF template -->
    <title-page type="rtf">c:/temp/Tableofcontents.rtf</title-page>
    <!-- next follow all documents we want to combine -->
    <item>
    <content-container>
    <content>c:\temp\mypage1.pdf</content>
    </content-container>
    </item>
    <item>
    <content-container>
    <content>c:\temp\mypage2.pdf</content>
    </content-container>
    </item>
    <item>
    <content-container>
    <content>c:\temp\mypage3.pdf</content>
    </content-container>
    </item>
    </outline>
    It did not insert the variable.... why???
    Thanks for your help,
    Doug

    I tryed this:
    create or replace
    PROCEDURE loadname AS
    BEGIN
    declare
    f utl_file.file_type;
    V_dir varchar2(10);
    cursor c_item is
    select name
    from shuttle_demo_category where id = 30;
    r_item c_item%ROWTYPE;
    begin
    ----grant execute on utl_file to public; This must be done first
    ---USER_DIR is the oracle dir
    --- in this case USER_DIR is really c:\temp
    fetch c_item into r_item;
    V_dir := 'USER_DIR';
    f := utl_file.fopen(V_dir, 'thing2.xml', 'w');
    utl_file.put_line(f, '<?xml version="1.0" ' ||r_item.name || 'encoding="utf-8"?>');
    utl_file.put_line(f, '<outline xmlns="http://xmlns.oracle.com/oxp/book/">');
    utl_file.put_line(f, '<!--');
    utl_file.put_line(f, 'The title-page element should point to a PDF title page inserted');
    utl_file.put_line(f, 'at the beginning of the book. (OPTIONAL)');
    utl_file.put_line(f, '<!-- So here is the title page reference, in this case it is going to use an RTF template -->');
    utl_file.put_line(f, '<title-page type="rtf">c:/temp/Tableofcontents.rtf</title-page>');
    utl_file.put_line(f, ' <!-- next follow all documents we want to combine -->');
    utl_file.put_line(f, '<item>');
    utl_file.put_line(f, ' <content-container>');
    utl_file.put_line(f, ' <content>c:\temp\mypage1.pdf</content>');
    utl_file.put_line(f, ' </content-container>');
    utl_file.put_line(f, ' </item>');
    utl_file.put_line(f, '<item>');
    utl_file.put_line(f, ' <content-container>');
    utl_file.put_line(f, ' <content>c:\temp\mypage2.pdf</content>');
    utl_file.put_line(f, ' </content-container>');
    utl_file.put_line(f, ' </item>');
    utl_file.put_line(f, '<item>');
    utl_file.put_line(f, ' <content-container>');
    utl_file.put_line(f, ' <content>c:\temp\mypage3.pdf</content>');
    utl_file.put_line(f, ' </content-container>');
    utl_file.put_line(f, '</item>');
    utl_file.put_line(f, '</outline>');
    utl_file.fclose(f);
    close r_item;
    end;
    END loadname;
    but got:
    Connecting to the database caprs.
    ORA-01001: invalid cursor
    ORA-06512: at "CAPRS.LOADNAME", line 18
    ORA-06512: at line 2
    Process exited.
    Disconnecting from the database caprs.

  • SLOW report performance with bind variable

    Environment: 11.1.0.7.2, Apex 4.01.
    I've got a simplified report page where the report runs slowly compared to running the same query in sqldeveloper. The report region is based on a pl/sql function returning a query. If I use a bind variable in the query inside apex it takes 13 seconds to run, and if I hard code a string it takes only a few hundredths of a second. The query returns one row from a table which has 1.6 million rows. Statistics are up-to-date and the columns in the joins and where clause are indexed.
    I've run traces using p_trace=YES from Apex for both the bind variable and hard coded strings. They are below.
    The sqldeveloper explain plan is identical to the bind variable plan from the trace, yet the query runs in 0.0x seconds in sqldeveloper.
    What is it about bind variable syntax in Apex that is causing the bad execution plan? Apex Bug? 11g bug? Ideas?
    tkprof output from Apex trace with bind variable is below...
    select p.master_id link, p.first_name||' '||p.middle_name||' '||p.last_name||' '||p.suffix personname,
    p.gender||' '||p.date_of_birth g_dob, p.master_id||'*****'||substr(p.ssn,-4) ssn, p.status status
    from persons p
    where
       p.person_id in (select ps.person_id from person_systems ps where ps.source_key  like  LTRIM(RTRIM(:P71_SEARCH_SOURCE1)))
    order by 1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.00       0.00          0          0          0           0
    Execute      1      0.00       0.01          0          1         27           0
    Fetch        2     13.15      13.22      67694      72865          0           1
    total        4     13.15      13.23      67694      72866         27           1
    Misses in library cache during parse: 0
    Optimizer mode: ALL_ROWS
    Parsing user id: 62  (ODPS_PRIVACYVAULT)   (recursive depth: 1)
    Rows     Row Source Operation
          1  SORT ORDER BY (cr=72869 pr=67694 pw=0 time=0 us cost=29615 size=14255040 card=178188)
          1   FILTER  (cr=72869 pr=67694 pw=0 time=0 us)
          1    HASH JOIN RIGHT SEMI (cr=72865 pr=67694 pw=0 time=0 us cost=26308 size=14255040 card=178188)
          1     INDEX FAST FULL SCAN IDX$$_0A300001 (cr=18545 pr=13379 pw=0 time=0 us cost=4993 size=2937776 card=183611)(object id 68485)
    1696485     TABLE ACCESS FULL PERSONS (cr=54320 pr=54315 pw=0 time=21965 us cost=14958 size=108575040 card=1696485)
    Rows     Execution Plan
          0  SELECT STATEMENT   MODE: ALL_ROWS
          1   SORT (ORDER BY)
          1    FILTER
          1     HASH JOIN (RIGHT SEMI)
          1      INDEX   MODE: ANALYZED (FAST FULL SCAN) OF
                     'IDX$$_0A300001' (INDEX)
    1696485      TABLE ACCESS   MODE: ANALYZED (FULL) OF 'PERSONS' (TABLE)
    Elapsed times include waiting on following events:
      Event waited on                             Times   Max. Wait  Total Waited
      ----------------------------------------   Waited  ----------  ------------
      db file scattered read                       1276        0.00          0.16
      db file sequential read                       812        0.00          0.02
      direct path read                             1552        0.00          0.61
    ********************************************************************************Here's the tkprof output with a hard coded string:
    select p.master_id link, p.first_name||' '||p.middle_name||' '||p.last_name||' '||p.suffix personname,
    p.gender||' '||p.date_of_birth g_dob, p.master_id||'*****'||substr(p.ssn,-4) ssn, p.status status
    from persons p
    where
       p.person_id in (select ps.person_id from person_systems ps where ps.source_key  like  LTRIM(RTRIM('0b')))
    order by 1
    call     count       cpu    elapsed       disk      query    current        rows
    Parse        1      0.02       0.04          0          0          0           0
    Execute      1      0.00       0.00          0          0         13           0
    Fetch        2      0.00       0.00          0          8          0           1
    total        4      0.02       0.04          0          8         13           1
    Misses in library cache during parse: 1
    Optimizer mode: ALL_ROWS
    Parsing user id: 62  (ODPS_PRIVACYVAULT)   (recursive depth: 1)
    Rows     Row Source Operation
          1  SORT ORDER BY (cr=10 pr=0 pw=0 time=0 us cost=9 size=80 card=1)
          1   FILTER  (cr=10 pr=0 pw=0 time=0 us)
          1    NESTED LOOPS  (cr=8 pr=0 pw=0 time=0 us)
          1     NESTED LOOPS  (cr=7 pr=0 pw=0 time=0 us cost=8 size=80 card=1)
          1      SORT UNIQUE (cr=4 pr=0 pw=0 time=0 us cost=5 size=16 card=1)
          1       TABLE ACCESS BY INDEX ROWID PERSON_SYSTEMS (cr=4 pr=0 pw=0 time=0 us cost=5 size=16 card=1)
          1        INDEX RANGE SCAN IDX_PERSON_SYSTEMS_SOURCE_KEY (cr=3 pr=0 pw=0 time=0 us cost=3 size=0 card=1)(object id 68561)
          1      INDEX UNIQUE SCAN PK_PERSONS (cr=3 pr=0 pw=0 time=0 us cost=1 size=0 card=1)(object id 68506)
          1     TABLE ACCESS BY INDEX ROWID PERSONS (cr=1 pr=0 pw=0 time=0 us cost=2 size=64 card=1)
    Rows     Execution Plan
          0  SELECT STATEMENT   MODE: ALL_ROWS
          1   SORT (ORDER BY)
          1    FILTER
          1     NESTED LOOPS
          1      NESTED LOOPS
          1       SORT (UNIQUE)
          1        TABLE ACCESS   MODE: ANALYZED (BY INDEX ROWID) OF
                       'PERSON_SYSTEMS' (TABLE)
          1         INDEX   MODE: ANALYZED (RANGE SCAN) OF
                        'IDX_PERSON_SYSTEMS_SOURCE_KEY' (INDEX)
          1       INDEX   MODE: ANALYZED (UNIQUE SCAN) OF 'PK_PERSONS'
                      (INDEX (UNIQUE))
          1      TABLE ACCESS   MODE: ANALYZED (BY INDEX ROWID) OF
                     'PERSONS' (TABLE)

    Patrick, interesting insight. Thank you.
    The optimizer must be peeking at my bind variables with it's eyes closed. I'm the only one testing and I've never passed %anything as a bind value. :)
    Here's what I've learned since my last post:
    I don't think that sqldeveloper is actually using the explain plan it says it is. When I run explain plan in sqldeveloper (with a bind variable) it shows me the exact same plan as Apex with a bind variable. However, when I run autotrace in sqldeveloper, it takes a path that matches the hard coded values, and returns results in half a second. That autotrace run is consistent with actually running the query outside of autotrace. So, I think either sqldeveloper isn't really using bind variables, OR it is using them in some other way that Apex does not, or maybe optimizer peeking works in sqldeveloper?
    Using optimizer hints to tweak the plan helps. I've tried both /*+ FIRST_ROWS */ and /*+ index(ps pk_persons) */ and both drop the query to about a second. However, I'm loath to use hints because of the very dynamic nature of the query (and Tom Kyte doesn't like them either). The hints may end up hurting other variations on the query.
    I also tested the query by wrapping it in a select count(1) from ([long query]) and testing the performance in sqldeveloper and in Apex. The performance in that case is identical with both bind variables and hard coded variables for both Apex and SqlDeveloper. That to me was very interesting and I went so far as to set up two bind variable report regions on the same page. One region wrapped the long query with select count(1) from (...) and the other didn't. The wrapped query ran in 0.01 seconds, the unwrapped took 15ish seconds with no other optimizations. Very strange.
    To get performance up to acceptable levels I have changed my function returning query to:
    1) Set the equality operator to "=" for values without wildcards and "like" for user input with wildcards. This makes a HUGE difference IF no wildcard is used.
    2) Insert a /*+ FIRST_ROWS */ hint when users chose the column that requires the sub-query. This obviously changes the optimizer's plan and improves query speed from 15 seconds to 1.5 seconds even with wildcards.
    I will NOT be hard coding any user supplied values in the query string. As you can probably tell by the query, this is an application where sql injection would be very bad.
    Jeff, regarding your question about "like '%' || :P71_SEARCH_SOURCE1 || '%'". I've found that putting wildcards around values, particularly at the beginning will negate any indexing on the column in question and slows performance even more.
    I'm still left wondering if there isn't something in Apex that is breaking the optimizer "peeking" that Patrick describes. Perhaps something in the way it switches contexts from apex_public_user to the workspace schema?

  • How to pass the values to stored proc using presentation variable in OBIEE

    Need your help regarding in resolving an issue in OBIEE 10.1.3.4.1
    There are 6 reports say ‘A’,’B’,’C’,’D’,’E’,’F’ in the same subject area.
    The reports are being configured with prompts using either the repository/presentation variables.
    One of the reports say ‘A’ has been configured to pass the values using presentation variables from the prompt in Advanced Tab of the report request to the stored procedure defined in the Execute Before Query section of the connection pool.
    After running another report ‘B’ in the same subject area, upon visiting the report ‘A’ view display error is being seen ( Please have a look below screen shot for your reference) .
    Speculate the issue is around presentation variables of report ‘A’ getting initialized even before running the report.
    Appreciate your earliest advise as this is a prod issue.

    Hi Prasad,
    I got your note, you should not use Session variable syntax to call presentation variable.
    you should use like @{AIC_PROJ_PLAT_SEQ_NO}
    One more thing: first test the variable AIC_PROJ_PLAT_SEQ_NO value then try to pass to SP.
    Hope this helps

  • Can I put a SQL query into a bind variable and then use it to output report

    Hi,
    Can I put a SQL query into a bind variable and then use it to output report?
    I want to create a report and an item "text area" (say P1_TEXT) which can let user to input a SQL query(they are all technical users and knows SQL very well). Then, I use a bind variable (that text area) to store the SQL statement. Then, I add a submit button and I want to use the following to output the report:
    select * from (:P1_TEXT);
    Do you think it is possible to do that? Any known limitations for APEX in this area?
    Thanks a lot,
    Angela

    You can, but make sure it's what you really want to do. Make sure you are VERY familiar with SQL Injection. Most people who know what it is, go out of their way to prevent SQL Injection. You're going out of your way to allow it.
    You can try using &P1_TEXT. instead of bind variable syntax. Bind variables are one of the best ways to prevent SQL Injection, which is why it's not working for you.
    Once again, I strongly urge you to consider the implications of your app, but this suggestion should get it working.
    Tyler

  • Bind Variable

    Is the bind variable syntax supported in procedure? The following produces error:
    VARIABLE salary number
    CREATE OR REPLACE PROCEDURE bindvar
    is
    eid employees.employee_id%type;
    BEGIN
    SELECT employee_id INTO eid FROM EMPLOYEES
    WHERE employee_id > :salary and rownum=1;
    DBMS_OUTPUT.PUT_LINE(:salary);
    END;
    LINE/COL ERROR
    6/26 PLS-00049: bad bind variable 'SALARY'
    7/24 PLS-00049: bad bind variable 'SALARY'
    But if I change the procedure to an anonymous block, everything works fine!

    your variable salary declaration exists only in the current SQL*Plus session. It is not going to be existing in all the environments from where this stored procedure can be called and certainly not on the server where the code is stored in the database.
    The reference can be used in an anonymous block run from the same SQL*Plus session, since it is one time execution. Not in a stored procedure like the way you intend.
    You could have the stored procedure take a number as input and use that parameter in your sql. then at SQL*Plus prompt call the procedure passing the value in :salary variable to get the results.

  • How do I create a variable in apple script?

    I've overcome almost all of the obstacles I've had in setting up our new Apple network. The last step is seemingly simple -
    I need to create a simple mount network drive script at login for each user.
    Basically, the script calls to our AD server, and mounts the user's personal folder. This way no matter if they're on a mac or PC, they are saving to the same network space.
    So what I need to do is get the username of the currently logged in person and have that name assigned to the end of the mount drive path
    Ive found the whoami script to be useful for pulling the name of the current user.
    Now I need to apply it to the path, for example:
    if the user is Bob, his folder is at smb://server1/users/Bob
    What I need to happen in the login script, is to be able to make the last part, "Bob" be changeable based on the currently logged in user
    SO theoretically, smb://server1/users/& whoami     or at least the functionality similar to it, but I'm apparently missing something in the variable syntax.
    Any help would be appreciated. Thanks!

    Here:
    "smb://server1/users/" & (do shell script "whoami")
    (69091)

  • Problems in SQL transform with variable in statement

    Hi,
    I have an sql transform with a variable in the statement. It looks like this:
    SELECT * FROM I.X where I.X.CUSTOMERNUMBER IN ([$variable])
    I have a script running prior which sets the $variable = '\'366800\',\'000933\'';
    (the CUSTOMERNUMBER field is a string)
    The problem is when DI compiles the SQL with the variable value, it is replacing each single quote with two single quotes, and thus turning my list of values into a single string (as recognised by DB2).
    How can I work around this? The CUSTOMERNUMBER field is indexed and the table is very large, so I want to use a very efficient statement to retrieve the data. I'm inserting this data into a different database, so I can't use the sql() function to execute the query and insert the rows into a new table in the same database (don't have authority to do that).
    I also need the sql to be dynamic because the customer numbers required will change from time to time. They're listed in another database and I plan on writing a loop to set the $variable value to contain all values in the lookup table, but I can't use that in a join because its in a different database and would not be efficient.
    Does anyone have any ideas? I'm literally all out, have tried a wide range of things to no avail, and none of my colleagues can work it out either.
    Thanks very much,
    -Steve

    I assume the SQL Transform is used only because of that in-list, not for other reasons....
    In this book page here: https://boc.sdn.sap.com/node/20046 at the very bottom it isdescribed on how to use the pushdown_sql() function in a where clause to add *any* text of your choice into the select statement DI generates. In this example I used a "where exists" but you can easily change the text to
    where key=5 and       pushdown_sql('my_datastore', 'CUSTOMERNUMBER IN ([$variable])')    and gender='M'
    I used the key=5 and gender=M just to clarify the syntax (I hope).
    For the SQL Transform, I wonder if you need the [$variable] syntax as well....

Maybe you are looking for

  • Removal of credit card info from apple id?

    How can I remove my credit card from my apple id.

  • Dbms_scheduler.file_watch will only pull in files with t/s = last run...

    Hello, I may be missing something easy, but instead of spinning my wheels I'll ask. I am new to using the file_watcher in the dbms_scheduler so I followed the directions posted in this link: http://awads.net/wp/2011/03/29/did-you-know-about-file-watc

  • Enter button doesn't work in address bar.

    After inputting a site address in the address bar, either through typing or from the history/autocomplete, pressing enter does not send me to the page, and I have to manually click the go button on the right. Disabling all my plugins didn't make any

  • IPhone 5 battery drains very quickly

    I've had an iPhone 5 for about a year and a half and it all of a sudden started draining really quickly.  Without using it outside of a few texts, it is at 50% by noon.  With use, it easily completely drained by then.  Also, I have noticed a few odd

  • How to clear WinJS listview

    I am new to WinJS, and want to clear a list view. I am having trouble even selecting the list view. When attaching events I selected list view like var listView = document.getElementById("listView"); listView.addEventListener("iteminvoked", goToJob);