Refreshing a variable in a procedure

Hi!
I know such thread has been already posted many times, but I do everything as explained and it still doesn't work.
I have created variable STARTDATE: TEXT, Latest Value and a package with following steps:
1) Declare Variable STARTDATE
2) Refresh Variable STARTDATE
3) Procedure
The procedure uses the variable, but doesn't recognize it.
update Table1 set eof_timestamp_2 = eof_timestamp_1 where eof_timestamp_1 >= to_date('#ODS.STARTDATE','dd.mm.yyyy hh24:mi:ss')
Thanks for help
Marcin

In Designer I have a Global variable called vTARGET_TABLE and in my package I have it set to 'EIM_EMPLOYEE'.
I have a variable that returns the number of rows of the vTARGET_TABLE, and the code of the variable is explained below:
@ Designer mode:
<Datatype: Numeric - Action Not Persistent>
select nvl(max(count(if_row_batch_num)),0)
from <%=odiRef.getSchemaName("W")%>.#vTARGET_TABLE t
group by t.if_row_batch_num;
When I execute it, in Operator appears:
select nvl(max(count(if_row_batch_num)),0) from SNPW.#GLOBAL.vTARGET_TABLE t
group by t.if_row_batch_num;
Generating this error:
911 : 42000 : java.sql.SQLException: ORA-00911: invalid character
java.sql.SQLException: ORA-00911: invalid character
How can I solve it?
Regards.
Luiz Araujo

