Urgent: regarding insert query problem

i have a one table say "item_master_old" its structure is like
item_master_old (item_name, item_rate, item_qty, item_desc)
second table say "item_master" its structure is like
item_master(id, item_name, item_rate, item_qty, item_desc)
i want to insert item_master_old values in item_master using the following insert query :
insert into item_master ( (select nvl( max(id), 0) + 1 from item_master ),
item_name,
item_rate,
item_qty,
item_desc
from
item_master_old)
but i update the id column with 1 in all column but i want the max(id) + 1
how it can be possible ?
Regards
s

try this!
insert into item_master
select (select nvl(max(id),0) from item_master)+rownum,
item_name,  item_rate, item_qty, item_desc
from item_master_old;
"Not tested"Message was edited by:
Jameel

Similar Messages

  • Insert query problem

    I have a insert query that I have not changed, but for some reason it will not insert anything into the database.
    The data gets inserted by a Ajax submit form and goes to insert.php
    if(isset($_POST['message_wall'])){
        /* Connection to Database */
        include('config.php');
        /* Remove HTML tag to prevent query injection */
        $message = mysql_real_escape_string($_POST['message_wall']);
        $to = mysql_real_escape_string($_POST['profile_to']);
        $sql    =    'INSERT INTO wall (message) VALUES(
                    "'.$message.'")';
                     mysql_query($sql);
    I want to be able to add a user_id into the database too
    The ajax code:
    $(document).ready(function(){
        $("form#submit_wall").submit(function() {
        var message_wall = $('#message_wall').attr('value');
            $.ajax({
                type: "POST",
                url: "insert.php",
                data: "message_wall="+ message_wall,
                success: function(){
                    $("ul#wall").prepend("<li style='display:none'>"+message_wall+"</li><br><hr>");
                    $("ul#wall li:first").fadeIn();
        return false;

    hi,
    while I was waiting for your message I went back to the raw code.
    I changed my code and now it works but it falls again once I add the other info in hidden fields
            $.ajax({
                type: "POST",
                url: "insert.php",
                data: "message_wall="+ message_wall,
                date: "msg_date="+ msg_date,
                success: function(){
                    $("ul#wall").prepend("<li style='display:none'>"+message_wall+"</li><br />"+msg_date+"<hr />");
                    $("ul#wall li:first").fadeIn();
    <form action="" id="submit_wall" name="submit_wall">
    <textarea name="name" id="message_wall" cols="70" rows="2" onclick="make_blank();"></textarea>
    <div align="left"><button type="submit">Post to wall</button></div>
    <input name="profile_to" type="hidden" value="<?php echo $row_user_profile['user_id']; ?>" />
    <input name="msg_date" type="hidden" value="<?php echo date("d/m/y");?>" />
    </form>
    how do I add more than one post option?
    Is this right:
                data: "message_wall="+ message_wall,
                 date: "msg_date="+ msg_date,
    I tried
                data: "message_wall="+ message_wall, "msg_date="+ msg_date,
    But nothing. I take it this is where the fields are sent

  • URGENT !( jdbc query problem)

    Hi Forum
    i made an application which run on JRun server.
    In many of my jsps i used sql query like this:
    " select id, name, rollno from student where add = 'jj';"
    and retrieve the record from resultset like this:
    rs.getString("id");
    rs.getString("name");
    rs.getString("rollno");
    I got no error.
    BUT WHEN I RETRIEVE THE RECORDS LIKE THIS
    rs.getString("name");
    rs.getString("id");
    rs.getString("rollno");
    i got the error:
    java.sql.SQLException: [Oracle][ODBC]Invalid column number <1>.
    I can not understand what is the problem ?
    all the datatypes are correct.
    all coding is correct.
    and everything is correct.
    pls help me & suggest a solution.
    is there any problem of jdbc API OR of JRUN SERVER SETTINGS?
    thanks
    mail me at [email protected]
    Arvind Goel

    Here is a part of my code in which i got error:
    (all variables are defined)
    It is the working code. BUT when i change the sequence of retrieving fields as i select then problem occurs.
    pls help me, i need it urgently.
    if(st.equals("YES")){
              rs=stmt.executeQuery("select r.na_WPN, m.MK_WPN, m.tp_WPN, m.REC_NO, m.ISSUED, r.dte_del, r.ps from amm_issue r,armentry m where r.ent_srno=m.srno and r.ps='"+username+"' and m.issued='YES' ");
         else if(st.equals("NO")){
                        rs=stmt.executeQuery("select r.na_WPN, m.MK_WPN, m.tp_WPN, m.REC_NO, m.ISSUED, r.dte_del, r.ps from amm_issue r,armentry m where r.ent_srno=m.srno and r.ps='"+username+"' and m.issued='NO' ");
         else if(st.equals("BOTH")){
              rs=stmt.executeQuery("select r.na_WPN, m.MK_WPN, m.tp_WPN, m.REC_NO, m.ISSUED, r.dte_del, r.ps from amm_issue r,armentry m where r.ent_srno=m.srno and r.ps='"+username+"'");
    while(rs.next())
         String tp_wpn=rs.getString("na_WPN");
         String mk_wpn=rs.getString("MK_WPN");
         String no_wpn=rs.getString("tp_WPN");
         String rec_no=rs.getString("REC_NO");
         String issued=rs.getString("ISSUED");
         dte_del          =rs.getString("dte_del");
         ps=     rs.getString("ps");
              if(i==0){
              out.println("<tr><th>Police Station </th> <th>Type of Weapon</th><th>Make of Weapon</th><th>No of Weapon</th><th>Recipt No</th><th>Issued Status</th><th>Date of Receiving");
              }i++;
              out.println("<TR><td>"+ps+" <td>"+no_wpn+"      <td>"+mk_wpn+"</td> <td>"+tp_wpn+"</td> <td> "+rec_no+"</td><td>"+issued+"<td><center>"+dte_del+" </td>");
    thanx
    Arvind

  • Urgent: regarding output display problem

    hi,
    i had made dis report for displaying changes made to a purticular material in a purticular month.
    d poblem is dis when i check a materail in MM04 which use to display a change made to a single material and when i check further that what changes had made it shows 4 changes but when i check my report it shows only 2 changes had been made.
    plzz help me out as help will be definately rewarded.
    last time i asked in dis forum not much help was provided.
    here is d code:-
    REPORT ZNEW01 no standard page heading LINE-SIZE 310.
    TABLES: CDHDR,CDPOS.
    DATA: BEGIN OF ITAB OCCURS 0,
    OBJECTCLAS LIKE CDHDR-OBJECTCLAS,
    OBJECTID LIKE CDHDR-OBJECTID,
    USERNAME LIKE CDHDR-USERNAME,
    UDATE LIKE CDHDR-UDATE,
    UTIME LIKE CDHDR-UTIME,
    TCODE LIKE CDHDR-TCODE,
    CHANGE_IND LIKE CDHDR-CHANGE_IND,
    END OF ITAB.
    DATA: BEGIN OF ITAB1 OCCURS 0,
    OBJECTCLAS LIKE CDPOS-OBJECTCLAS,
    OBJECTID LIKE CDPOS-OBJECTID,
    FNAME LIKE CDPOS-FNAME,
    CHNGIND LIKE CDPOS-CHNGIND,
    VALUE_OLD LIKE CDPOS-VALUE_OLD,
    VALUE_NEW LIKE CDPOS-VALUE_NEW,
    END OF ITAB1.
    SELECT-OPTIONS: M_DATE FOR CDHDR-UDATE,
    U_ID FOR CDHDR-CHANGE_IND.
    SELECT BOBJECTCLAS BOBJECTID BUSERNAME BUDATE BUTIME BTCODE B~CHANGE_IND INTO
    TABLE ITAB
    FROM CDHDR AS B WHERE B~OBJECTCLAS = 'MATERIAL' AND UDATE IN M_DATE AND CHANGE_IND IN U_ID.
    Check not itab[] is initial.
    SELECT OBJECTCLAS OBJECTID FNAME CHNGIND VALUE_OLD VALUE_NEW INTO TABLE
    ITAB1 FROM CDPOS
    FOR ALL ENTRIES IN ITAB WHERE OBJECTID = itab-objectid and objectclas = ITAB-OBJECTCLAS .
    *SELECT OBJECTCLAS OBJECTID FNAME CHNGIND VALUE_OLD VALUE_NEW INTO TABLE
    *ITAB1 FROM CDPOS
    *WHERE OBJECTID = itab-objectid and objectclas = ITAB-OBJECTCLAS .
    ULINE.
    LOOP AT ITAB.
    WRITE:/ ITAB-OBJECTID,22 ITAB-USERNAME,ITAB-UDATE,ITAB-UTIME,ITAB-TCODE.
    LOOP AT ITAB1 WHERE OBJECTCLAS = ITAB-OBJECTCLAS AND OBJECTID = ITAB-OBJECTID.
    WRITE: 60 ITAB1-FNAME,ITAB1-CHNGIND,ITAB1-VALUE_OLD(40),ITAB1-VALUE_NEW(40).
    ENDLOOP.
    ENDLOOP.

    hey ric
    i have tested ur code
    i think u have got a problem with the selection criteria "date"
    because i have cross checked the code you have developed and through the transaction
    it is impeccably right
    i think the selection of date in your report should be the range of dates in which they have been modfiied/changed
    if satisfied plz do reward
    regards
    samarendra

  • Urgent Sql Query Problem - -Very Urgent

    Hi Guys,
    I need a urgent solution for a problem.I am
    using the following query
    select ename from emp where deptno =10
    Now I will declare a bind variable and if user passes 'A'
    then the query will run as it is and if he passes B
    then it should run the above query with this additional clause -> birthdate - hiredate >15.
    Please can any one help its very urgent

    Assuming that you have a birthdate column in your emp table, the following will do what you are asking for:
    VARIABLE bind_var VARCHAR2(1)
    EXECUTE :bind_var := '&bind_variable'
    SELECT ename FROM
    (SELECT 'A' AS selection, ename FROM emp WHERE deptno = 10
    UNION ALL
    SELECT 'B' AS selection, ename FROM emp WHERE deptno = 10 AND birthdate - hiredate > 15)
    WHERE selection = :bind_var
    However, the clause "birthdate - hiredate > 15" will only retrieve rows for employees who were born more than 15 days after they were hired. I doubt that this is what you really want, since this is impossible.

  • Problem looping insert query

    I'm working on inserting a recordset up Google Calendar entries into my site database. I have a form set up that allows me to insert new entries into the data table, but when I try to loop the insert query over the Google recordset, I get nothing (no errors, but no entries added to database).
    Here's my form, which both displays the values from the Google query and populates fields (mostly hidden) with those values to submit to the Insert query. There's also a line that checks to make sure the event hasn't been canceled (canceled events are still listed, the start and end times are just set to null values):
    <form method="post" action="<cfoutput>#CurrentPage#</cfoutput>">
    <table cellpadding="2" border="1">
    <cfset thisRow = 0>
    <cfloop query="band_events">
    <cfif IsDefined("starttime") AND IsDefined("endtime") AND starttime NEQ "" AND endtime NEQ "">
    <cfset thisRow = thisRow + 1>
    <cfoutput>
    <tr>
      <td>#thisRow#</td>
      <td><input name="update#thisRow#" type="checkbox" checked="checked" /></td>
      <td><input name="calendar#thisRow#" type="hidden" value="Band" />Band</td>
      <td><input name="creator#thisRow#" type="hidden" value="#authoremail#" />#authoremail#</td>
      <td><input name="starttime#thisRow#" type="hidden" value="#starttime#" />#starttime#</td>
      <td><input name="endtime#thisRow#" type="hidden" value="#endtime#" />#endtime#</td>
      <td><input name="title#thisRow#" type="hidden" value="#title#" />#title#</td>
      <td><input name="content#thisRow#" type="hidden" value="#content#" />#content#</td>
      <td><input name="location#thisRow#" type="hidden" value="#where#" />#where#</td>
      <td><input name="ID#thisRow#" type="hidden" value="#ID#" />#ID#</td>
      <td><input name="published#thisRow#" type="hidden" value="#ISOToDateTime(published)#" />#ISOToDateTime(published)#</td>
      <td><input name="updated#thisRow#" type="hidden" value="#ISOToDateTime(updated)#" />#ISOToDateTime(updated)#</td>
    </tr>
    </cfoutput>
    </cfif>
    </cfloop>
    </table>
    <input type="hidden" name="totalRows" value="#row#" />
    <input type="submit" name="submit" value="Submit" />
    <input type="hidden" name="update_events" value="update_events" />
    </form>
    Here's the action script. There's some extra code in there to convert some of the date formats Google uses, and to account for the differences in time zones between the Google values and local time:
    <cfif StructKeyExists(form,"update_events")>
      <cfset loopCount = form["totalRows"]>
      <cfloop index="row" from="1" to="#loopCount#">
        <cfset thisCalendar = form["calendar" & row]>
        <cfset thisCreator = form["creator" & row]>
        <cfset thisStarttime = form["starttime" & row]>
        <cfset thisEndtime = form["endtime" & row]>
        <cfif TimeFormat(thisStarttime,"hh:mm tt") EQ "12:00 AM" AND TimeFormat(thisEndtime,"hh:mm tt") EQ "12:00 AM">
          <cfset thisAllDay = -1>
        <cfelse>
          <cfset thisAllDay = 0>
          <cfset thisStarttime = DateAdd("h",5,thisStarttime)>
          <cfset thisEndtime = DateAdd("h",5,thisEndtime)>
        </cfif>
        <cfset thisTitle = form["title" & row]>
        <cfset thisContent = form["content" & row]>
        <cfset thisLocation = form["location" & row]>
        <cfset thisID = form["ID" & row]>
        <cfset thisPublished = form["published" & row]>
        <cfset thisUpdated = form["updated" & row]>
        <cfquery datasource="ctband">
          INSERT INTO Events (Calendar, Created_By, All_Day, Event_Start, Event_End, Title, Content, Location, ID, Published, Updated) Values (
          <cfqueryparam value="#thisCalendar#" cfsqltype="cf_sql_varchar">,
          <cfqueryparam value="#thisCreator#" cfsqltype="cf_sql_varchar">,
          <cfqueryparam value="#thisAllDay#" cfsqltype="cf_sql_integer">,
          <cfqueryparam value="#thisStarttime#" cfsqltype="cf_sql_timestamp">,
          <cfqueryparam value="#thisEndtime#" cfsqltype="cf_sql_timestamp">,
          <cfqueryparam value="#thisTitle#" cfsqltype="cf_sql_varchar">,
          <cfqueryparam value="#thisContent#" cfsqltype="cf_sql_clob">,
          <cfqueryparam value="#thisLocation#" cfsqltype="cf_sql_varchar">,
          <cfqueryparam value="#thisID#" cfsqltype="cf_sql_varchar">,
          <cfqueryparam value="#thisPublished#" cfsqltype="cf_sql_timestamp">,
          <cfqueryparam value="#thisUpdated#" cfsqltype="cf_sql_timestamp">)
        </cfquery>
      </cfloop>
    </cfif>
    I'm thinking there must be something pretty obvious I've screwed up, but I can't for the life of me find it. Any help would be appreciated!
    JAW

    First, I see this:
    <cfset thisRow = thisRow + 1>
    Which is you counting the number of rows, I assume.  Then I see this:
    <input type="hidden" name="totalRows" value="#row#" />
    But I don't see where #row# has been set.
    You are correct. That was a combination of a couple different attempts at this and I used the wrong variable name on that line. Alas, correcting that didn't solve the problem.
    Then I see this:form["totalRows"]
    When I'm used to seeing this:
    FORM.totalRows
    I've never seen the form["name"] before.  Does that actually work?
    I read somewhere that that's a more effective way of factoring the variable in the name of the form field as an alternative to Evaluate("form.field#row#"). I think it was somewhere on Ray Camden's blog, but it was a while ago. The only reason I used it there was for consistency. That  spot could easily have been FORM.totalRows, but the others would have to be either Evaluate("FORM.calendar#row#") or form["calendar" & row]. Again, I'm learning as I go, though, so I may have used it incorrectly. It's not throwing errors though, it's just reloading a blank page, as if it's submitting the form, but not actually processing the query. That's the confusing part to me.

  • C# : Get Column name for an Insert Query from The Selected GridView Row.

    Hi Guys, I am trying to insert data in an SQL table by executing an Insert Query. 
    The problem is that I need to get the column name from a cell in the selected gridview Row.
    Here's the snippet:
    SqlCommand cmd30 = new SqlCommand("insert into mytable ( '"+GridView7.SelectedRow.Cells[0].Text+"' , r_id) values ('"+ GridView7.SelectedRow.Cells[1].Text +"', '"+TextBox1.Text+"')",con30);
            cmd30.ExecuteNonQuery();
    **r_id is not a Primary Key.
    The Error is get is:
    Incorrect syntax near 'r_id'.
    Any Help will be appreciated.
    Thanks,
    Shaleen
    TheHexLord

    Hi TheShaleen,
    Like your title mentioned.GridView control is a web class.This forum is to discuss problems of C# development.  Your question is not related to the topic of this forum.
    You'll need to post it in the dedicated ASP.Net Forum  for more efficient responses, where you can contact ASP.NET experts. Thanks for understanding.
    Best regards,
    Kristin
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Performance issues with respect scheme registration,select & insert query

    I am facing performance issues with respect to schema registration,Select & insert query towards 10.2.0.3 version.It is taking around 45 minutes to register schema and it is taking around 5 min to insert a single document into xml db where as it was taking less than min to insert a single document into xml db of 9.2.0.6 version.Would like to know the issue and solution to resolve this issue.Please help me out on this as it is very urgent for me

    Since it appears that this is an XML DB specific question, you're probably better off posting in the XML DB. The folks over there have much more experience with the ins and outs of that particular product.
    Justin

  • Regarding a query that gives a count of a certain combination of characters

    Hi all,
           I had a query to be created that gives a count of a certain combination of characteristics from a cube.
    Say a cube has 4 characteristics , Say A, B, C, D.
    Now amongst all the records that occured in the Cube I need a report of the following A, B and be able to see the count of the number of times a combination of A B occured i.e. variations of C and D for a certain A and B.
    For example say in the cube the A B C D has the following contents
    a1,b1,c1,d1
    a1,b1,c1,d2
    a1,b1,c1,d3
    a1,b1,c2,d1
    a1,b2,c1,d1
    a1,b2,c1,d2
    a1,b2,c2,d1
    a1,b2,c2,d2
    a2,b1,c1,d1.
    the report should show
    a1,b1,4 ,where 4 is the number of combination of a1 & b1.
    a1,b2,4 ,where 4 is the number of combination of a1 & b2.
    a2,b1,1 ,where 1 is the number of combination of a2 & b1.
    i want a help from all regarding this query.
    Thanking you in advance

    If you are in BW 3.5 or SEM I'd do this with a BPS-Exit that fills a key figure 'Combination Count' with 1 for each combination. If you need any details programming a BPS exit function feel free to ask.
    If you are in BW 3.0 or 3.1 without BPS-functions or you don't want to do BPS-setup just to create a user exit I'd suggest the following.
    1. Create an ODS CCOUNT that contains A,B,C,D and a key figure COUNT.
    2. Create an export data source for your cube.
    3. Create uodate rules from your cube to the ODS and set the key figure to constant 1 (with overwrite).
    4. Load your cube data into the ODS object.
    5. Load the ODS values back into the cube.
    This could lead to problems if you have other InfoObjects in your cube like time or version where you want to filter.
    Final method would be a virtual key figure but I'd try it this way first.
    B est regards
       Dirk

  • Tools | Insert Query no longer supported with SAPBEX 7.0 ?

    Hi
    With SAPBEX for BW 3.5 we could use Tools | Insert Query ... in individual worksheets and then save this as a workbook. 
    Now for BW 7.0, the SAPBEX does not seem to be able to do this and the end-user must "paint" the query by inserting a navigation area, filter block and results area into the sheet and then bind these objects to an infoprovider.
    My users will struggle with this new method - has the Insert function been removed or is it hiding somewhere ?
    regards
    Ian MacLaren

    Hi,
    it's very borring to re-design a query for each sheet...
    So there is an helpful option :
    1) Open Bex Analyser
    2) Open your query
    3) DIsplay the Navigation pane (thanks to the button filter)
    4) In the navigation pane, right click on a caracteristic that is not display in your analysis grid yet
    5) choose the last option "Drill <name of the caracteristic> Across Sheets"
    6) It will duplicate the query for each value of the caracteristic, in a individual sheet for each value.
    (so... choose a caracteristic with less than 10 values)
    7) now you've got several sheets but no data.
    8) Refresh the workbook
    Now, you've got a workbook with several sheet with the same design.
    You just have to go in conception mode and change the dataprovider of the different object into each sheet.
    N.B : The button chart, filter, information doesn't work for news sheet...
    you will have to develop VBA macro or just use Excel function : Data > Group and Outline > Group... in order to hide and unhide lines and column quickly.
    Hope it's help
    Don't forget point.

  • Performance issue with insert query !

    Hi ,
    I am using dbxml-2.4.16, my node-storage container is loaded with a large document ( 54MB xml ).
    My document basically contains around 65k records in the same table ( 65k child nodes for one parent node ). I need to insert more records in to my DB, my insert XQuery is consuming a lot of time ( ~23 sec ) to insert one entry through command-line and around 50sec through code.
    My container is indexed with "node-attribute-equality-string". The insert query I used:
    insert nodes <NS:sampleEntry mySSIAddress='70011' modifier = 'create'><NS:sampleIPZone1Address>AABBCCDD</NS:sampleIPZone1Address><NS:myICMPFlag>1</NS:myICMPFlag><NS:myIngressFilter>1</NS:myIngressFilter><NS:myReadyTimer>4</NS:myReadyTimer><NS:myAPNNetworkID>ggsntest</NS:myAPNNetworkID><NS:myVPLMNFlag>2</NS:myVPLMNFlag><NS:myDAC>100</NS:myDAC><NS:myBcastLLIFlag>2</NS:myBcastLLIFlag><NS:sampleIPZone2Address>00000000</NS:sampleIPZone2Address><NS:sampleIPZone3Address>00000000</NS:sampleIPZone3Address><NS:sampleIPZone4Address>00000000</NS:sampleIPZone4Address><NS:sampleIPZone5Address>00000000</NS:sampleIPZone5Address><NS:sampleIPZone6Address>00000000</NS:sampleIPZone6Address><NS:sampleIPZone7Address>00000000</NS:sampleIPZone7Address></NS:sampleEntry> into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable)
    If I modify my query with
    into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:sampleTable/NS:sampleEntry[@mySSIAddress='1']
    insted of
    into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable)
    Time taken reduces only by 8 secs.
    I have also tried to use insert "after", "before", "as first", "as last" , but there is no difference in performance.
    Is anything wrong with my query, what should be the expected time to insert one record in a DB of 65k records.
    Has anybody got any idea regarding this performance issue.
    Kindly help me out.
    Thanks,
    Kapil.

    Hi George,
    Thanks for your reply.
    Here is the info you requested,
    dbxml> listIndexes
    Index: unique-node-metadata-equality-string for node {http://www.sleepycat.com/2002/dbxml}:name
    Index: node-attribute-equality-string for node {}:mySSIAddress
    2 indexes found.
    dbxml> info
    Version: Oracle: Berkeley DB XML 2.4.16: (October 21, 2008)
    Berkeley DB 4.6.21: (September 27, 2007)
    Default container name: n_b_i_f_c_a_z.dbxml
    Type of default container: NodeContainer
    Index Nodes: on
    Shell and XmlManager state:
    Not transactional
    Verbose: on
    Query context state: LiveValues,Eager
    The insery query with update takes ~32 sec ( shown below )
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS';insert nodes <NS:sampleEntry mySSIAddress='70000' modifier = 'create' ><NS:sampleIPZone1Address>AABBCCDD</NS:sampleIPZone1Address><NS:myICMPFlag>1</NS:myICMPFlag><NS:myIngressFilter>1</NS:myIngressFilter><NS:myReadyTimer>4</NS:myReadyTimer><NS:myAPNNetworkID>ggsntest</NS:myAPNNetworkID><NS:myVPLMNFlag>2</NS:myVPLMNFlag><NS:myDAC>100</NS:myDAC><NS:myBcastLLIFlag>2</NS:myBcastLLIFlag><NS:sampleIPZone2Address>00000000</NS:sampleIPZone2Address><NS:sampleIPZone3Address>00000000</NS:sampleIPZone3Address><NS:sampleIPZone4Address>00000000</NS:sampleIPZone4Address><NS:sampleIPZone5Address>00000000</NS:sampleIPZone5Address><NS:sampleIPZone6Address>00000000</NS:sampleIPZone6Address><NS:sampleIPZone7Address>00000000</NS:sampleIPZone7Address></NS:sampleEntry> into doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable"
    Time in seconds for command 'query': 32.5002
    and the query without the updation part takes ~14 sec ( shown below )
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS'; doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//NS:NS//NS:sampleTable"
    Time in seconds for command 'query': 13.7289
    The query :
    time query "declare namespace foo='MY-SAMPLE';declare namespace NS='NS'; doc('dbxml:/n_b_i_f_c_a_z.dbxml/doc_Running-SAMPLE')//PMB:sampleTable/PMB:sampleEntry[@mySSIAddress='1000']"
    Time in seconds for command 'query': 0.005375
    is very fast.
    The Updation of the document seems to consume much of the time.
    Regards,
    Kapil.

  • Insert Query - Logic?

    Table Name : WLCustAct_Emp
    Structure and data
    CustLifeNo WLActCatId WLDayId WeekNo WLEmpTypeId
    330374 FRI 1
    330374 FRI 1 C
    330374 M FRI 1
    330374 M FRI 1
    330374 M FRI 1 C
    330374 FRI 1
    330374 FRI 1
    330374 FRI 1 C
    330374 FRI 1
    330374 D MON 1
    330374 M MON 1
    330374 M MON 1
    330374 D MON 1 C
    330374 MON 1
    330374 MON 1 C
    330374 MON 1
    330374 M MON 1 C
    330374 D MON 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SAT 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 SUN 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 THU 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 TUE 1
    330374 M WED 1
    330374 O WED 1
    330374 O WED 1 C
    330374 O WED 1
    330374 WED 1
    330374 WED 1 C
    330374 WED 1
    330374 M WED 1
    330374 M WED 1 C
    Table WLCust_Denormalized :
    CustLifeNo,
    WeekNo,
    MON_Act_M,
    MON_Act_O
    MON_Act_D
    MON_Emp_C
    MON_Emp_F
    MON_Emp_P
    TUE_Act_M
    TUE_Act_O
    TUE_Act_D
    TUE_Emp_C
    TUE_Emp_F
    TUE_Emp_P
    WED_Act_M
    WED_Act_O
    WED_Act_D
    WED_Emp_C
    WED_Emp_F
    WED_Emp_P
    THU_Act_M
    THU_Act_O
    THU_Act_D
    THU_Emp_C
    THU_Emp_F
    THU_Emp_P
    FRI_Act_M
    FRI_Act_O
    FRI_Act_D
    FRI_Emp_C
    FRI_Emp_F
    FRI_Emp_P
    SAT_Act_M
    SAT_Act_O
    SAT_Act_D
    SAT_Emp_C
    SAT_Emp_F
    SAT_Emp_P
    SUN_Act_M
    SUN_Act_O
    SUN_Act_D
    SUN_Emp_C
    SUN_Emp_F
    SUN_Emp_P
    I want to insert recrods from In tblWLCust_Denormalized table from WLCustAct_Emp table
    More in detail M,O,D Value belogs to Act, And C,F,P value Belongs to Emp
    After Insert query Table WLCust_Denormalized will have only one record..
    CustLifeNo -- 330374
    WeekNo -- 1
    MON_Act_M -- M
    MON_Act_O -- O
    MON_Act_D -- D
    MON_Emp_C -- C
    MON_Emp_F -- NULL
    MON_Emp_P -- NULL
    and so...on...
    Any help really appriciate...
    Thx
    AD

    You Can do like this ....
    insert into WLCust_Denormalized
    select distinct CustLifeNo,WeekNo,decode(count(distinct MON_Act_M),1,'M'),
    decode(count(distinct MON_Act_O),1,'O'),................... from
    (select CustLifeNo,WeekNo,decode(WLActCatId,'M','M') MON_Act_M,
    decode(WLActCatId,'O','O') MON_Act_O, ............. from WLCustAct_Emp)
    Regards,
    Santosh

  • Insert query to editbox

    Dear All,
                 how to insert query to editbox
    Regards,
    Rajkumar

    Hi RaJkumar
    Make Simple SQL Query using Query Generator under Menu Tools>Quries>Query Generator.
    Save Under Spcific Category using Query Manager
    Apply FMS to edit Text box using AltShiftF2 and select that developed query.
    Check Result using Shift+F2
    Regards,
    Bhavank

  • Insert query using fn-bea:execute-sql() function

    Hi ,
    How to use sql insert query in Xquery function fn-bea:execute-sql().
    Could you please anyone help me on this.
    Regards
    Rajesh.

    Hi
    Can i use stored procedure in that function to include insert query?
    could you please suggest me on this.
    Please provide some links or tutorial on that.
    Regards
    Rajesh

  • Insert query waiting for in-definite time.

    Hi all,
    I had a serious problem in my system.
    My application gets stuck when trying to insert a huge xml message in a table blob. Usually there is no problem, the insert query goes into wait state just around or after the gather stats running on this table ends.
    The table is partitioned one and around 150Gb in size.
    I have seen in toad the wait event for this insert query is SQL* net more data from client.
    This might be something related to RBS usage of this stuck insert query - in toad the RBS usage start time is same as the end time of gather stats.
    But i m unable to figure out why the insert is stuck just after the gather stats ends, i have simulated this issue many times. My oracle version is 9.0.8.
    Could somebody help to figure out why this is happening...?

    My oracle version is 9.0.8.I doubt this is correct.
    Post Operating System (OS) name & version for DB server system.
    Post results of SELECT * from v$version.
    Now CUT the commands & results & PASTE (post) them back here.
    ALTER SESSION SET SQL_TRACE=TRUE;
    -- invoke the problem SQL here
    ALTER SESSION SET SQL_TRACE=FALSE;
    now find the trace file within ./udump folder
    tkprof <trace_file.trc> trace_results.txt explain=<username>/<password>
    post the contents of trace_results.txt back here
    when application "gets stuck" run the following SQL from different session
    SELECT DECODE(request,0,'Holder: ','Waiter: ')||sid sess,
    id1, id2, lmode, request, type
    FROM V$LOCK
    WHERE (id1, id2, type) IN
    (SELECT id1, id2, type FROM V$LOCK WHERE request>0)
    ORDER BY id1, request
    /

Maybe you are looking for

  • HT2954 How to search the content in Mac mail system?

    I receive a lot of emails each day, some of the are dumped in the inbox. It is natural to search them later by typing some keywords. But the search engine performance is very bad compared to the the one of Gmail. I typed the same words, Mac mail show

  • Error in IDoc to file

    hello all....... i m doing a idoc to file scenario..and everything is going fine but the problem is::-- while the IDoc is generated and in integartion server it is getting posted under as some other message type which is not the one i used in the sce

  • Jsf datatable component + java.sql.SQLException

    I get the following error when implementing a JSF DataTable component using JDeveloper 10.1.3.1. javax.faces.FacesException: java.sql.SQLException: Io exception: Socket closed I am able to follow the article in this link: http://www.oracle.com/techno

  • How do I add mobile package to my subscription

    I bought unlimited world subscription, but it doesn't cover my calls to mobile number to England. Is there any way I can add the unlimited mobile calling to my subscription? Please let me know ASAP, thanks a bunch!

  • Data Format for a Column

    Hi Experts, I have a requirement where in I have to show my data for a column in the following way i.e into 3 different rows. Column Navigate to; Value of A=10; Value of B=20; Now I have the Column holding the values in two rows. Column Navigate to;V