How to insert variable value using select statement - Oracle function

Hi,
I have a function which inserts record on basis of some condition
INSERT INTO Case
Case_ID,
Case_Status,
Closure_Code,
Closure_Date
SELECT newCaseID,
caseStatus,
Closure_Code,
Closure_Date,
FROM Case
WHERE Case_ID = caseID
Now i want new casestatus value in place of select statement caseStatus value. I have a variable m_caseStatus and i want to use the value of this variable in above select statement.
how can i use this.
thanks

Hi,
I have a function which inserts record on basis of some condition
INSERT INTO Case
Case_ID,
Case_Status,
Closure_Code,
Closure_Date
SELECT newCaseID,
caseStatus,
Closure_Code,
Closure_Date,
FROM Case
WHERE Case_ID = caseID
Now i want new casestatus value in place of select statement caseStatus value. I have a variable m_caseStatus and i want to use the value of this variable in above select statement.
how can i use this. Do not select Case_Status from inner select, so null will be inserted then after inserting it update the case status with m_caseStatus.
Regards.

Similar Messages

  • How to insert date value through xml in oracle

    hi,  I am inserting data using xml string. Everything is working perfect but it shows error when i try to insert data into a table with date coloumn. it shows unparsable date error.... I am using this format of date 1-jan-2011
    my prcedure and java method is as follows...
    CREATE OR REPLACE procedure app_data.Insert_callrepHeader(xmlDoc in CLOB,t_id out varchar2,flag out varchar2) is
    insCtx DBMS_XMLSave.ctxType;
    rows number;
    t_tablename VARCHAR2(300);
    t_seqval varchar2(100);
    begin
    t_tablename:='T_CALLREPORT_HDR';
    insCtx := DBMS_XMLSave.newContext(t_tablename);
    rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc);
    dbms_output.put_line(to_char(rows) || ' rows inserted');
    DBMS_XMLSave.closeContext(insCtx);
    select SEQ_T_CALLREPORT_HDR.currval into t_seqval from dual;
    dbms_output.put_line(to_char(t_seqval) || ' is the current sequence number');
    end;
    public void insertAll(String[][] dbTblFieldValues) throws Exception
    Connection conn=null;
    conn=getOracleConnection();
    try
    String str="<ROWSET>"+
    "<ROW>"+
    "<PROCESSNAME>sheet</PROCESSNAME>"+
    "<FK_EMPID>1</FK_EMPID>"+
    "<FK_JRNY_PLAN_HDR_ID>278</FK_JRNY_PLAN_HDR_ID>"+
    "<FK_DIVISIONID>3</FK_DIVISIONID>"+
    "<STARTDATE>7-may-2011</STARTDATE>"+ what should be the format of this date????_+
    "<COMMENTSFORWEEK>comment</COMMENTSFORWEEK>"+
    "<SAPCODE>mysapcode300</SAPCODE>"+
    "<WEEKNO>1</WEEKNO>"+
    "<TOTALEXPENSE>800</TOTALEXPENSE>"+
    "<VENDORINVOICETYPE>mytype</VENDORINVOICETYPE>"+
    "<REPORTNO>1</REPORTNO>"+
    "<SUBPROCESSID>800</SUBPROCESSID>"+
    "</ROW>"+
    "</ROWSET>";
    StringBuffer sb = new StringBuffer(400000);
    sb.append(str);
    String clobValue = sb.toString();
    PreparedStatement preparedStatement=conn.prepareStatement("{call INSERT_CALLREPHEADER (?,?,?)}");
    preparedStatement.setString(1, clobValue);
    preparedStatement.setString(2,null );
    preparedStatement.setString(3,null );
    preparedStatement.execute();
    preparedStatement.close();
    conn.close();
    catch (Exception e) {
    // System.out.println(e.getMessage());
    e.printStackTrace();
    }

    I have got the answer...
    use DBMS_XMLSave.setdateformat(insCtx, 'dd-MM-yyyy'); and u can change ur date format....

  • How to get accurate values for select statement using single column

    Hi All,
    Below is my query which runs fine
    Select Distinct Top 4
    FiscalYearId,
    FiscalMonthOfYearId
    From ODS.Common.tODS_Date
    Inner Join
    UTL.Utility.tUTL_ProcessDate
    On tODS_Date.DateShort < tUTL_ProcessDate.ProcessDate
    And tUTL_ProcessDate.DatabaseName = 'ODS'
    Order By
    FiscalYearId Desc,
    FiscalMonthOfYearId Desc
    Below is the generate output
    FiscalYearId FiscalMonthOfYearId
    2014 2
    2014 1
    2013 12
    2013 11
    But i want to use this query in one of my where clause condition as its being used in the where clause it can only return 1 row.So, i tried something like this
    Select Distinct Top 4
    FiscalMonthOfYearId
    From ODS.Common.tODS_Date
    Inner Join
    UTL.Utility.tUTL_ProcessDate
    On tODS_Date.DateShort < tUTL_ProcessDate.ProcessDate
    And tUTL_ProcessDate.DatabaseName = 'ODS'
    Order By
    FiscalMonthOfYearId Desc
    And the result set of this one gives me the output like
    FiscalMonthOfYearId
    12
    11
    10
    9
    Which is not correct,( if you see the result set above). 
    Can someone please help me with any ides on this.

    If you want to use this query in the WHERE clause, then use it with EXISTS option which allows to return more than 1 column. 
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • How to retrieve DB values using select-options

    Hi all,
            I have problem to run this code for getting select option values in runtime.  Is there any function, methods or structure to know this?  I didnot get DB values when I click select-option button.
            I would like to display DB field values when i click select-option pushbutton.  select-option values while programs working in runtime.
    Example Code:
    REPORT  ZBAPUSHBUTTON.
    data: lryrctno type ZLRYRCT-ZEBELN,
          LDRIVER_FN type ZLRYRCT-DRIVER_FN,
          LZDELDT TYPE ZLRYRCT-ZDELDT,
          LZLRYNO TYPE ZLRYRCT-ZLRYNO,
          LZDRIVERID type zlryrct-ZDRIVERID.
    DATA: LRYRCT TYPE ZLRYRCT.
    SELECTION-SCREEN PUSHBUTTON 10(10) LB1 USER-COMMAND PB1.
    SELECTION-SCREEN PUSHBUTTON 25(10) LB2 USER-COMMAND PB2.
    SELECTION-SCREEN BEGIN OF SCREEN 100 TITLE T1.
    PARAMETERS: PLRYCTNO like lryrctno,
              PDR_FN LIKE LDRIVER_FN,
              PZDELDT LIKE LZDELDT,
              PZLRYNO LIKE LZLRYNO.
    SELECTION-SCREEN END OF SCREEN 100.
    SELECTION-SCREEN BEGIN OF SCREEN 200 TITLE T2.
    select-options: slryctno for lryrctno,
                    sdr_fn for ldriver_fn,
                    szdeldt for lzdeldt,
                    szlryno for lzlryno,
                    pzdrid for lzdriverid no intervals.
    SELECTION-SCREEN END OF SCREEN 200.
    INITIALIZATION.
    T1 = 'SELECT CHECK BOX AND RADIO BUTTON'.
    T2 = 'SELECT PARAMETERS'.
    LB1 = 'PARAMETER'.
    LB2 = 'SELECT-OPTION'.
    AT SELECTION-SCREEN.
    CASE SY-UCOMM.
    WHEN 'PB1'.
    CALL SELECTION-SCREEN 100.
    select single * from zlryrct into lryrct where zebeln = plryctno.
        if sy-subrc = 0.
          message 'primary key already exists. enter different lorry rect. no.' type 'W'.
        endif.
        LRYRCT-ZEBELN    = PLRYCTNO.
        LRYRCT-DRIVER_FN = PDR_FN .
        LRYRCT-ZDELDT    = PZDELDT.
        LRYRCT-ZLRYNO    = PZLRYNO.
        INSERT INTO ZLRYRCT VALUES LRYRCT.
        if not sy-subrc = 0.
          MESSAGE 'Insert not possible' TYPE 'W' .
        endif.
    WHEN 'PB2'.
    CALL SELECTION-SCREEN 200.
        select * from zlryrct into lryrct where
                 zebeln in slryctno and
                 driver_fn in sdr_fn and
                 zdeldt in szdeldt and
                 zlryno in szlryno.
          write: / lryrct-zebeln, LRYRCT-DRIVER_FN, LRYRCT-ZDELDT, LRYRCT-ZDELDT, LRYRCT-ZLRYNO .
        endselect.
    ENDCASE.

    What you are looking for is called "search help" (SE11 transaction), you may reuse an existing one (it must be attached to data element, or structure component as foreign key, etc.) Please look at SAP documentation and forums. You may also program it yourself by using AT SELECTION-SCREEN ON VALUE-REQUEST FOR ...

  • How to insert data values using Poplist to both block items....

    Hi,
    I have created a poplist which should return a sequence(which is stored in a db table) and a description .
    The sequence(stored in table) is of number datatype and the description is of varchar2.....
    I have created the required record group as:
    rg_id := Create_Group_From_Query('TEXNIKOS_GROUP', 'select eponymo , to_char(seq_code_ergazomenoy)
                                                           from ref_ergazomenos,ref_eidikothta
                                                           where ref_ergazomenos.code_eidikothtas_type_id=ref_eidikothta.seq_code_eidikothtas
                                                           order by 1');
       status := Populate_Group( rg_id );
       if (status = 0)
         then
          POPULATE_LIST('MOD2_KLISI_VLAVIS.TEXNIKOS_FNAME','TEXNIKOS_GROUP');
       end if;The field 'MOD2_KLISI_VLAVIS.TEXNIKOS_FNAME' is the description i described above ... and whereas this block item is filled with the selected poplist... the sequence - the code of the db table- is not.....
    Is it possible to do so.... ????
    NOTE: i use Dev10g.
    Many thanks,
    Simon

    I have two block items:
    seq_code_ergazomenoy: number datatype , db item , invisible
    eponymo:varchar2 datatype , non db item , visible
    How to fill these both block items using the written record group...?????
    Now , only the "eponymo" block item is filled but not the required "seq_code_ergazomenoy"....
    In other words.... is there any manner to do the column mapping of the two selected columns (in the dynamically created record group) to the two block items....????
    Thanks,
    Simon
    Message was edited by:
    sgalaxy

  • How to add multiple columns using select statement

    Hi friends
    i have two TABLES
    one table Contain only unique Agent code(23,45,56,88)
    second table contain same Agent Code,orderdate & sum(amount)
    now i want to add columns in table 1 according to date and update the amount in that column
    for example if i select start date 1st july 2014 and end date is 15 july 2014
    then i want result 
    select agentcode,amount as 01july2014,amount as 02nd july2014 up to 15th july
    Please HELP.....

    >> I have two TABLES <<
    Please post DDL, so that people do not have to guess what the keys, constraints, Declarative Referential Integrity, data types, etc. in your schema are. Learn how to follow ISO-11179 data element naming conventions and formatting rules. Temporal data should
    use ISO-8601 formats. You failed on this too!  Code should be in Standard SQL as much as possible and not local dialect. 
    This is minimal polite behavior on SQL forums. Ignorance is fine, but why do you have bad manners? The rules are posted at the front of the forum! 
    >> one [nameless, unknown] table Contain only unique Agent code(23, 45, 56, 88) <<
    You do not know the difference between a code and an identifier!
    CREATE TABLE Agents
    (agent_id INTEGER NOT NULL PRIMARY KEY); 
    >> second table contain same Agent Code, order_date & SUM(order_amount) <<
    Wrong again! The SUM() is an aggregate function and cannot be in a column. Tables have keys
    CREATE TABLE Orders
    (agent_id INTEGER NOT NULL
       REFERENCES Agents(agent_id),
     order_date DATE NOT NULL,
     order_amt DECIMAL (8,2) NOT NULL,
     PRIMARY KEY (agent_id, order_date));
    >> now I want to add columns in table 1 according to date and update the amount in that column <<
    NO! The running total is a computed column. We do not store them.
    >> for example if I select start date 1st July 2014 [sic: 2014-07 -01] and end date is 15 July 2014 [sic: 2014-07-15] <<
    If you have ever read a book on SQL, you would know the correct display format for dates! It is the only one in the ANSI/ISO Standards. 
    SELECT agent_id, order_date,
           SUM(order_amt) 
           OVER (PARTITION BY agent_id
                    ORDER BY order_date
                  ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW)
           AS order_amt_runtot
      FROM Orders
     WHERE order_date BETWEEN '2014-07-01' AND '2014-07-15'; 
    --CELKO-- Books in Celko Series for Morgan-Kaufmann Publishing: Analytics and OLAP in SQL / Data and Databases: Concepts in Practice Data / Measurements and Standards in SQL SQL for Smarties / SQL Programming Style / SQL Puzzles and Answers / Thinking
    in Sets / Trees and Hierarchies in SQL

  • Insert using select statement

    Hi,
    I am trying to insert values using select statement. But this is not working
    INSERT INTO contribution_temp_upgrade
    (PRO_ID,
    OBJECT_NAME,
    DELIVERY_DATE,
    MODULE_NAME,
    INDUSTRY_CATERGORIZATION,
    ADVANTAGES,
    REUSE_DETAILS)
    VALUES
    SELECT
    :P1_PROJECTS,
    wwv_flow.g_f08(vRow),
    wwv_flow.g_f09(vRow),
    wwv_flow.g_f10(vRow),
    wwv_flow.g_f11(vRow),
    wwv_flow.g_f12(vRow),
    wwv_flow.g_f13(vRow)
    FROM DUAL;
    Please let me know what i am missing..
    Thanks
    Sudhir

    Try this
    INSERT INTO contribution_temp_upgrade
    (PRO_ID,
    OBJECT_NAME,
    DELIVERY_DATE,
    MODULE_NAME,
    INDUSTRY_CATERGORIZATION,
    ADVANTAGES,
    REUSE_DETAILS)
    SELECT
    :P1_PROJECTS,
    wwv_flow.g_f08(vRow),
    wwv_flow.g_f09(vRow),
    wwv_flow.g_f10(vRow),
    wwv_flow.g_f11(vRow),
    wwv_flow.g_f12(vRow),
    wwv_flow.g_f13(vRow)
    FROM DUAL;Note: when you are selecting a value using select statement, you should not specify the keyword "values".
    i assume you have already assigned value for your bind variable :P1_PROJECTS and rest of the functions will return some value.
    Regards,
    Prazy

  • How to get the inserted row primary key with out  using select statement

    how to return the primary key of inserted row ,with out using select statement
    Edited by: 849614 on Apr 4, 2011 6:13 AM

    yes thanks to all ,who helped me .its working fine
    getGeneratedKeys
    String hh = "INSERT INTO DIPOFFERTE (DIPOFFERTEID,AUDITUSERIDMODIFIED)VALUES(DIPOFFERTE_SEQ.nextval,?)";
              String generatedColumns[] = {"DIPOFFERTEID"};
              PreparedStatement preparedStatement = null;
              try {
                   //String gen[] = {"DIPOFFERTEID"};
                   PreparedStatement pstmt = conn.prepareStatement(hh, generatedColumns);
                   pstmt.setLong(1, 1);
                   pstmt.executeUpdate();
                   ResultSet rs = pstmt.getGeneratedKeys();
                   rs.next();
    //               The generated order id
                   long orderId = rs.getLong(1);

  • How to use bind variable in this select statement

    Hi,
    I have created this procedure where table name and fieldname is variable as they vary, therefore i passed them as parameter. This procedure will trim leading (.) if first five char is '.THE''. The procedure performs the required task. I want to make select statement with bind variable is there any possibility to use a bind variable in this select statement.
    the procedure is given below:
    create or replace procedure test(tablename in varchar2, fieldname IN varchar2)
    authid current_user
    is
    type poicurtype is ref cursor;
    poi_cur poicurtype;
    sqlst varchar2(250);
    THEVALUE NUMBER;
    begin
         sqlst:='SELECT EMPNO FROM '||TABLENAME||' WHERE SUBSTR('||FIELDNAME||',1,5)=''.THE ''';
         DBMS_OUTPUT.PUT_LINE(SQLST);
    OPEN POI_CUR FOR SQLST ;
    LOOP
         FETCH POI_CUR INTO THEVALUE;
              EXIT WHEN POI_CUR%NOTFOUND;
              DBMS_OUTPUT.PUT_LINE(THEVALUE);
              SQLST:='UPDATE '||TABLENAME|| ' SET '||FIELDNAME||'=LTRIM('||FIELDNAME||',''.'')';
              SQLST:=SQLST|| ' WHERE EMPNO=:X';
              DBMS_OUTPUT.PUT_LINE(SQLST);
                   EXECUTE IMMEDIATE SQLST USING THEVALUE;
    END LOOP;
    COMMIT;
    END TEST;
    Best Regards,

    So you want to amend each row individually? Is there some reason you're trying to make this procedure run as slow as possible?
    create or replace procedure test (tablename in varchar2, fieldname in varchar2)
    authid current_user
    is
       sqlst      varchar2 (250);
       thevalue   number := 1234;
    begin
       sqlst := 'update ' || tablename || ' set ' || fieldname || '= ltrim(' || fieldname || ',''.'')  where substr(' || fieldname
          || ',1,5) = ''.THE ''';
       dbms_output.put_line (sqlst);
       execute immediate sqlst;
    end test;will update every row that satisfies the criteria in a single statement. If there are 10 rows that start with '.THE ' then it will update 10 rows.

  • [php+mysql] how to use variables in a select statement?

    Hi all,
    I'm searching for a way to use a variable in the select
    statement of mysql
    query.
    I have this variable that can contain:
    $var=field_1 field_2 field5
    or
    $var=field3 field4 field8
    so, the variable content is not always the same.
    I would like to filter a table selecting only the columns
    specified by the
    current $var content.
    Is this possible to do something like this?
    $var=field1 field5 field10
    SELECT string_to_array($var)
    FROM mytable
    ORDER BY mysortfield ASC
    Or, is there another way to select columns dynamically?
    Thanks for any suggestion.
    tony

    Hi all,
    I'm searching for a way to use a variable in the select
    statement of mysql
    query.
    I have this variable that can contain:
    $var=field_1 field_2 field5
    or
    $var=field3 field4 field8
    so, the variable content is not always the same.
    I would like to filter a table selecting only the columns
    specified by the
    current $var content.
    Is this possible to do something like this?
    $var=field1 field5 field10
    SELECT string_to_array($var)
    FROM mytable
    ORDER BY mysortfield ASC
    Or, is there another way to select columns dynamically?
    Thanks for any suggestion.
    tony

  • How to pass parameter in Function by using select statement?

    Hi,
    I got a problem. I cant pass in parameter to function by using select statement. But it can pass in parameter by using 'hardcode' method. How can I solve this problem?
    Eg,
    select * from table (SplitFunction('HS750020,HS750021')) <<< this work.
    but
    select * from table (SplitFunction(select LOT_NO from TRACER_SEARCH_SCHEDULE where JOB_ID = '36')) <<< do not work.
    Thanks for who try to help. Thanks.

    skymonster84 wrote:
    I have try this before. But it not work.here is an example
    create or replace type stringlist as table of varchar2(100)
    create or replace function splitstring(pstring in varchar2) return stringlist
    as
      lstringlist stringlist;
    begin
      select regexp_substr(pstring,'[^,]+',1, level) bulk collect into lstringlist
        from dual
      connect by level <= length(pstring)-length(replace(pstring,','))+1;
      return lstringlist;
    end;
    select * from table(select splitstring('xx,yy,zz') from dual)
    create table t(str varchar2(100))
    insert into t values('x,y,z')
    insert into t values('a,b,c')
    select * from table(select splitstring(str) from t where rownum<2)
    /If you supply multiple values then it will fail.
    select * from table(select splitstring(str) from t)
    /

  • Using Variables in a select statement through a Database Adapter

    I was wondering how I reference a variable in a select statement through a Database Adapter.
    Ex.
    1. I have a global variable that stores an employee number
    2. I want to select an SSN # from a table based on an employee #
    variable.
    select ssn from emp where ssn = :input_variable - ????
    - how do i reference the variable - I am getting a 'missing IN or OUT parameter error?
    Any advice is much appreciated.
    ~Thanks

    I'm just wondering if anyone knows a work around so that I might be able to store a Table's FIELD name in a variable or an array[] so that I can do a query based on the decision of a loop without having to code 10 IF/ELSE statements.For instance, although the above code will not work, this code, although quite lengthy, does:
    If DataGrid1.SelStartCol = 0 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES__PUR_DT"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 1 Then
    Adodc1.RecordSource = "Select * from tblReservation order by VENDOR"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 2 Then
    Adodc1.RecordSource = "Select * from tblReservation order by VEN_LOC"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 3 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES_TYPE"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 4 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES_FROM_DT"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 5 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES_TO_DT"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 6 Then
    Adodc1.RecordSource = "Select * from tblReservation order by MISC_ADJ"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 7 Then
    Adodc1.RecordSource = "Select * from tblReservation order by STATE_TAX"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 8 Then
    Adodc1.RecordSource = "Select * from tblReservation order by LOC_CHARGE"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 9 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES_ID"
    Adodc1.Refresh
    ElseIf DataGrid1.SelStartCol = 10 Then
    Adodc1.RecordSource = "Select * from tblReservation order by RES_OP"
    Adodc1.Refresh
    End If
    Do you see where i'm going with this?
    I simple want to use a variable in the "select * from <Table> Order by <Field>"

  • FETCHING VALUES IN MULTI RECORD BLOCK FROM ANOTHER TABLE USING SELECT STATEMENT.

    Hi,
    I have one multi record block in which i want to fetch values
    (more then one record) from another table using select statement
    IN KEY NEXT ITEM.I am getting following error.
    ORA-01422: exact fetch returns more than requested number of rows
    Thanks in advance.

    In your case I see no reason to use non-database block and to try to populate it from a trigger with a query, instead of using the default forms functionality where you can associate the block and the fields with table, create where clause using bind variables and simply use execute_query() build-in to populate the block. The power of the forms is to use their build-in functionality to interact with the database.
    Also, you can base your block on a query, not on a table and you dynamically change this query using set_block_property() build-in. You can use any dynamic queries (based on different data sources) and you simply need to control the column's data type, the number of the columns and their aliases. Something like creating inline views as a block data source.
    However, you can replace the explicit cursor with implicit one like
    go_block('non_db_block_name');
    first_record();
    FOR v_tab IN (SELECT *
    FROM tab
    WHERE col_name = :variable)
    LOOP
    :non_db_block_name.field1 := v_tab.col1;
    :non_db_block_name.field2 := v_tab.col2;
    next_record();
    END LOOP;

  • How to Read Variable Values in WAD 7.0 Using JavaScript

    I found a how to: How to Read Variable Values in WAD 7.0 Using JavaScript on SDN.
    I get a Javascript error:
    bics.getElementsByTagName is not a function
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    Thats my script:
    function currency()
    var varnm = "SFS_CP_CURR"; // Name of the variable to be read
    root = document.childNodes[0]; // <HTML>
    body = root.getElementsByTagName("BODY")[0]; // <BODY>
    xml = body.getElementsByTagName("XML")[0]; // <XML>
    bics = xml.childNodes[0]; // <BICS_VIEW>
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    varl = vars.getElementsByTagName("VARIABLE"); // gives no. of variable in DP
    for ( i = 0; i <= varl.length; i++ ) // Loop one by one
    vari = vars.getElementsByTagName("VARIABLE")<i>;
    varnam = vari.attributes[0].text; // get variable name
    mem = vari.getElementsByTagName("MEMBER")[0];
    varval = mem.attributes.getNamedItem("name").value; // read variable value
    if (varnam == varnm) //check varname in loop needs to be read
    if (varval == "ZMON") // check for value1 and fire command1
    SFS_CP_M();
    if (varval == "ZKON") // check for value2 and fire command2
    SFS_CP_K();
    break;
    Where's the mistake?

    I'm afraid I haven't made my question understood clearly.
    What I am looking for is a method to get the value of variable inside excel (e.g. put it into a cell / range of a worksheet, so that we can reference it and use it as an input for planning function execution).
    Please advice.
    Thanks in advance,
    Shady

  • Number of rows inserted is different in bulk insert using select statement

    I am facing a problem in bulk insert using SELECT statement.
    My sql statement is like below.
    strQuery :='INSERT INTO TAB3
    (SELECT t1.c1,t2.c2
    FROM TAB1 t1, TAB2 t2
    WHERE t1.c1 = t2.c1
    AND t1.c3 between 10 and 15 AND)' ....... some other conditions.
    EXECUTE IMMEDIATE strQuery ;
    These SQL statements are inside a procedure. And this procedure is called from C#.
    The number of rows returned by the "SELECT" query is 70.
    On the very first time call of this procedure, the number rows inserted using strQuery is *70*.
    But in the next time call (in the same transaction) of the procedure, the number rows inserted is only *50*.
    And further if we are repeating calling this procedure, it will insert sometimes 70 or 50 etc. It is showing some inconsistency.
    On my initial analysis it is found that, the default optimizer is "ALL_ROWS". When i changed the optimizer mode to "rule", this issue is not coming.
    Anybody faced these kind of issues?
    Can anyone tell what would be the reason of this issue..? any other work around for this...?
    I am using Oracle 10g R2 version.
    Edited by: user13339527 on Jun 29, 2010 3:55 AM
    Edited by: user13339527 on Jun 29, 2010 3:56 AM

    You have very likely concurrent transactions on the database:
    >
    By default, Oracle Database permits concurrently running transactions to modify, add, or delete rows in the same table, and in the same data block. Changes made by one transaction are not seen by another concurrent transaction until the transaction that made the changes commits.
    >
    If you want to make sure that the same query always retrieves the same rows in a given transaction you need to use transaction isolation level serializable instead of read committed which is the default in Oracle.
    Please read http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10471/adfns_sqlproc.htm#ADFNS00204.
    You can try to run your test with:
    set  transaction isolation level  serializable;If the problem is not solved, you need to search possible Oracle bugs on My Oracle Support with keywords
    like:
    wrong results 10.2Edited by: P. Forstmann on 29 juin 2010 13:46

Maybe you are looking for

  • In mail.app I only get 4 emails at a time

    Hello, since I updated to  OS X Lion, I'm having problems with the Mail.app. Bassically when I ask it yo get new mail, it onley get 4 email at a time. After that I have to press again the Get Mail button to get more mail. Does anyone have something l

  • Help with xml flash slideshow

    hi, i have made a sildeshow in flash which loads the pictures from an xml file and between the transition, it shows a preload bar. i have attached the code. my problem is that on local machine it is working absolutely fine but when i upload it on the

  • Free very useful utility - iClip lite SE

    I never saw the use for a program like iClip because I would just keep the information I wanted in a file that I would copy and paste from. However, the new free version iClip lite has a new feature, the ability to store iWork shape files AS shapes i

  • Online Galleries with Client Proofing

    Currently when I post photographs from a client shoot to Zenfolio or Smugmug, my clients say things like "I like 22, 34, 25, 26, and 27" or "I like the third one down and fourth one to the left on the third page" and while it's helpful to be integrat

  • Windows XP corruption - Must Reinstall iTunes, New Drive

    Briefly: XP Home Edition became corrupt on failed installs of SP 2. Must reinstall windows. As long as I'm at it, I will put in a much bigger new internal Hard Drive for music and photo and data files and keep the old drive for XP and applications on