Similar Messages

  • How to refresh a variable in a procedure

    Can I refresh a variable in a procedure so the variable can be used in a next step in the package?
    Thanks

    Hi,
    Create a package with the variable in refresh mode, create a scenario from it and call it from procedure step.
    Does it help you?

  • Pass BPC SSIS variable to stored procedure

      Dear All
    We have a ssis package in which there is data flow task. There
    is a OLEDB source which uses “Data access mode” as sql command. We used OLEDB data source instead of execute sql task as the outuput is table format generated in Stored proc which is used in following task
    This task calls a stored procedure with a input parameter which will be appset name.   [EXEC ProcName '@BPCAPPSET']
    The stored procedure is executing fine without any issues.But when I pass variable containing appset name to that stored  procedure its not taking properly and package ending successful.
    The variable is “BPCAPPSET” it contains appset name which
    will be taken front end.
       However to test if this value is taken by stored procedure
    or not, I tried to hardcode and pass appset name to stored procedure. i.e exec
    ProcName Appset1.
      Appset1 is existing appset. It worked fine. But we want to
    put this package in all land scapes, such that whenever it is triggered it will
    take the appset as parameter and does the calculation in stored procedure.
       Please advice how to pass this variable to stored
    procedure.
    regards
    Prasad

      Hi Roberto
    Thanks for your mail.
    I have tried, but I am getting error that @BPCAPPSET scalar
    variable must be defined.
    I believe that @BPCAPPSET is system defined variable which
    will be passed from Data manager package. May be this is the reason it is not
    recognizing this variable?
    If so, should I define a variable in SSIS. How can we
    assign value of @BPCAPPSET to the newly defined variable?
    Please advise. Attached screenshot.

  • Using Bind Variable in a procedure

    Hello all,
    Aim - I wanted to set the value of a bind variable in a procedure
    I was unsuccessful in doing so, pls help me (pls let me know if u need more info).
    I have pasted the commands I executed in a SQL
    SQL> VARIABLE x NUMBER;
    SQL> EXEC :x := 5;
    PL/SQL procedure successfully completed.
    SQL> CREATE OR REPLACE PROCEDURE p1
    2 IS
    3 BEGIN
    4 :x := 5;
    5 END;
    6 /
    Warning: Procedure created with compilation errors.
    SQL> show err
    Errors for PROCEDURE P1:
    LINE/COL ERROR
    4/5 PLS-00049: bad bind variable 'X'

    The reason why the 2nd attempt failed is that in PL/SQL declared code (unlike anonymous blocks) you need to use PL/SQL (host) variables as bind variables and not SQL*Plus (host) variables.
    To explain in more detail:
    SQL> VARIABLE x NUMBER;
    SQL> EXEC :x := 5;
    The EXEC creates and transmits the following PL/SQL anonymous block to Oracle:
    begin
      :x := 5;
    end;It also bind the SQL*Plus host variable (defined as X to the bind variable :x).
    All well. But not the procedure P1 will not work. Numerous reasons - including that when I call the P1 proc from Delphi, or Joe calls it from Java, or Jack calls it from ASP - we do not have that SQL*Plus host variable X defined. That does not exist in the context when we make our PL/SQL calls to P1.
    So how can you write P1 so that we all can use it - from any language?
    You provide an input parameter for P1. This allows all of us to bind our host variables to the P1 call. E.g.
    create or replace procedure P1( x IN OUT number ) is
    begin
      x := 5;
    end;Now when you call it from SQL*Plus, you would do the following:
    SQL> var x number
    SQL> exec P1( x=>:X )
    When I call it from Delphi, I will bind my Delphi (host) variable to the procedure call. Ditto for Joe and Jack.
    Note that PL/SQL itself can also use host and bind variables when talking to the SQL engine. E.g.
    create or replace procedure P2( nRows IN OUT number ) is
    begin
      select count(*) into nRows from all_objects;
    end;In this case, nRows in the SQL statement is a SQL bind variable. It is also the PL/SQL host variable. As you can see, this is very similar to what SQL*Plus did with its host variable.
    Bind variables (within PL/SQL) is explained in more detail in the Oracle® Database PL/SQL User's Guide and Reference guide.

  • Call Data in Variable in Stored Procedure for Partition Name

    Hi,
    Here is an excerpt from a Srored Proc I have written.
    The aim here is to copy data from a partition of a table.
    I first query the partition-name from the ALL_TAB_PARTITIONS table and store the same in a VARCHAR2 variable named partition_name_low.
    I then try to select the data in this partition of the table by using the variable name.
    PROCEDURE purging AS
    partition_name_low VARCHAR2(25);
    BEGIN
    --+
    -- Query for the Highest Value of the timestamp in the 1st partition in current table.
    --+
    SELECT PARTITION_NAME
    INTO partition_name_low
    FROM ALL_TAB_PARTITIONS
    WHERE TABLE_NAME = 'TABLE1' AND PARTITION_POSITION IN
    +(+
    SELECT MIN(PARTITION_POSITION)
    FROM ALL_TAB_PARTITIONS
    WHERE TABLE_NAME = 'TABLE1'
    +);+
    COMMIT;
    COMMIT;
    DBMS_OUTPUT.PUT_LINE(partition_name_low ||' **********  ' || TO_char(sysdate, 'MM/DD/YYYY HH24:MI:SS')||' Starting Purging Data  *********');
    --+
    -- Copy data from 1st partition to Archive Table
    --+
    INSERT /* APPEND */ INTO TABLE1_ARCHIVE+
    SELECT * FROM TABLE1 PARTITION(partition_name_low);
    However, I am facing an issue here since I keep on gettin an error that "ORA-02149: Specified Partition does not exist".
    What I understand is that the Oracle query is picking up the literal string "partition_name_low", instead of the data inside it.
    I tried with
    &partition_name_low
    AND
    :partition_name_low
    with no luck.
    For the 2nd case I get the obvious exception "bad bind variable".
    Can someone please suggest in which way I can handle this situation where I can use a variable refer the partition name in a select query?
    Thanks in advance!!
    Abhishek.

    Hi,
    You have to use "execute immediate" to launch dynamic SQL command.
    So you should write
    execute immediate 'INSERT /* APPEND */ INTO TABLE1_ARCHIVE+
    SELECT * FROM TABLE1 PARTITION('||partition_name_low||')' ;
    Mike

  • 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 Refresh a Variable screen in Webtemplet

    Hi Experts,
    When i execute a WEB Templet giving Variable Selection Inputs , the Variable input values gets stored in the Variable Tab and will not change untill i Change it.
    Example
    Variable input 0PLANT 5030(this 5030 is the input where i give in the variable selection screen)
    when i click back on the intrenet Explorer , this 5030 will be there stored in the 0PLANT tab.
    can any one give me solution how can i refresh the variable screen in the WAD
    Santosh Nagaraj

    This should solve your problem :
    Variable Refresh button in WAD

  • How can i Refresh my Variable Screen In WAD templet?

    Hi Experts,
    When i execute a WEB Templet giving Variable Selection Inputs , the Variable input values gets stored in the Variable Tab and will not change untill i Change it.
    Example
    Variable input 0PLANT     5030(this 5030 is the input where i give in the variable selection screen)
    when i  click back on the intrenet Explorer , this 5030 will be there stored in the 0PLANT tab.
    can any one give me solution how can i refresh the variable screen in the WAD
    Santosh Nagaraj

    Tis might be a browser feature - the variable values tend to get stored - you could look at implementing DSM ( through portal ) or try making your template stateless and see if the value changes...

  • How to refresh ODI variables from file

    Hi,
    I followed the fillowing links to implement the dynamic file parameter passing in to the resource name of a datastore.
    part-1. http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value
    part-2. http://odiexperts.com/how-to-refresh-odi-variables-from-file-%e2%80%93-part-2-%e2%80%93-getting-all-lines-once-at-time
    For me first part is working fine where as in second part i made canvas looks like
    Vlinevariable(refreshing variable)------------------dyanamicfile(refereshing variable)--------------------- interface.
    Interface looks like Flatfile to db ,km's are lkm file------sql and ikm is sql incremental update
    Vlinevariable is working fine where i am getting numbers in sequence manner to assign in to code of dynamicfile variable and in dynamicfile is not taking that value in to that code and causing session failed.
    The code which i put in a refreshing code of dynamicfile is followed below
    select     samplefile1_csv     C1_SAMPLEFILE1_CSV
    from      TABLE
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=code_generationSNP$CRLOAD_FILE=C:\file/my_test_file.txtSNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=samplefile1_csvSNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=50SNP$CRACTION_ON_ERROR=0SNP$CR$$SNPS_END_KEY*/
    For the firstrow the number has to get from vlinevariable where in my case not working .
    In session while loading the interface (load data) i am getting error like
    message-------------- ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection file_tgt.
    Caused By: java.sql.SQLException: File not found: C:\file/
         at com.sunopsis.jdbc.driver.file.FileResultSet.<init>(FileResultSet.java:160)
         at com.sunopsis.jdbc.driver.file.impl.commands.CommandSelect.execute(CommandSelect.java:57)
         at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
         at com.sunopsis.jdbc.driver.file.FilePreparedStatement.executeQuery(FilePreparedStatement.java:131)
         at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java:602)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeQuery(SnpSessTaskSql.java:3078)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java:571)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2815)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
         at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
         at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
         at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
         at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
         at java.lang.Thread.run(Thread.java:619)
    source code is select     a     C1_A,
         b     C2_B
    from      TABLE
    /*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=sample1SNP$CRLOAD_FILE=C:\file/#PROJECT1.FILENAMESNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x002cSNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=aSNP$CRTYPE_NAME=NUMERICSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=12SNP$CRACTION_ON_ERROR=0SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=bSNP$CRTYPE_NAME=NUMERICSNP$CRORDER=2SNP$CRLENGTH=50SNP$CRPRECISION=12SNP$CRACTION_ON_ERROR=0SNP$CR$$SNPS_END_KEY*/
    target code insert into STAGING.C$_0SAMPLE1
         C1_A,
         C2_B
    values
         :C1_A,
         :C2_B
    KIndly help me and thanks in advance.

    ODI is complaning it cannot locate the file. Try replacing the '/' character with a '\' after file in the designated filepath.

  • BIND VARIABLES IN STORED PROCEDURES

    I find out that the cause of the decreasing of the Shared_pool in my database is for the sql area.
    1* SELECT * FROM V$SGASTAT where name like 'sql%'
    SQL> /
    POOL NAME BYTES
    shared pool sql area 7671024
    SQL> R
    1* SELECT * FROM V$SGASTAT where name like 'sql%'
    POOL NAME BYTES
    shared pool sql area 8147424
    SQL> R
    1* SELECT * FROM V$SGASTAT where name like 'sql%'
    POOL NAME BYTES
    shared pool sql area 8262016
    I flush the shared pool and it increases fastly.
    According to my research I have to use bind variables in SQL Statement to avoid this and apart from that modify the init parameter CURSOR_SHARING.
    Somebody can help me with a simple example about how to use bind variables in Stored Procedures.
    thanks

    According to my research I have to use bind variables in SQL Statement to avoid this and apart from that modify the init parameter CURSOR_SHARING.I would not want to change the CURSOR_SHARING. As for use of bind variables in PL/SQL stored procedures, they come in naturally if you use pl/sql variables in your queries:
        l_empno EMP.EMPNO%TYPE ;
        SELECT <columns> INTO <local storage>
        FROM emp
        WHERE
            empno = l_empno ; /* pl/sql automatically binds for you here */
    .Please post a small sample of type of queries that you are submitting to the database from within these pl/sql blocks for us to see if there is a possibility of improvements.

  • Refresh input variables in Webtemplate

    Dear All,
    I have a command button in my webtemplate. when i click on this button it should give me variable selection screen to enter Country code in my input variable. My planning function will be executed for this country. But next time when i click this button its not asking me the variable selection screen.its taking the previous entered value. So i have to run the Webtemplate again to run the planning function for a different input variable.
    Please tell me how to refresh the variable values so that i can get the Popup screen everytime i click the command button.
    Thanks in advance.

    Hi,
    I have created one web template with one button group , and selected query having variable and exception as data provider.
    For button group i have selected "OPEN_VARIABLE_DIALOG" (which is under All commands->command for webtemplate)as a command type. It is working fine.
    Try this.
    if it is useful assign points.
    Regards,
    Senthil Kumar.P

  • Want to refresh my variables value

    Hi,
    I have created a planning layout. whenever I execute this it will shows same values for variables. Actually I want this should looks as a blank and user will put some value. But whenever I execute this planning layout the variable shows some existing values.
    I have try to clear this variable but didn't found the option in Planning area, Level, Layout etc.
    Could you please suggest me how can I refresh my variables.
    I'll assigned you the full marks.
    Regards
    Manoj

    Hi Mayank,
    Thanx for your reply and I had given you the points.
    Also like to know We don't have any other option to refresh planning variable other than exit..?
    If exit then I have to write a Function module and this function module attach to which function group...? If you could give me this details I'll be very thankful to you.
    Regards
    Manoj

  • Refresh a variable from several schemas

    Is it possible to refresh a variable with data from multiple schemas?
    If not, what are the workarounds? The only one I see (apart from dblinking) is to use two variables, refreshing one before refreshing the other.

    hmm..I can think of making the schema as dynamic that is put a variable in place of the schema name in your data server. Same thing for physical schema and take a specific logical schema for this. Now in your package refresh the same variable which will hold the schema name. So in run time this value will be substituted there.
    Test it and let me know.
    Bhabani

  • ODI - refresh a variable from a file field

    Hi,
    Is it possible to refresh directly a ODI variable from value stored in a file ? I find a workaround by loading the file into a temp table, and then make a variable refresh, but this solution is not good for me.
    Any other idea ?
    Thanks,
    JP

    http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value
    gives you the step for refreshing variable from file

  • How to assign a value to ODI Variable using ODI Procedure

    Hi ,
    Is it possible to assign a value to a ODI Variable using ODI Procedure ?
    If it is possible how we can do that.
    BEGIN
    IF #Counter=1
    Then
    #Next_Increment:=#Counter+1;
    End if;
    END;
    In my example I have 2 ODI Variables #counter and #Next_increment.
    I am trying to assign VALUE TO A ODI VARIABLE #next_increment from another ODI Variable #counter.
    thanks
    prasanna

    Prasanna,
    I have a similar requirement where I need to assign values to ODI variables within a procedure. How do we make use of an ODI package to accomplish this ?
    Actually, I have a sequence of ODI steps, and there is a call to a procedure 'LOG ERROR' from every step which gets called in case error occurs in any step. I just need to identify from which step the error came.
    Please help.

