updating of a variable in a procedure

Hello!

I know this thread has already posted several times, but I am doing everything as it is explained and it still does not work.

I created the variable STARTDATE: TEXT, the most recent value and a package with following steps:

(1) declare the Variable STARTDATE
(2) update the Variable STARTDATE
(3) procedure

The procedure uses the variable, but does not 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

It should work... seems that ODI is not translating the variable.

Let me suggest something to debug this variable...

Creat a step before update like:

Technology: Java BeanShel
Check ignore error checkbox

Command:

throw new Exception ("' \n\n is the value of the variable: #STARTDATE \n\n '")

This command should show if ODI can recognize the variable inside the procedure.

Run and tell me what you have to tab performance (operator)

Cezar Santos
[www.odiexperts.com]

Tags: Business Intelligence

Similar Questions

  • How to capture the result of the INSERTION/update in a variable?

    Hi friends, look at this:

    SQL > UPDATE MyTable SET MyColumn = 100;
    -1000 lines to update

    How do I capture the message "1000 rows updated" in a variable in a stored procedure?

    Concerning

    after update stmt writing below stmt in the procedure;

    dbms_output.put_line (' lines = ' |) TO_CHAR(SQL%ROWCOUNT));)

    Published by: J2EE_Life on April 26, 2012 08:40

  • How to swap two values without using the third variable using the procedure

    How to exchange the two values without using the third variable using the procedure?

    In a procedure using two mode we pass two values A = x and B = y, and let us pass parameters to receive the output has A = y and B = x without using the third variable

    Published by: Millar on August 19, 2012 11:23

    Your question doesn't seem wise. As written, there is no reason to a third variable, just

    CREATE OR REPLACE PROCEDURE(
      x IN number,
      y IN number,
      a OUT number,
      b OUT number
    )
    AS
    BEGIN
      a := y;
      b := x;
    END;
    

    If it's an interview question, I suspect that the intention was that you had two settings IN OUT and you wanted to swap the values without the help of a third variable.

    Justin

  • update the session variable url GO

    Hello

    I'm trying to update the session variable by using url GO. but it is not updated, it is still using the set default value, I followed
    http://oraclebizint.WordPress.com/2008/02/28/Oracle-BI-EE-101332-updating-session-variables-through-go-URL/ but noway
    any suggestion?

    Thank you

    It will work, make sure that you follow every thing in the Blog. some control points

    1. make sure that your boot block checked the property called "required for authentication.
    2. after the update of instanceconfig.xml restart your services and oc4j.
    3. use the same names for the variables mentioned blog.

    If this does not resolve your problem, see more details.

    -Madan

  • Update does not work in the procedure

    Hello

    I have a simple procedure that contains an update statement... I use a variable to update a column in a table...

    For some reason, the content of the field is not being updated!

    [code]

    CREATE OR REPLACE PROCEDURE Test_Update IS

    BEGIN

    DECLARE

    vessel_sub_type_txt varchar2 (150);

    BEGIN

    vessel_sub_type_txt: = 'Charter Tours, sport fishing;

    UPDATE VESSEL_TMP V

    SET V.VESSEL_SUB_TYPE_TXT = vessel_sub_type_txt,

    V.DATE_MOD_BY_DTE = SYSDATE,

    V.A01_USER_MOD_BY_ID = "lafontm".

    WHERE V.VESSEL_ID = 29933;

    COMMIT;

    END;

    END Test_Update;

    [/ code]

    No clue as to why it doesn't work?

    Thank you

    Marc L

    DOH, there you go.

    Change the name of your variable. Oracle is the thought that vessel_sub_type_txt is the name of the column, so it's just update to himself.

    Use a different variable name.

    J

  • Update frequently global variable

    Hello

    I did this counter, which counts the value of x to the value y.

    This value, I need in an another VI, so I made this VI a Subvi.

    The value of the counter is necessary in another loop to be reckoned with.

    But the meter does not update its me every time, in this main VI.

    How can I make the value updated frequently in this main loop VI without using some time.

    If I put the global variable in a while loop it will update, but the while loop will run constantly.

    and the for loop will not run until the while loop is stopped.

    Here's how I would do it with the help of an adverse event (motor action)

  • Update of the variables of the container

    Hello

    in 4.1.0 TestStand I noticed that, when I change a container type by adding new elements that the variables of this type automatically receive new items, but without their default values (I use it as a replacement for constant values that TestStand does not). Instead, the new elements are set to 0 (they are all numbers).

    Following questions:

    • Are variables inside the sequence of files automatically updated when loading the sequence file? or only the sequence currently in memory files when the type is changed?
    • Is that the behavior of use 0 as a default value instead of the default value in the definition of type of design or a bug?

    and a request: I think it would be good to have constants to TestStand, that is, definitions of the same type in a TypePalette-INI-file, which can be used without an instance of a variable.

    Concerning

    Peter

    Hello

    I spoke to a colleague and I think his Merry is very good (see the attachment).

    Concerning

    Rüdiger

  • update of local variables

    I want to acess the value of a variable outside a befor even loop the loop is completed, so I am trying to create a local variable and use it to transfer data outside the loop to do simultaneous online processing.

    However, I am only able to update a flag outside of the loop with the variable name put to day... but if I pull a wire from there to do a treatment of value in the thread is not updated...

    I tried both versions and update the same... only one digital indicator is updated... numeric2 isn't always updated... Why?

    How can it be resolved?

    During the iteration of the inner loop of the outer loop will not update. See an example of a quick fix LV 8.6.1. Try not to use local variables unless absoulutely necessary.

  • Update zone drop-down list programmatically does not update its local variable

    Hi all

    I followed a Web site tutorial OR and programmatically change the items in a drop-down list box. It worked successfully, but not for local variables. Local variables while keeping the elements that had it before.

    Any suggestions?

    Thank you!

    You must update programmatically property value to change which returns the local variable, the value that you will wire does not match with one of the array strings.

    Maybe you need to do something like this to update your value to change the 'Two' to 'five '.

  • FOR loop does not update the local Variable

    I am newer to labview, and I can't wrap the head around why not a habit of local variable to update in the code if it updates on the dashboard. Anything im missing?

    Assume that you are talking about the local variable of the 'State of the cell. The terminal updates every 500ms in the small top loop, the local variable indicates simply that the indicator and thus updates also.

    The problem is "dataflow" and you need to familiarize yourself with the concept!

    Once the while loop starts, the local variable is reading and inside the loop begins. Most likely, the local variable is read before it is updated in the small loop, so most likely returns the value of a fade on the first iteration of the while loop. Now the small loop continues to go twice per second for about five seconds. Only after the loop FOR (and everything else inside the while loop) completed, the while loop will go to the next iteration, date on which the local variable is read once more, this time with the last value of the last for loop iteration of the previous iteration of the while loop.

    In summary, the local variable updates very well, it's just that the code does not read the new value around most of the time.

    Your VI is full also potential competition conditions caused by the over-use of the local variable. You need to respect the proper execution order by eliminating local variables.

    So what is the solution? Hard to say without knowing what the VI is supposed to do. Most likely, you will need to remove the inside OF the loop and use it outside while loop for everything.

  • Get multiple values in a select statement in a variable to a procedure

    Hello

    I'm trying to craete a procedure where the entry of the procedure will be a similar string "a, b, c, d" and output the values of a table that matches the value separated by commas of in sting.

    For this.

    create table test (varchar2 (10)) nm;

    Insert test values ('a');

    Insert test values ('b');

    Insert test values ('c');

    Insert test values (');

    Select * from test;

    NM

    ------

    one

    b

    c

    d

    Now I'm doing a procedure where the parameter will be the column values NM of TEST table in a string separated by commas like "a, b, c, d, x, l" there could be false values also.

    The procedure will return only the values that are adapted with column NM from the TEST table for this I created this procedure.

    create or replace procedure p_test (p_nm IN varchar2 / *, THE sys_refcursor p_out * /)

    is

    number of l_len;

    l_val varchar2 (10);

    l_val1 varchar2 (10);

    Start

    l_len: = length (p_nm);

    -dbms_output.put_line (l_len);

    Start

    because me in 1.l_len

    loop

    Select REGEXP_SUBSTR (p_nm, ' ([^,] *)(,|$)', 1, I, NULL, 1) in double l_val;

    -dbms_output.put_line (l_val);

    -Open p_out for

    Select * into l_val1 of test where nm = l_val;

    dbms_output.put_line (l_val1);

    output when l_len is null;

    end loop;

    exception

    When no_data_found then

    null;

    end;

    exception

    while others then

    dbms_output.put_line (' error reason :'||) SQLERRM |' :'|| error code SQLCODE);

    end;

    EXECUTE p_test ('a, b, c, d, q, w');

    OUTPUT-

    one

    b

    c

    d

    This procedure gives me out as I need, but I need to get this in a variable which should be OUT the parameter of this procedure will be called by the JAVA for our application.

    As I already tried to use the refcursor (see the commented part), but it gives me no output during a call there.

    Its a call to this procedure when I use the refcursor (removing comments).

    declare

    l_out sys_refcursor;

    l_val varchar2 (20);

    l_str varchar2 (20): = 'a, b, c, d;

    Start

    p_test (l_str, l_out);

    loop

    extract the l_out in l_val;

    dbms_output.put_line (l_val);

    dbms_output.put_line ('a');

    When the output l_out % notfound;

    end loop;

    end;

    So here I am stuck with that, how to get the result of multiple or I'm missing something here and if there is a better approach to this requirement as I come with that so I'm sharing it here.

    OR if someone can tell me what is the problem with this package-

    create or replace package p_test_api

    is

    type t_rec is rendered (name varchar2 (200));

    type t_tab is table of index by pls_integer t_rec;

    procedure p_pest_proc (p_nm in varchar2, p_out to t_tab);

    end p_test_api;

    /

    create or replace package body p_test_api

    is

    procedure p_pest_proc (p_nm in varchar2, p_out to t_tab)

    is

    number of l_len;

    l_val varchar2 (10);

    l_val1 varchar2 (10);

    Start

    l_len: = length (p_nm);

    Start

    because me in 1.l_len

    loop

    Select REGEXP_SUBSTR (p_nm, ' ([^,] *)(,|$)', 1, I, NULL, 1) in double l_val;

    dbms_output.put_line (l_val);

    Select * bulk collect into p_out test where nm = l_val;

    output when l_len is null;

    end loop;

    exception

    When no_data_found then

    null;

    end;

    exception

    while others then

    dbms_output.put_line (' error reason :'||) SQLERRM |' :'|| error code SQLCODE);

    end p_pest_proc;

    end p_test_api;

    CALL THIS PACKAGE-

    declare

    l_out p_test_api.t_tab;

    l_str varchar2 (20): = 'a, b, c, d;

    Start

    P_TEST_API. P_PEST_PROC (l_str, l_out);

    dbms_output.put_line ('b');

    because me in 1.l_out.count

    loop

    dbms_output.put_line ('a');

    dbms_output.put_line (l_out (i). (Name)

    dbms_output.put_line ('a');

    When the output l_out.count = 0;

    end loop;

    dbms_output.put_line ('a');

    end;

    It won't loop

    I am using-

    Oracle Database 11 g Enterprise Edition Release 11.2.0.1.0 - 64 bit Production

    Thank you

    First of all, get rid of it WHEN OTHERS like William already noted. If you do not want to use the collections:

    SQL > create or replace
    function f_test () 2
    3 p_nm varchar2
    4                  )
    5 return varchar2
    6 is
    v_result 7 varchar2 (4000);
    Start 8
    9. Select listagg (nm, ',') within the Group (nm control)
    10 in v_result
    11 test
    where the 12 «,» | p_nm | ',' like '%', | NM | ',%';
    13 return v_result;
    14 end;
    15.

    The function is created.

    SQL > start
    2 dbms_output.put_line (f_test ('a, b, c, d, x, w'));
    3 end;
    4.
    a, b, c and d

    PL/SQL procedure successfully completed.

    SQL >

    SY.

  • Using a dynamically allocated variable in a procedure?

    Hello everyone...

    I had a little problem in writing a query...

    In fact, I needed to create a tablespace by using a procedure

    My procedure is:

    create or replace procedure datafile_test as

    df_location varchar2 (600);

    Start

    Select distinct substr (file_name, 1, instr(file_name,'/',-1)) in df_location of dba_data_files;

    dbms_output.put_line (' location of the data file created is ' | df_location);

    end;

    /

    This procedure works fine but now my requirement is to use the value stored in the variable df_location in

    create the my_tbs < df_location > tbs.dbf tablespace size 20 m;  I need to write this statement in my Interior... How can I bring df_location value in my query

    is it possible to do?

    Thanks in advance...

    Hello Raymond vinay

    OK, your initial statement was not right and I haven't checked

    Try this one, it should work:

    create or replace procedure datafile_test

    as

    df_location varchar2 (600);

    v_statement VARCHAR2 (4000);

    Start

    Select distinct substr (file_name, 1, instr(file_name,'/',-1)) in df_location of dba_data_files;

    v_statement: = 'CREATE TABLESPACE MY_TBS DATAFILE ' | CHR (39) | df_location | ' / tbs.dbf'. CHR (39) | 'SIZE 20 M'

    -This is optional, but I use this:

    || "PERMANENT AUTOEXTEND OFF LOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO FLASHBACK 8K BLOCKSIZE AUTOALLOCATE ONLINE ON.

    ;


    V_statement EXECUTE IMMEDIATE ;

    dbms_output.put_line ('Tablespace is created: "' |") v_statement | '"'));

    end;

    /

    I hope this helps you!

  • How do I update the second variable in the package

    Hi all

    I created variables Var1, Var2 with different query refreshing, now I'm using these variables in the package to give inputs to the procedure, drag variables in the package and also declaring variables and once drag aging two variables defined as refresh variables and related to the procedure, has developed a scenario run the package my package was running successfully but second variable Var2 was not only refreshing the first variable will be refreshing, how should I refresh second variable also? Any suggestions are appreciated,

    Hmm, I'll give you solid evidence

    http://dwteam.in/WP-content/uploads/2013/01/OTN1.jpg

    Thank you

  • Immediate execution, to update and bind Variables

    I can't EXECUTE IMMEDIATE to work with an update statement when trying to link the name of the table. Consider the following example:
    create table gr_test(
      n Number);
      
    insert into gr_test (n) values(1);
    The anonymous block under works:
    declare
      update_statement Varchar2(2000);
    begin
      update_statement := '
      update gr_test
         set n = 2';
    
      execute immediate update_statement;
    end;
    but not
    declare
      update_statement Varchar2(2000);
    begin
      update_statement := '
      update :table_name
         set n = 2';
         
      execute immediate update_statement
        using 'gr_test';
    end;
    It gives ORA-00903 - invalid table name.

    You can not link the names of tables/columns using the clause Bind Variables (USING).

    You need to add to the dynamic SQL.

    Something this way:

     declare
       update_statement Varchar2(2000);
       v_table_name        varchar2(30);
     begin
       v_table_name = 'GR_TEST';
       update_statement := '
       update ' || v_table_name || '
          set n = 2';
    
       execute immediate update_statement;
     end;
     
    

    For more information about the Execute Immediate, please read execute immediate statement.
    For Dynamics, reading SQL statements dynamic SQL Oracle 11 g.

  • Updated APEX collection error ORA-04044: procedure, function, package, type

    Hi all

    I am trying to update the APEX MEMBER of the COLLECTION and encounter errors:


    1 error has occurred
    ORA-06550: line 9, column 8: PL/SQL: ORA-04044: procedure, function, package or type is not allowed here ORA-06550: line 7, column 3: PL/SQL: statement ignored

    The PLSQL code are as below

    DECLARE
    entire x;
    v_date_started VARCHAR2 (255);
    v_date_finished VARCHAR2 (255);
    BEGIN
    SELECT c.seq_id
    X
    OF APEX_COLLECTION c
    WHERE collection_name = "PHASE_COLLECTION."
    AND c001 =: P41_MPM_ID
    and rownum = 1;
    v_date_started: =: P41_DATE_STARTED;
    v_date_finished: =: P41_DATE_FINISHED;

    APEX_COLLECTION. () UPDATE_MEMBER
    p_collection_name = > 'PHASE_COLLECTION '.
    , p_seq = > x
    , p_c004 = > v_date_started
    , P_c005 = > v_date_finished
    );
    END;


    The process will take place after SUBMIT and validation.

    The code I used to add a colletion APEX will work perfectly and is as below

    -Initialization Collection PHASE_COLLECTION
    BEGIN
    IF THIS ISN'T APEX_COLLECTION. COLLECTION_EXISTS('PHASE_COLLECTION') THEN
    APEX_COLLECTION. CREATE_COLLECTION ('PHASE_COLLECTION');
    ON THE OTHER
    APEX_COLLECTION. TRUNCATE_COLLECTION ('PHASE_COLLECTION');
    END IF;
    -Add members to the COLLECTION PHASE of table PHASE_MEMBERSHIP
    IF: P41_MPM_ENG_ID IS NOT NULL THEN
    FOR x IN (SELECT mpm_id, mpm_eng_id, phase_number, date_started, date_finished, date_created
    OF phase_membership
    WHERE mpm_eng_id =: P41_MPM_ENG_ID
    AND active = 1
    ORDER BY date_created)
    LOOP
    APEX_COLLECTION. ADD_MEMBER
    (p_collection_name = > 'PHASE_COLLECTION')
    , p_c001 = > x.MPM_ID
    , p_c002 = > x.MPM_ENG_ID
    , p_c003 = > x.PHASE_NUMBER
    , p_c004 = > x.DATE_STARTED
    , p_c005 = > x.DATE_FINISHED
    , p_c006 = > x.DATE_CREATED

    );
    END LOOP;
    END IF;
    EXCEPTION
    WHILE OTHERS THEN
    Logger.Error (p_message_text = > SQLERRM)
    , p_message_code = > SQLCODE
    , p_stack_trace = > dbms_utility.format_error_backtrace
    );
    LIFT;
    END;


    What I tried to use APEX_COLLETION to check the overlap between the date_range.
    The requirement is just to display a warning if the user adds a record to the new phase or update record of current phase may overlap between the order of phase together.
    Table PHASE_MEMBERSHIP script is

    CREATE TABLE 'PHASE_MEMBERSHIP '.
    (
    ACTIVATE THE "MPM_ID" NUMBER NOT NULL,
    ACTIVATE THE "MPM_ENG_ID" NUMBER NOT NULL,
    ACTIVATE THE "PHASE_NUMBER" NUMBER (2.0) NOT NULL,
    "DATE_STARTED" DATE NOT NULL ACTIVATE.
    DATE OF THE "DATE_FINISHED."
    'NOTES' VARCHAR2 (2000 BYTE),
    'DATE_CREATED' DATE NOT NULL ACTIVATE.
    ACTIVATE THE 'CREATED_BY' VARCHAR2 (20 BYTE) NOT NULL,
    NUMBER (2.0) 'ACTIVE' DEFAULT 1 ACTIVATE NOT NULL)

    So, basically, I want to fill the documents associated with a particular to a collection of APEX called PHASE_COLLECTION MPM_ENG_ID.
    Then when the user specify date_started and date_finished, it will update/insert the APEX collection first.
    Then the rank based on audit collection date
    http://www.Oracle-base.com/articles/Misc/overlapping-date-ranges.php
    then display the warning to ask the user to confirm message.

    But then I'm stuck at the step of updating COLLECTION of APEX.

    If anyone has any ideas on what is wrong, please help.

    Thanks in advance.

    Ann

    Your syntx error line number should give you the trick - it is not a member of the update, rather the SQL - you are referring to apex_collection, not apex_collections view dictionary.

    Scott

Maybe you are looking for