Maybe you are looking for

  • Photosmart 7515 connect via USB but not wireless, Device not found on Network

    Purchased a 7515 all-in-one, was able to setup wirelessly to MacPro but has lost ability to connect wirelessly.  This happened with OS X Lion and nor MountainLion.  Have a TimeMachine Airport.  Printer connects to network but during setup from MacPro

  • Need to print messages history, 1 contact, iPhone 5s

    Hello, I need to print the conversation history for One Contact at a time from an iPhone 5s.  iPhone is backed up to iCloud not a computer.  The Messages account is not used on a Mac.  I put it on a Mac but it brought up no history, only new messages

  • Does Apple Read These Posts

    Transitioning from G4 Panther to G5 Tiger with many issues. Icons, preferences lost. NON-Apple Programs crash. Printer problems. Who needs this? Is anyone important listening to these complaints. I am an original Apple owner from AppleIIE and finally

  • Forms engine

    Hi All, I have to provide to end user of my application possibility to create his/her own forms with validations (errors, warnings) and calculations without a need to rebuild/redeploy/restart the whole application. Key requirement is that it has to h

  • Need help with merging rows

    Howdy all, Given the following data set... ID   GROUP_ID   AWESOME   MOD_DATE    LAST_NAME        FIRST_NAME 52   98              1              2/1/2011       Kirk                    James 60   99              1              2/2/2011       Kirk