DDL and INSERT scripts of EMPLOYEES, DEPARTMENTS, LOCATIONS, etc.

Hi all,
(Where) Can I have DDL and INSERT scripts of tables
EMPLOYEES, DEPARTMENTS, LOCATIONS, JOB_HISTORY, JOBS, REGIONS,
and
EMP and DEPT tables?
I could find only descriptions of the tables in http://download.oracle.com/docs/cd/B28359_01/server.111/b28328/scripts.htm#insertedID3, not the complete DDL and INSERT scripts. Please help.

Hi,
The scripts (and other files) are on the companion CD. You can download it from www.oracle.com .
Bartek

Similar Messages

  • Script for parsing xml data and inserting in DB

    Thank you for reading.
    I have the following example XML in an XML file. I need to write a script that can insert this data into an Oracle table. The table does not have primary keys. The data just needs to be inserted.
    I do not have xsd file in this scenario. Please suggest how to modify Method 1 https://community.oracle.com/thread/1115266?tstart=0 mentioned so that I can call the XML mentioned below and insert into a table
    Method 1
    Create or replace procedure parse_xml is 
      l_bfile   BFILE; 
      l_clob    CLOB; 
      l_parser  dbms_xmlparser.Parser; 
      l_doc     dbms_xmldom.DOMDocument; 
      l_nl      dbms_xmldom.DOMNodeList; 
      l_n       dbms_xmldom.DOMNode; 
      l_file      dbms_xmldom.DOMNodeList; 
      l_filen       dbms_xmldom.DOMNode; 
      lv_value VARCHAR2(1000); 
       l_ch      dbms_xmldom.DOMNode; 
    l_partname varchar2(100); 
    l_filename varchar2(1000); 
      l_temp    VARCHAR2(1000); 
      TYPE tab_type IS TABLE OF tab_software_parts%ROWTYPE; 
      t_tab  tab_type := tab_type(); 
    BEGIN 
      l_bfile := BFileName('DIR1', 'SoftwareParts.xml'); 
      dbms_lob.createtemporary(l_clob, cache=>FALSE); 
      dbms_lob.open(l_bfile, dbms_lob.lob_readonly); 
      dbms_lob.loadFromFile(dest_lob => l_clob,    src_lob  => l_bfile,    amount   => dbms_lob.getLength(l_bfile)); 
      dbms_lob.close(l_bfile);  
      dbms_session.set_nls('NLS_DATE_FORMAT','''DD-MON-YYYY'''); 
      l_parser := dbms_xmlparser.newParser; 
      dbms_xmlparser.parseClob(l_parser, l_clob); 
      l_doc := dbms_xmlparser.getDocument(l_parser); 
        dbms_lob.freetemporary(l_clob); 
      dbms_xmlparser.freeParser(l_parser); 
      l_nl := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'/PartDetails/Part'); 
        FOR cur_emp IN 0 .. dbms_xmldom.getLength(l_nl) - 1 LOOP 
        l_n := dbms_xmldom.item(l_nl, cur_emp); 
        t_tab.extend; 
        dbms_xslprocessor.valueOf(l_n,'Name/text()',l_partname); 
        t_tab(t_tab.last).partname := l_partname; 
        l_file := dbms_xslprocessor.selectNodes(l_n,'Files/FileName'); 
        FOR cur_ch IN 0 .. dbms_xmldom.getLength(l_file) - 1 LOOP 
          l_ch := dbms_xmldom.item(l_file, cur_ch); 
          lv_value := dbms_xmldom.getnodevalue(dbms_xmldom.getfirstchild(l_ch)); 
          if t_tab(t_tab.last).partname is null then t_tab(t_tab.last).partname := l_partname; end if; 
          t_tab(t_tab.last).filename := lv_value; 
        t_tab.extend; 
       END LOOP; 
       END LOOP; 
        t_tab.delete(t_tab.last); 
      FOR cur_emp IN t_tab.first .. t_tab.last LOOP 
      if t_tab(cur_emp).partname is not null and  t_tab(cur_emp).filename is not null then 
        INSERT INTO tab_software_parts 
        VALUES 
        (t_tab(cur_emp).partname, t_tab(cur_emp).filename); 
        end if; 
      END LOOP; 
      COMMIT; 
      dbms_xmldom.freeDocument(l_doc); 
    EXCEPTION 
      WHEN OTHERS THEN 
        dbms_lob.freetemporary(l_clob); 
        dbms_xmlparser.freeParser(l_parser); 
        dbms_xmldom.freeDocument(l_doc); 
    END; 
    <TWObject className="TWObject">
      <array size="240">
        <item>
          <variable type="QuestionDetail">
            <questionId type="String"><![CDATA[30]]></questionId>
            <questionType type="questionType"><![CDATA[COUNTRY]]></questionType>
            <country type="String"><![CDATA[GB]]></country>
            <questionText type="String"><![CDATA[Please indicate]]></questionText>
            <optionType type="String"><![CDATA[RadioButton]]></optionType>
            <answerOptions type="String[]">
              <item><![CDATA[Yes]]></item>
              <item><![CDATA[No]]></item>
            </answerOptions>
            <ruleId type="String"><![CDATA[CRP_GB001]]></ruleId>
            <parentQuestionId type="String"></parentQuestionId>
            <parentQuestionResp type="String"></parentQuestionResp>
          </variable>
        </item>
        <item>
          <variable type="QuestionDetail">
            <questionId type="String"><![CDATA[40]]></questionId>
            <questionType type="questionType"><![CDATA[COUNTRY]]></questionType>
            <country type="String"><![CDATA[DE]]></country>
            <questionText type="String"><![CDATA[Please indicate]]></questionText>
            <optionType type="String"><![CDATA[RadioButton]]></optionType>
            <answerOptions type="String[]">
              <item><![CDATA[Yes]]></item>
              <item><![CDATA[No]]></item>
            </answerOptions>
            <ruleId type="String"><![CDATA[CRP_Q0001]]></ruleId>
            <parentQuestionId type="String"></parentQuestionId>
            <parentQuestionResp type="String"></parentQuestionResp>
          </variable>
        </item>
      </array>
    </TWObject>

    Reposted as
    Script to parse XML data into Oracle DB

  • SQL Dev 1.5.4+: Scripting DDL and data dumps?

    In SQL Dev 1.5.4, can I script a DDL and data dump? If not, what about 2.0? If not 2.0, has anyone requested this functionality so I can vote for it? I find it frustrating that, while doing a Database Export, I can't even pre-declare (e.g. save) the set of objects I want to dump; sometimes, you want to selectively dump, and it's a pain to hunt and peck and select just those you want to dump. Easy if you want to dump everything but 2-3 objects in a large schema. Not so easy if you only need, say, 20 out of 100 objects to be dumped (e.g. for domain or configuration tables--some subset of the whole schema).
    I'm really enjoying SQL Developer 1.5.4 by the way. Despite it's flaws, I'm pretty happy with it. Looking forward to 2.0 and beyond. Good work SQL Dev team.
    Thanks very much.
    Dana

    They're all command line tools, so they can all be wrapped up in a batch or shell script. Bummer you can't access them... Hope you find a better solutionThanks K. I should be getting Oracle 10g Express Edition on my desktop soon--critical because we don't have full access to the Development instance. It's like putting changes through a straw over to the DBAs. I'm not sure why Development is locked-down to developers, but that's the way it is.
    Any chance that Oracle 10g Express Edition comes with scriptable data pump binaries? Will still need authorization, but maybe that's one way to go. I hate trying to write my own Data Pump in Python or any other language. It's seems a bit absurd to me but I suppose there are reasons.
    Dana

  • Network location and apple script

    Hi,
    I have a strange problem... When I try to use this AppleScript to change network location in Leopard, nothing happens:
    tell application "System Events"
    tell network preferences
    get properties
    --> returns: {current location:location id "51BD3FB7-50D1-4859-9649-9138E7FF1ECA" of network preferences, class:network preferences object}
    get the name of every location
    --> returns: {"Automatic", "Sprint Card"}
    set current location to location "Automatic"
    end tell
    end tell
    This is copy-pasted from <http://www.apple.com/applescript/features/system-prefs.html>. I have 3 locations set: home, office and Automatic. I'm currently using home, and this script just silently fails to set the location to Automatic... Any thoughts/hints?

    That works, thanks!
    I'm still wondering why "pure" AppleScript solution proposed by Apple is not working?

  • OS UDM's and Corrective action Script at a central Location

    Is that we can place the OS UDM's and Corrective action Script are to be placed at Target server side or can we place these scripts at a central location say on OMS/ OMR server and trigger from here. As if we change a particular script we need to propagate particular script to all location. Instead if we keep these at a central place we can replace that particular script at a single location.
    Please advise.
    Thanks.

    When creating an UDM, you need to create this for a specific Target like a database instance or host
    This means, when you want to create a SQL based UDM, you first need to select a database in OEM and next select the User Defined Metrics link that will allow you to create the UDM.
    After finishing the creation of a UDM, the UDM will be "owned" by the database you selected in OEM.
    This means, when having 50 databases, you are able to create several UDM's spread over all of these databases. This is a situations you don't want to get into. You most probably will want to reuse UDM on several or even all databases.
    To avoid UDM getting duplicated, being spread all over the pace you actually need a "library" where you would be able to locate the UDM's.
    Unfortunately there is not such a library in OEM. However if you decide to choose one of your databases for playing the role of a "library" at least you found a way to centrally locate all your UDM's.
    If you then want to apply one or more UDM's to several database you could create a monitoring template, include the UDM's you want to reuse on other databases and apply this template.

  • Confusion with Template Div and insertion of text

    Here's my problem: When editing my template, when inserting text into the center div box (The main one, center column), the text defaults to italics, or it is inserted, indented and bold. I want it to be normal default font, without indentation so I can have all pages be identical. Here is the code and a link, please help:
    Link: http://www.u.arizona.edu/~jkimbro/about.html
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- TemplateBeginEditable name="doctitle" -->
    <title>Untitled Document</title>
    <!-- TemplateEndEditable -->
    <link href="../oneColLiqCtr.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    #apDiv1 {
        position:absolute;
        width:80%;
        height:27px;
        z-index:1;
        background-color: #000;
        top: 0px;
        color: #FFF;
    #apDiv3 {
        position:absolute;
        width:80%;
        height:19px;
        z-index:2;
        background-color: #D3D3D3;
        top: 27px;
    #apDiv4 {
        position:absolute;
        width:80%;
        height:204px;
        z-index:3;
        background-color: #CCC;
        top: 49px;
    #apDiv5 {
        position:absolute;
        width:80%;
        height:34px;
        z-index:4;
        background-color: #FFF;
        top: 252px;
    </style>
    <script src="../SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="../SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    #apDiv6 {
        position:absolute;
        width:200px;
        height:115px;
        z-index:5;
        background-color: #066;
        top: 292px;
        left: 654px;
        padding-right: 0px;
    #apDiv7 {
        position:absolute;
        width:80%;
        height:80%;
        z-index:5;
        background-color: #069;
        top: 293px;
        margin-top: -9px;
        color: #333;
    #apDiv11 {
        position:absolute;
        width:978px;
        height:62px;
        z-index:0;
        background-color: #FFF;
        top: 299px;
        margin-top: -3px;
        color: #000;
        left: 158px;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
        border-bottom-left-radius: 10px
    #apDiv13 {
        position:absolute;
        width:54%;
        height:913px;
        z-index:5;
        background-color: #FFF;
        border-top-left-radius: 15px;
        border-top-right-radius: 15px;
        border-bottom-right-radius: 15px;
        border-bottom-left-radius: 15px;
        left: 259px;
        top: 474px;
        color: #000;
    </style>
    <!-- TemplateBeginEditable name="head" -->
    <!-- TemplateEndEditable -->
    <script type="text/javascript">
    function MM_scanStyles(obj, prop) { //v9.0
      var inlineStyle = null; var ccProp = prop; var dash = ccProp.indexOf("-");
      while (dash != -1){ccProp = ccProp.substring(0, dash) + ccProp.substring(dash+1,dash+2).toUpperCase() + ccProp.substring(dash+2); dash = ccProp.indexOf("-");}
      inlineStyle = eval("obj.style." + ccProp);
      if(inlineStyle) return inlineStyle;
      var ss = document.styleSheets;
      for (var x = 0; x < ss.length; x++) { var rules = ss[x].cssRules;
        for (var y = 0; y < rules.length; y++) { var z = rules[y].style;
          if(z[prop] && (rules[y].selectorText == '*[ID"' + obj.id + '"]' || rules[y].selectorText == '#' + obj.id)) {
            return z[prop];
      }  }  }  return "";
    function MM_getProp(obj, prop) { //v8.0
      if (!obj) return ("");
      if (prop == "L") return obj.offsetLeft;
      else if (prop == "T") return obj.offsetTop;
      else if (prop == "W") return obj.offsetWidth;
      else if (prop == "H") return obj.offsetHeight;
      else {
        if (typeof(window.getComputedStyle) == "undefined") {
            if (typeof(obj.currentStyle) == "undefined"){
                if (prop == "P") return MM_scanStyles(obj,"position");
            else if (prop == "Z") return MM_scanStyles(obj,"z-index");
            else if (prop == "V") return MM_scanStyles(obj,"visibility");
            } else {
              if (prop == "P") return obj.currentStyle.position;
            else if (prop == "Z") return obj.currentStyle.zIndex;
            else if (prop == "V") return obj.currentStyle.visibility;
        } else {
            if (prop == "P") return window.getComputedStyle(obj,null).getPropertyValue("position");
          else if (prop == "Z") return window.getComputedStyle(obj,null).getPropertyValue("z-index");
          else if (prop == "V") return window.getComputedStyle(obj,null).getPropertyValue("visibility");
    function MM_dragLayer(objId,x,hL,hT,hW,hH,toFront,dropBack,cU,cD,cL,cR,targL,targT,tol,dropJS,et,d ragJS) { //v9.01
      //Copyright 2005-2006 Adobe Macromedia Software LLC and its licensors. All rights reserved.
      var i,j,aLayer,retVal,curDrag=null,curLeft,curTop,IE=document.all;
      var NS=(!IE&&document.getElementById); if (!IE && !NS) return false;
      retVal = true; if(IE && event) event.returnValue = true;
      if (MM_dragLayer.arguments.length > 1) {
        curDrag = document.getElementById(objId); if (!curDrag) return false;
        if (!document.allLayers) { document.allLayers = new Array();
          with (document){ if (NS) { var spns = getElementsByTagName("span"); var all = getElementsByTagName("div");
            for (i=0;i<spns.length;i++) if (MM_getProp(spns[i],'P')) allLayers[allLayers.length]=spns[i];}
            for (i=0;i<all.length;i++) {
                if (MM_getProp(all[i],'P')) allLayers[allLayers.length]=all[i];
        curDrag.MM_dragOk=true; curDrag.MM_targL=targL; curDrag.MM_targT=targT;
        curDrag.MM_tol=Math.pow(tol,2); curDrag.MM_hLeft=hL; curDrag.MM_hTop=hT;
        curDrag.MM_hWidth=hW; curDrag.MM_hHeight=hH; curDrag.MM_toFront=toFront;
        curDrag.MM_dropBack=dropBack; curDrag.MM_dropJS=dropJS;
        curDrag.MM_everyTime=et; curDrag.MM_dragJS=dragJS;
        curDrag.MM_oldZ = MM_getProp(curDrag,'Z');
        curLeft = MM_getProp(curDrag,'L');
        if (String(curLeft)=="NaN") curLeft=0; curDrag.MM_startL = curLeft;
        curTop = MM_getProp(curDrag,'T');
        if (String(curTop)=="NaN") curTop=0; curDrag.MM_startT = curTop;
        curDrag.MM_bL=(cL<0)?null:curLeft-cL; curDrag.MM_bT=(cU<0)?null:curTop-cU;
        curDrag.MM_bR=(cR<0)?null:curLeft+cR; curDrag.MM_bB=(cD<0)?null:curTop+cD;
        curDrag.MM_LEFTRIGHT=0; curDrag.MM_UPDOWN=0; curDrag.MM_SNAPPED=false; //use in your JS!
        document.onmousedown = MM_dragLayer; document.onmouseup = MM_dragLayer;
        if (NS) document.captureEvents(Event.MOUSEDOWN|Event.MOUSEUP);
        } else {
        var theEvent = ((NS)?objId.type:event.type);
        if (theEvent == 'mousedown') {
          var mouseX = (NS)?objId.pageX : event.clientX + document.body.scrollLeft;
          var mouseY = (NS)?objId.pageY : event.clientY + document.body.scrollTop;
          var maxDragZ=null; document.MM_maxZ = 0;
          for (i=0; i<document.allLayers.length; i++) { aLayer = document.allLayers[i];
            var aLayerZ = MM_getProp(aLayer,'Z');
            if (aLayerZ > document.MM_maxZ) document.MM_maxZ = aLayerZ;
            var isVisible = (MM_getProp(aLayer,'V')).indexOf('hid') == -1;
            if (aLayer.MM_dragOk != null && isVisible) with (aLayer) {
              var parentL=0; var parentT=0;
              if (NS) { parentLayer = aLayer.parentNode;
                while (parentLayer != null && parentLayer != document && MM_getProp(parentLayer,'P')) {
                  parentL += parseInt(MM_getProp(parentLayer,'L')); parentT += parseInt(MM_getProp(parentLayer,'T'));
                  parentLayer = parentLayer.parentNode;
                  if (parentLayer==document) parentLayer = null;
              } } else if (IE) { parentLayer = aLayer.parentElement;      
                while (parentLayer != null && MM_getProp(parentLayer,'P')) {
                  parentL += MM_getProp(parentLayer,'L'); parentT += MM_getProp(parentLayer,'T');
                  parentLayer = parentLayer.parentElement; } }
              var tmpX=mouseX-((MM_getProp(aLayer,'L'))+parentL+MM_hLeft);
              var tmpY=mouseY-((MM_getProp(aLayer,'T'))+parentT+MM_hTop);
              if (String(tmpX)=="NaN") tmpX=0; if (String(tmpY)=="NaN") tmpY=0;
              var tmpW = MM_hWidth;  if (tmpW <= 0) tmpW += MM_getProp(aLayer,'W');
              var tmpH = MM_hHeight; if (tmpH <= 0) tmpH += MM_getProp(aLayer,'H');
              if ((0 <= tmpX && tmpX < tmpW && 0 <= tmpY && tmpY < tmpH) && (maxDragZ == null
                  || maxDragZ <= aLayerZ)) { curDrag = aLayer; maxDragZ = aLayerZ; } } }
          if (curDrag) {
            document.onmousemove = MM_dragLayer;
            curLeft = MM_getProp(curDrag,'L');
            curTop = MM_getProp(curDrag,'T');
            if (String(curLeft)=="NaN") curLeft=0; if (String(curTop)=="NaN") curTop=0;
            MM_oldX = mouseX - curLeft; MM_oldY = mouseY - curTop;
            document.MM_curDrag = curDrag;  curDrag.MM_SNAPPED=false;
            if(curDrag.MM_toFront) {
              var newZ = parseInt(document.MM_maxZ)+1;
              eval('curDrag.'+('style.')+'zIndex=newZ');
              if (!curDrag.MM_dropBack) document.MM_maxZ++; }
            retVal = false; if(!NS) event.returnValue = false;
        } } else if (theEvent == 'mousemove') {
          if (document.MM_curDrag) with (document.MM_curDrag) {
            var mouseX = (NS)?objId.pageX : event.clientX + document.body.scrollLeft;
            var mouseY = (NS)?objId.pageY : event.clientY + document.body.scrollTop;
            var newLeft = mouseX-MM_oldX; var newTop  = mouseY-MM_oldY;
            if (MM_bL!=null) newLeft = Math.max(newLeft,MM_bL);
            if (MM_bR!=null) newLeft = Math.min(newLeft,MM_bR);
            if (MM_bT!=null) newTop  = Math.max(newTop ,MM_bT);
            if (MM_bB!=null) newTop  = Math.min(newTop ,MM_bB);
            MM_LEFTRIGHT = newLeft-MM_startL; MM_UPDOWN = newTop-MM_startT;
            if (NS){style.left = newLeft + "px"; style.top = newTop + "px";}
            else {style.pixelLeft = newLeft; style.pixelTop = newTop;}
            if (MM_dragJS) eval(MM_dragJS);
            retVal = false; if(!NS) event.returnValue = false;
        } } else if (theEvent == 'mouseup') {
          document.onmousemove = null;
          if (NS) document.releaseEvents(Event.MOUSEMOVE);
          if (NS) document.captureEvents(Event.MOUSEDOWN); //for mac NS
          if (document.MM_curDrag) with (document.MM_curDrag) {
            if (typeof MM_targL =='number' && typeof MM_targT == 'number' &&
                (Math.pow(MM_targL-(MM_getProp(document.MM_curDrag,'L')),2)+
                 Math.pow(MM_targT-(MM_getProp(document.MM_curDrag,'T')),2))<=MM_tol) {
              if (NS) {style.left = MM_targL + "px"; style.top = MM_targT + "px";}
              else {style.pixelLeft = MM_targL; style.pixelTop = MM_targT;}
              MM_SNAPPED = true; MM_LEFTRIGHT = MM_startL-MM_targL; MM_UPDOWN = MM_startT-MM_targT; }
            if (MM_everyTime || MM_SNAPPED) eval(MM_dropJS);
            if(MM_dropBack) {style.zIndex = MM_oldZ;}
            retVal = false; if(!NS) event.returnValue = false; }
          document.MM_curDrag = null;
        if (NS) document.routeEvent(objId);
      } return retVal;
    </script>
    <link href="../MasterStyleSheet.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
    #apDiv8 {
        position:absolute;
        width:200px;
        height:41px;
        z-index:6;
        top: 311px;
    #apDiv10 {
        position:absolute;
        width:200px;
        height:115px;
        z-index:6;
    #apDiv14 {
        position:absolute;
        width:200px;
        height:115px;
        z-index:6;
    #apDiv15 {
        position:absolute;
        width:200px;
        height:57px;
        z-index:6;
        top: 287px;
        border-top-left-radius: 10px;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
        border-bottom-left-radius: 10px
    </style>
    </head>
    <body onload="MM_dragLayer('apDiv1','',0,0,0,0,true,false,-1,-1,-1,-1,0,0,50,'',false,'')">
    <div id="apDiv2"></div>
    <div class="container">
      <div class="content">
        <div id="apDiv1">  <a href="../index.html" class="nonitalics">Home</a>| <a href="../Contact.html" class="nonitalics">Contact me</a> | <a href="../about.html" class="nonitalics">About me</a> | <a href="../Site.html" class="nonitalics">Site Map</a></div>
        <div id="apDiv3"></div>
        <p> </p>
        <div id="apDiv4"><img src="../images/SplicedPhwMed700x200.jpg" width="99%" height="100%" alt="ADD_ADHD" /></div>
        <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <!-- TemplateBeginEditable name="EditRegion5" -->
    <div id="apDiv15"></div>
    <!-- TemplateEndEditable -->
    <p> </p>
    <p> </p>
            <p> </p>
        <p> </p>
            <!-- TemplateBeginEditable name="EditRegion4" -->
            <div class="boldborders" id="apDiv13">fffffff</div>
        <!-- TemplateEndEditable -->
            <p> </p>
    <h2> </h2>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p> </p>
    <p>  </p>
        <div id="apDiv5">
          <ul id="MenuBar1" class="MenuBarHorizontal">
            <li><a class="MenuBarItemSubmenu" href="../anno.html">Annotations</a>
              <ul>
                <li><a href="#">Item 1.1</a></li>
                <li><a href="#">Item 1.2</a></li>
                <li><a href="#">Item 1.3</a></li>
              </ul>
            </li>
            <li><a href="../discussions.html" class="nonitalics">Discussions</a></li>
            <li><a href="../Meds.html" class="nonitalics">Medications</a></li>
            <li><a class="MenuBarItemSubmenu" href="../Stats.html">Statistics</a>
              <ul>
                <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
                  <ul>
                    <li><a href="#">Item 3.1.1</a></li>
                    <li><a href="#">Item 3.1.2</a></li>
                  </ul>
                </li>
                <li><a href="#">Item 3.2</a></li>
                <li><a href="#">Item 3.3</a></li>
              </ul>
            </li>
            <li><a href="../sucess.html" class="nonitalics"> Successes</a></li>
          </ul>
        </div>
    <p> </p>
    <p> </p>
    <p> </p>
      <!-- end .content --></div>
      <div class="footer">
        <p>Copyright (c) 2011, All rights reserved</p>
        <!-- end .footer --></div>
    <!-- end .container --></div>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>

    What version of DW are you using?
    Are you aware of the problems that will fall in your lap with pages built using the methods you have used (AP divs for layout and multiple empty <p> tags to locate content on the page)?  Also, given this layout, it's not easy to tell which div you are referring to - I assume div#content.  Is that correct?
    Please give us an example of what you are entering and where you are entering it.  And tell us exactly what you see when you enter that content.

  • Form Email and Insert to DB

    I'm trying to get a form both - email and insert into a database the form information.  Below, you can see the code I am using.
    Here is my setup:
    1. I have a form where the action is a file called formmail.php
    2. This file inserts the data into a database and then includes another file called phpmail.php
    3. phpmail.php first looks in a file called zipcodes.php where I've set a number of arrays for various possible zipcodes.
    4. phpmail.php then emails the form data to the email addresses associated with those zipcodes.
    Without the formmail.php step - it works perfectly.
    With the formmail.php step - it inserts it into a database, checks if the email address is formatted correctly, but does not email anyone.
    Do you know why?   Below is the code for the various files:
    formail.php
    <?php
    $con = mysql_connect("localhost","user","password");
    if (!$con)
    die('Could not connect: ' . mysql_error());
    mysql_select_db("phtsystem", $con);
    $sql="INSERT INTO leads (firstname, lastname, address, city, `state`, zip, phone, email, comments, reason) VALUES ('$_POST[name2]','$_POST[last_name]','$_POST[address]','$_POST[city]','$_POST[state]','$_POST[zip]','$_POST[phone2]','$_POST[email]','$_POST[comments]','$_POST[reason]')";
    if (!mysql_query($sql,$con))
    die('Error: ' . mysql_error());
    include "phpmail.php";
    ?>
    phpmail.php
    <?php
    include("zipcodes.php");
    $zip=$_POST["zip"];
              if (in_array($zip, $Nashville)) {
    $my_email = "[email protected], [email protected], [email protected], [email protected]";
              }elseif (in_array($zip, $Knoxville)) {
    $my_email = "[email protected], [email protected], [email protected], [email protected]";
              }elseif (in_array($zip, $Huntsville)) {
    $my_email = "[email protected], [email protected], [email protected], [email protected]";
              }elseif (in_array($zip, $Florida)) {
    $my_email = "[email protected], [email protected], [email protected], [email protected]";
              }elseif (in_array($zip, $Georgia)) {
    $my_email = "[email protected], [email protected], [email protected], [email protected]";
              }elseif (in_array($zip, $SouthCarolina)) {
    $my_email = "[email protected], [email protected], [email protected], [email protected]";
              }elseif (in_array($zip, $NorthCarolina)) {
    $my_email = "[email protected], [email protected], [email protected], [email protected]";
              }elseif (in_array($zip, $Pennsylvania)) {
    $my_email = "[email protected], [email protected], [email protected]";
              }elseif (in_array($zip, $Maryland)) {
    $my_email = "[email protected], [email protected], [email protected], [email protected]";
               }elseif (in_array($zip, $Virginia)) {
    $my_email = "[email protected], [email protected], [email protected], [email protected]";
               }elseif (in_array($zip, $Texas)) {
    $my_email = "[email protected], [email protected], [email protected]";
    } else { $my_email = "[email protected], [email protected], [email protected]";
    $continue = "/";
    $errors = array();
    if(count($_COOKIE)){foreach(array_keys($_COOKIE) as $value){unset($_REQUEST[$value]);}}
    function recursive_array_check_header($element_value)
    global $set;
    if(!is_array($element_value)){if(preg_match("/(%0A|%0D|\n+|\r+)(content-type:|to:|cc:|bcc:)/i",$element_value)){$set = 1;}}
    else
    foreach($element_value as $value){if($set){break;} recursive_array_check_header($value);}
    recursive_array_check_header($_REQUEST);
    if($set){$errors[] = "You cannot send an email header";}
    unset($set);
    if(isset($_REQUEST['email']) && !empty($_REQUEST['email']))
    if(preg_match("/(%0A|%0D|\n+|\r+|:)/i",$_REQUEST['email'])){$errors[] = "Email address may not contain a new line or a colon";}
    $_REQUEST['email'] = trim($_REQUEST['email']);
    if(substr_count($_REQUEST['email'],"@") != 1 || stristr($_REQUEST['email']," ")){$errors[] = "Email address is invalid";}else{$exploded_email = explode("@",$_REQUEST['email']);if(empty($exploded_email[0]) || strlen($exploded_email[0]) > 64 || empty($exploded_email[1])){$errors[] = "Email address is invalid";}else{if(substr_count($exploded_email[1],".") == 0){$errors[] = "Email address is invalid";}else{$exploded_domain = explode(".",$exploded_email[1]);if(in_array("",$exploded_domain)){$errors[] = "Email address is invalid";}else{foreach($exploded_domain as $value){if(strlen($value) > 63 || !preg_match('/^[a-z0-9-]+$/i',$value)){$errors[] = "Email address is invalid"; break;}}}}}}
    if(!(isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER']) && stristr($_SERVER['HTTP_REFERER'],$_SERVER['HTTP_HOST']))){$errors[] = "You must enable referrer logging to use the form";}
    function recursive_array_check_blank($element_value)
    global $set;
    if(!is_array($element_value)){if(!empty($element_value)){$set = 1;}}
    else
    foreach($element_value as $value){if($set){break;} recursive_array_check_blank($value);}
    recursive_array_check_blank($_REQUEST);
    if(!$set){$errors[] = "You cannot send a blank form";}
    unset($set);
    if(count($errors)){foreach($errors as $value){print "$value<br>";} exit;}
    if(!defined("PHP_EOL")){define("PHP_EOL", strtoupper(substr(PHP_OS,0,3) == "WIN") ? "\r\n" : "\n");}
    function build_message($request_input){if(!isset($message_output)){$message_output ="";}if(!is_array($request_input)){$message_output = $request_input;}else{foreach($request_input as $key => $value){if(!empty($value)){if(!is_numeric($key)){$message_output .= str_replace("_"," ",ucfirst($key)).": ".build_message($value).PHP_EOL.PHP_EOL;}else{$message_output .= build_message($value).", ";}}}}return rtrim($message_output,", ");}
    $message = build_message($_REQUEST) . "This email is from the website.  If it doesn't say specifically what the person is contacting us about, it is most likely a sales lead.";
    $message = $message . PHP_EOL.PHP_EOL."-- ".PHP_EOL."";
    $message = stripslashes($message);
    $subject = "New Lead from PHT.com";
    $headers = "From: " . $_REQUEST['email'];
    mail($my_email,$subject,$message,$headers);
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Dreamweaver Tutorial - Contact Form</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
      var _gaq = _gaq || [];
      _gaq.push(['_setAccount', 'UA-28969997-1']);
      _gaq.push(['_trackPageview']);
      (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    </script>
    </head>
    <body bgcolor="#ffffff" text="#000000">
    <div>
    <center>
    <b>Thank you <?php print stripslashes($_REQUEST['name']); ?></b>
    <br>Your message has been sent
    <p><a href="<?php print $continue; ?>">Click here to continue</a></p>
    </center>
    </div>
    </body>
    </html>
    zipcodes.php
    <?php
    $Nashville = array (37010, 37027, 37040, 37055, 37067, 37075, 37088, 37121, 37133, 37152, 37179, 37201, 37209, 37217, 37228, 37238, 37246, 37015, 37034, 37048, 37063, 37071, 37082, 37115, 37129, 37141, 37167, 37186, 37205, 37213, 37221, 37234, 37242, 37250, 38487, 37011, 37029, 37041, 37056, 37068, 37076, 37089, 37122, 37135, 37153, 37180, 37202, 37210, 37218, 37229, 37239, 37247, 37022, 37035, 37049, 37064, 37072, 37085, 37116, 37130, 37143, 37171, 37187, 37206, 37214, 37222, 37235, 37243, 38401, 37013, 37031, 37043, 37060, 37069, 37077, 37090, 37127, 37136, 37155, 37181, 37203, 37211, 37219, 37230, 37240, 37248, 37024, 37036, 37051, 37065, 37073, 37086, 37118, 37131, 37146, 37172, 37188, 37207, 37215, 37224, 37236, 37244, 38476, 37014, 37032, 37046, 37062, 37070, 37080, 37098, 37128, 37138, 37165, 37184, 37204, 37212, 37220, 37232, 37241, 37249, 37025, 37037, 37052, 37066, 37074, 37087, 37119, 37132, 37148, 37174, 37189, 37208, 37216, 37227, 37237, 37245, 38482);
    ?>
    <?php
    $Knoxville=array(37354, 37709, 37717, 37726, 37737, 37755, 37763, 37770, 37777, 37803, 37819, 37830, 37842, 37849, 37865, 37874, 37886, 37901, 37914, 37918, 37922, 37928, 37932, 37940, 37996, 38504, 37381, 37710, 37719, 37729, 37742, 37756, 37764, 37771, 37779, 37804, 37826, 37831, 37845, 37852, 37866, 37878, 37887, 37902, 37915, 37919, 37923, 37929, 37933, 37950, 37997, 38557, 37701, 37714, 37721, 37732, 37748, 37757, 37766, 37772, 37801, 37806, 37828, 37840, 37846, 37853, 37871, 37882, 37892, 37909, 37916, 37920, 37924, 37930, 37938, 37990, 37998, 38558, 37705, 37716, 37723, 37733, 37754, 37762, 37769, 37774, 37802, 37807, 37829, 37841, 37847, 37854, 37872, 37885, 37893, 37912, 37917, 37921, 37927, 37931, 37939, 37995, 37999);
    ?>
    etc...
    Message was edited by: Drymetal

    Scratch that.  It does work perfectly.   It just took the stupid server 20 minutes to send the emails. 

  • Select records from one database and insert it into another database

    Hi
    I need to write a statement to select records from one database which is on machine 1 and insert these records on a table in another database which is on machine 2. Following is what I did:
    1. I created the following script on machine 2
    sqlplus remedy_intf/test@sptd @load_hrdata.sql
    2. I created the following sql statements in file called load_hrdata.sql:
    rem This script will perform the following steps
    rem 1. Delete previous HR data/table to start w/ clean import tables
    rem 2. Create database link to HR database, and
    rem 3. Create User Data import table taking info from HR
    rem 4. Drop HRP link before exiting
    SET COPYCOMMIT 100
    delete from remedy.remedy_feed;
    commit;
    COPY FROM nav/donnelley@hrp -
    INSERT INTO remedy.remedy_feed -
    (EMPLID, FIRST_NAME, MI, LAST_NAME, BUSINESS_TITLE, WORK_PHONE, -
    RRD_INTRNT_EMAIL, LOCATION, RRD_OFFICE_MAIL, RRD_BUS_UNIT_DESCR) -
    USING SELECT EMPLID, FIRST_NAME, MI, LAST_NAME, BUSINESS_TITLE, WORK_PHONE, -
    RRD_INTRNT_EMAIL, LOCATION, RRD_OFFICE_MAIL, RRD_BUS_UNIT_DESCR -
    FROM ps_rrd_intf_medium -
    where empl_status IN ('A', 'L', 'P', 'S', 'X')
    COMMIT;
    EXIT;
    However, whenever I run the statement I keep getting the following error:
    SP2-0498: missing parenthetical column list or USING keyword
    Do you have any suggestions on how I can fix this or what am I doing wrong?
    Thanks
    Ali

    This doesn't seem to relate to Adobe Reader. Please let us know the product you are using so we may redirect you or refer to the list of forums at http://forums.adobe.com/

  • BUG: Export DDL and Data fails for mixed case table/column names

    Hi there,
    I have found a bug in SQL Developer. See details below.
    Description:
    When "Export DDL and Data) function is used on a table/columns not named in UPPERCASE, sql generated by SQL Developer is invalid.
    Steps to reproduce:
    - open SQL Developer, connect to DB
    - make a table named "lowerCase" (in double quotes, so it won't be automatically changed to capital letters)
    - you may also add some columns, for example "lowerCol1", "UpCol2", ALLUPCOL3
    - add some data rows to the table
    - choose Tools -> Export DDL and Data
    - check exporting of tables and data, on "filter" tabs choose your "lowerCase" table
    - press "Apply"
    Error:
    Generated SQL contains invalid INSERTs: mixed-case table and columns are referenced without obligatory double quotes, which yields an error when generated script is executed (see below, relevant line is underlined)
    -- DDL for Table lowerCase
    CREATE TABLE "DBO_HT"."lowerCase"
    (     "lowerCol1" VARCHAR2(100),
         "UpCol2" VARCHAR2(100),
         "ALLUPCOL3" VARCHAR2(100)
    -- DATA FOR TABLE lowerCase
    -- FILTER = none used
    -- INSERTING into lowerCase
    Insert into lowerCase (lowerCol1,UpCol2,ALLUPCOL3) values ('lc','uc','auc');
    -- END DATA FOR TABLE lowerCase
    Remarks
    SQL Developer: version 1.2.1, build MAIN-32.13
    Oracle DBs: 9.2 & Express
    OS: Windows 2000 Professional
    If you need any more details/testing, let me know. I'd really appreciate a quick patch for this issue...
    Alternatively, do you know of any other simple way of copying a single database (it's called a schema in Oracle, right?) from one computer to another? Possibly something so simple like detaching->copying->reattaching mdf (data) files in SQL Server... I thought that this "Export DDL&Data" function will do, but as you can see I couldn't use it.
    I just need a simple solution that works - one operation on source to stuff, get the resulting files to other computer and one operation to have it running there... I think that such scenario is very basic, yet I just can't achieve it and I am simply not allowed to spend more time on it (read: our test project fails, my company rejects my "lobbying" and stays with MSSQL :/ )
    Thanks a lot & bye

    Thanks for your reply.
    ad. 1)
    You're right. I just wanted to give some very short feedback on my experiences with SQL Developer, so I didn't think starting new threads would be necessary, but as I was writing it became much bigger than I initially planned - sorry about that. I will make proper threads as soon as possible. Having "Edit post" button on this forum would also be useful.
    ad. 2)
    Generally, you're right - in most cases it's true that "switching DBMS is a major commitment" and "you will produce terrible code" if you don't learn the new one.
    However, I think that you miss one part of market here - the market that I think Express is also targeted on. I'd call it a "fire&forget databases" market; MySQL comes to mind as possibly most common solution here. It's the rather small systems, possibly web-accessed, whose data-throughput requirements are rather modest; the point is to store data at all, and not necesarily in fastest way, because given the amount of data that is used, even on low-end hardware it will work well enough. What's important here is its general ease of use - how easy is to set up such system, connect and access data, develop a software using it, how much maintenance is needed, how easy this maintenance is, how easy are the most common development tasks as creating a DB, moving a DB from test to production server etc. There, "how easy" directly translates to "how much time we need to set it up", which translates to "how much will the development will cost".
    Considering the current technology, switching the DBMS in such systems is not necesarily a major commitment and believe me that you will not produce terrible code. In many cases it's as simple as changing a switch in your ORM toolkit: hibernate.dialect = Hibernate.Dialect.OracleDialect vs MySQLDialect vs MsSql2005Dialect
    Therefore, in some part of market it's easy to switch DBMS, even on project-by-project basis. The reason to switch will appear when other DBMS makes life easier => development faster. From that point of view, I can understand my colleagues giving me an embarassing look and saying "come on, I won't read all these docs just to have db copied to test server". And it doesn't mean "they are not willing to learn anything new", it's just that they feel such basic task should have self-explaining solution that doesn't require mastering any special knowledge. And if they get such simple solutions somewhere else, it costs them nothing to change the hibernate dialect.
    I think Oracle did the great job with introducing the Express to this "fire&forget" market. The installation is a snap, it just works out of the box, nothing serious to configure, opposite to what I remember from installing and working on Oracle 9 a few years ago. In some places it's still "you need to start SQL*Plus and enter this script", but it's definitely less than before. I also find the SQL Developer a great tool, it can do most of what we need to do with the DB, it's also much better and pleasant to use over Oracle 9 tools. Still, a few basic things still require too much hassle, and I'd say taking your schema to another machine is one of them. So I think that, if you do it well, the "schema copy wizard" you mentioned might be very helpful. If I was to give any general advice for Express line of DB/tools, I'd say "make things simple" - make it "a DB you can't see".
    That's, IMHO, the way to attract more Express users.

  • HR Schema DDL and DML Statements

    Dear all,
    I want all tables and datas for practicing purpose.(HR Schema)
    In Oracle site where can I get these DDL and DML Statements.
    Can Any one post all statements..
    Thanks in advance.

    Unlocking the Sample Tables
    The Human Resources (HR) Sample Schema is installed as part of the default Oracle Database installation. The HR account is locked by default.
    You need to unlock the HR account before you can use the HR sample schema. To unlock the HR account, log in as the SYSTEM user and enter the following command, where your_password is the password you want to define for the user HR:
    ALTER USER HR IDENTIFIED BY your_password ACCOUNT UNLOCK;
    For further information about unlocking the HR account, see the Oracle Database Sample Schemas guide. The HR user is primarily to enable you to access the HR sample schema and is necessary to enable you to run the examples in this guide.
    Each table in the database is "owned" by a particular user. You may wish to have your own copies of the sample tables to use as you try the examples in this guide. To get your own copies of the HR tables, see your DBA or see the Oracle Database Sample Schemas guide, or you can create the HR tables with the script HR_MAIN.SQL which is located in the following directory on UNIX:
    $ORACLE_HOME/DEMO/SCHEMA/HUMAN_RESOURCES/HR_MAIN.SQL
    And on the following directory on Windows:
    %ORACLE_HOME%\DEMO\SCHEMA\HUMAN_RESOURCES\HR_MAIN.SQL
    To create the HR tables from command-line SQL*Plus, do the following:
    1.
    Ask your DBA for your Oracle Database account username and password.
    2.
    Login to SQL*Plus.
    3.
    On UNIX, enter the following command at the SQL*Plus prompt:
    SQL> @?/DEMO/SCHEMA/HUMAN_RESOURCES/HR_MAIN.SQL
    On Windows, enter the following command at the SQL*Plus prompt:
    SQL> @?\DEMO\SCHEMA\HUMAN_RESOURCES\HR_MAIN.SQL
    To remove the sample tables, perform the same steps but substitute HR_DROP.SQL for HR_MAIN.SQL.
    Regards
    Asif Kabir

  • DDL and DML tool for unicode

    Which tool is able to maninupalate UTF-8 encoded data saved in Oracle database?
    (execute DDL and DML commands with non latin text)

    Hi,
    You can easily create your own scripts for creation (and even deletion/drop) of tables and inserts made to those tables. You just need to put the statements in a notepad and save it with a .sql extension. Then run this file from a SQL prompt with @ sign. For example
    SQL >@"c:myscript.sql" .
    Hope this helps
    Regards
    Aditi

  • By using Inspector, i found the way to create and insert a scrolldown list ; however the list has to be created from  inserting each line at a time; what i am looking for is a way of creating a scrolldown  large(30 to 100 lines) list.

    By using inspector, i found a way to create and insert a scrolldown list (*) in a cell ; however it can only be done one line at a time .what i am looking for is to create a bigger scrolldown list ( from 30 to 100 lines ) and in excel we can do it by copy and paste from an other doc...there must be a way with Numbers !!! any ideas ?
    (*)...go to inspector/4th icon to he left/format/local menu/and then input the list one by one...and it creates a scrolldown list where you cursor was located in numbers.
    please help....

    If you need to use this kind of objects, my guess is that it would be better to use an other application like libreOffice.
    At an user request, I wrote an AppleScript grabbing the list from a table embedded in the Numbers document.
    Here is an enhanced version.
    --{code}
    --[SCRIPT fake-scrolldown-list]
    Enregistrer le script en tant que Script : fake-scrolldown-list.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Utilisateurs:<votreCompte>:Bibliothèque:Scripts:Applications :Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Sélectionner une cellule dans une table d'un document Numbers.
    Aller au menu Scripts , choisir Numbers puis choisir “fake-scrolldown-list”
    Le script extrait la liste d'articles de la table « la_liste » de la feuille contenant la table ci-dessus.
    Il demande de choisir un article puis dépose celui-ci dans la cellule sélectionnée.
    ATTENTION : À la demande d'un utilisateur, Le script utilise un nom de table localisé.
    Je n'aime pas cela parce que de ce fait, lorsque le script est utilisé sur un système Français,
    il requiert une table nommée "la_liste" mais lorsqu'il est utilisé sur un système Anglais il requiert la table "the_list".
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: fake-scrolldown-list.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Select a cell in a table of a Numbers document.
    Go to the Scripts Menu, choose Numbers, then choose “fake-scrolldown-list”
    The script extract the list of allowed items from the table “the_list” which must sit in the same sheet that the table embedding the selected cell.
    It urge to choose an item then insert it in the selected cell.
    CAUTION : I use different names for the required table according to the language in use on user request.
    I dislike this feature because a document built by a French user sent to an English one will fail.
    On the French system the script ask for the table "la_liste" but it ask for the table "the_list" on an English system.
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/12/31
    --=====
    on run
              local dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2, myListe, maybe
              set {dName, sName, tName, rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
              tell application "Numbers" to tell document dName to tell sheet sName
    Extract the list of allowed values from the dedicated table *)
                        if my parleAnglais() then
                                  "the_list"
                        else
                                  "la_liste"
                        end if
                        tell table result
                                  set myListe to value of every cell of column 1
                        end tell
                        set maybe to choose from list myListe
    If we select the Cancel button, exit silently *)
                        if maybe is false then error number -128
    Fill the selected cell with the choosed value *)
                        tell table tName
                                  set value of cell rowNum1 of column colNum1 to (item 1 of maybe as text)
                        end tell
              end tell -- Numbers…
    end run
    --=====
    set { dName, sName, tName,  rowNum1, colNum1, rowNum2, colNum2} to my get_SelParams()
    tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
    on get_SelParams()
              local d_Name, s_Name, t_Name, row_Num1, col_Num1, row_Num2, col_Num2
              tell application "Numbers" to tell document 1
                        set d_Name to its name
                        set s_Name to ""
                        repeat with i from 1 to the count of sheets
                                  tell sheet i to set maybe to the count of (tables whose selection range is not missing value)
                                  if maybe is not 0 then
                                            set s_Name to name of sheet i
                                            exit repeat
                                  end if -- maybe is not 0
                        end repeat
                        if s_Name is "" then
                                  if my parleAnglais() then
                                            error "No sheet has a selected table embedding at least one selected cell !"
                                  else
                                            error "Aucune feuille ne contient une table ayant au moins une cellule sélectionnée !"
                                  end if
                        end if
                        tell sheet s_Name to tell (first table where selection range is not missing value)
                                  tell selection range
                                            set {top_left, bottom_right} to {name of first cell, name of last cell}
                                  end tell
                                  set t_Name to its name
                                  tell cell top_left to set {row_Num1, col_Num1} to {address of its row, address of its column}
                                  if top_left is bottom_right then
                                            set {row_Num2, col_Num2} to {row_Num1, col_Num1}
                                  else
                                            tell cell bottom_right to set {row_Num2, col_Num2} to {address of its row, address of its column}
                                  end if
                        end tell -- sheet…
                        return {d_Name, s_Name, t_Name, row_Num1, col_Num1, row_Num2, col_Num2}
              end tell -- Numbers
    end get_SelParams
    --=====
    on parleAnglais()
              local z
              try
                        tell application "Numbers" to set z to localized string "Cancel"
              on error
                        set z to "Cancel"
              end try
              return (z is not "Annuler")
    end parleAnglais
    --=====
    --[/SCRIPT]
    --{code}
    Yvan KOENIG (VALLAURIS, France) samedi 31 décembre 2011
    iMac 21”5, i7, 2.8 GHz, 12 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
    My iDisk is : http://public.me.com/koenigyvan
    Please : Search for questions similar to your own before submitting them to the community
    For iWork's applications dedicated to iOS, go to :
    https://discussions.apple.com/community/app_store/iwork_for_ios

  • Associative array comparison and INSERT upon IF condition

    Hi Guys,
    I have written this pl sql code to identify non existing sellers and insert their sales channel information into the dimension table (dimensional table update).
    Somehow,......nothing is inserted and this script runs for 12 hours+ without any result. the sql autotrace shows no result and the explain plan (button on sql developer throws upon clicking "missing keyword". I have no
    information what is going on/wrong. Does anyone spot an error?
    UNDEFINE DimSales;
    UNDEFINE FactTable;
    DEFINE DimSales = 'testsales';
    DEFINE FactTable = 'testfact';
    DECLARE
    v_SellerNo VarChar(9);
    v_error_code T_ERRORS.v_error_code%TYPE;
    v_error_message T_ERRORS.v_error_message%TYPE;
    TYPE assoc_array_str_type1 IS TABLE OF VARCHAR2(32) INDEX BY PLS_INTEGER;
         v1 assoc_array_str_type1;
    TYPE assoc_array_str_type2 IS TABLE OF VARCHAR2(32) INDEX BY PLS_INTEGER;
         v2 assoc_array_str_type2;
    BEGIN
    --Collect all distinct SellerNo into associative array (hash table)
    select distinct SellerNo bulk collect into v1 from &FactTable;
    select distinct seller_id bulk collect into v2 from &DimSales;
    v_SellerNo := v1.first;
    loop
    exit when v1 is null;
    --1 Check if v_SellerNo already exists in DIM_Sales (if NOT/FALSE, its a new seller and we can insert all records for that seller
    if (v2.exists(v_SellerNo)=false) THEN
    INSERT INTO &DimSales (K_Sales,REG,BVL,DS, VS,RS,GS,VK)
    (SELECT DISTINCT trim(leading '0' from RS||GS) ,REG BVL,DS,VS,RS,GS,VK from &FactTable where SellerNo =v_SellerNo);
    --ELSE
    end if;
    v_SellerNo := v1.next(v_SellerNo);
    end loop;
    EXCEPTION
    WHEN OTHERS THEN
    ROLLBACK;
    --v_error_code := SQLCODE
    --v_error_message := SQLERRM
    --INSERT INTO t_errors VALUES ( v_error_code, v_error_message);
    END;
    ---------------------------------------------------------------

    Distinct clause requires a sort. Sorts can be very expensive.
    Bulk collects that are not constrained in fetch size, can potentially fetch millions of rows - requiring that data to be wholly read into server memory. I have seen how this can degrade performance so badly that the kernel reboots the server.
    Using PL/SQL loops to process and insert/update/delete data is often problematic due to its row-by-row approach - also called slow-by-slow approach. It is far more scalable letting SQL do the "loop" processing, by using joins, sub-selects and so on.
    Where the conditional processing is too complex for SQL to handle, then PL/SQL is obviously an alternative to use. Ideally one should process data sets as oppose to rows in PL//SQL. Reduce context switching by using bulk fetches and bulk binds.
    But PL/SQL cannot execute in parallel as the SQL it fires off can. If after all the optimisation, the PL/SQL process still needs to hit a million rows to process, it will be slow irrespective of how optimal that PL/SQL approach and design - simply because of the number of rows and the processing overheads per row.
    In that case, the PL/SQL code itself need to be parallelised. There are a number of ways to approach this problem - the typical one is to create unique and distinct ranges of rows to process, spawn multiple P/SQL processes, and provide each with a unique range of rows to process. In parallel.
    So you need to look close at what you are trying to achieve, what the workloads are, and how to effectively decrease the workloads and increase the processing time of a workload.
    For example - finding distinct column values. You can pay for that workload when wanting that distinct list. And each time afterward repeat that workload when wanting that distinct list. Or you can pay for that workload up-front with the DML that creates/updates those values - and use (for example) a materialised view to maintain a ready to use distinct list of values.
    Same workload in essence - but paying once for it and up-front as oppose to each time you execute your code that needs to dynamically build that distinct list.
    Kent Crotty did tests and showed stunning performance improvements with bulk collect and forall, up to 30x faster:Bulk processing is not a magical silver bullet. It is a tool. And when correctly use, the tool does exactly what it was designed to do.
    The problem is using a hammer to drive in screws - instead of a screwdriver. There's nothing "stunning" about using a screwdriver. It is all about using the correct tool.
    If the goal of the swap daemon is to free up "idle" chunks of memory, and try to use that memory for things like file cache instead, what does that have to do with bulk processing?The swap daemon reads virtual memory pages from swap space into memory, and writes virtual pages from memory to swap space.
    What does it have to do with bulk processing? A bulk fetch reads data from the SGA (buffer cache) into the PGA (private process memory space). The larget the fetch, the more memory is required. If for example 50% of server memory is required for a bulk collection that is 2GB in size, then that will force in-use pages from memory to swap space.. only to be swapped back again as it is needed, thereby forcing other in-use pages to swap. The swap daemon will consume almost all the CPU time swapping hot pages continually in and out of memory.

  • Using servlets to read from text file and insert data

    Hi,
    Can I use a servlet to read from a space delimited text file on the client computer and use that data to insert into a table in my database? I want to make it easy for my users to upload their data without having to have them use SQL*Loader. If so can someone give me a hint as how to get started? I appreciate it.
    Thanks,
    Colby

    Create a page for the user to upload the file to your webserver and send a message (containing the file location) to a server app that will open the file, parse it, and insert it into your database. Make sure you secure the page.
    or
    Have the user paste the file into a simple web form that submits to a servlet that parses the data and inserts it into your db.

  • How to use direct select and insert or load to speedup the process instead of cursur

    Hi friends,
    I have stored procedure .In SP i am using cursur to load data from Parent to several child table.
    I have attached the script with this message.
    And my problem is how to use direct select and insert or load to speedup the process instead of cursur.
    Can any one please suggest me how to change this scripts pls.
    USE [IconicMarketing]
    GO
    /****** Object: StoredProcedure [dbo].[SP_DMS_INVENTORY] Script Date: 3/6/2015 3:34:03 PM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    -- =============================================
    -- Author: <ARUN,NAGARAJ>
    -- Create date: <11/21/2014>
    -- Description: <STORED PROCEDURE FOR DMS_INVENTORY>
    -- =============================================
    ALTER PROCEDURE [dbo].[SP_DMS_INVENTORY]
    @Specific_Date varchar(20) ,
    @DealerNum Varchar(6),
    @Date_Daily varchar(50)
    AS
    BEGIN
    SET NOCOUNT ON;
    --==========================================================================
    -- INVENTORY_CURSUR
    --==========================================================================
    DECLARE
    @FileType varchar(50),
    @ACDealerID varchar(50),
    @ClientDealerID varchar(50),
    @DMSType varchar(50),
    @StockNumber varchar(50),
    @InventoryDate datetime ,
    @StockType varchar(100),
    @DMSStatus varchar(50),
    @InvoicePrice numeric(18, 2),
    @CostPack varchar(50),
    @SalesCost numeric(18, 2),
    @HoldbackAmount numeric(18, 2),
    @ListPrice numeric(18, 2),
    @MSRP varchar(max),
    @LotLocation varchar(50),
    @TagLine varchar(max),
    @Certification varchar(max),
    @CertificationNumber varchar(max),
    @VehicleVIN varchar(50),
    @VehicleYear bigint ,
    @VehicleMake varchar(50),
    @VehicleModel varchar(50),
    @VehicleModelCode varchar(50),
    @VehicleTrim varchar(50),
    @VehicleSubTrimLevel varchar(max),
    @Classification varchar(max),
    @TypeCode varchar(100),
    @VehicleMileage bigint ,
    @EngineCylinderCount varchar(10) ,
    @TransmissionType varchar(50),
    @VehicleExteriorColor varchar(50),
    @VehicleInteriorColor varchar(50),
    @CreatedDate datetime ,
    @LastModifiedDate datetime ,
    @ModifiedFlag varchar(max),
    @InteriorColorCode varchar(50),
    @ExteriorColorCode varchar(50),
    @PackageCode varchar(50),
    @CodedCost varchar(50),
    @Air varchar(100),
    @OrderType varchar(max),
    @AgeDays bigint ,
    @OutstandingRO varchar(50),
    @DlrAccessoryRetail varchar(50),
    @DlrAccessoryCost varchar(max),
    @DlrAccessoryDesc varchar(max),
    @ModelDesc varchar(50),
    @Memo1 varchar(1000),
    @Memo2 varchar(max),
    @Weight varchar(max),
    @FloorPlan numeric(18, 2),
    @Purchaser varchar(max),
    @PurchasedFrom varchar(max),
    @InternetPrice varchar(50),
    @InventoryAcctDollar numeric(18, 2),
    @VehicleType varchar(50),
    @DealerAccessoryCode varchar(50),
    @AllInventoryAcctDollar numeric(18, 2),
    @BestPrice varchar(50),
    @InStock bigint ,
    @AccountingMake varchar(50),
    @GasDiesel varchar(max),
    @BookValue varchar(10),
    @FactoryAccessoryDescription varchar(max),
    @TotalReturn varchar(10),
    @TotalCost varchar(10),
    @SS varchar(max),
    @VehicleBody varchar(max),
    @StandardEquipment varchar(max),
    @Account varchar(max),
    @CalculatedPrice varchar(10),
    @OriginalCost varchar(10),
    @AccessoryCore varchar(10),
    @OtherDollar varchar(10),
    @PrimaryBookValue varchar(10),
    @AmountDue varchar(10),
    @LicenseFee varchar(10),
    @ICompany varchar(max),
    @InvenAcct varchar(max),
    @Field23 varchar(max),
    @Field24 varchar(max),
    @SalesCode bigint,
    @BaseRetail varchar(10),
    @BaseInvAmt varchar(10),
    @CommPrice varchar(10),
    @Price1 varchar(10),
    @Price2 varchar(10),
    @StickerPrice varchar(10),
    @TotInvAmt varchar(10),
    @OptRetail varchar(max),
    @OptInvAmt varchar(10),
    @OptCost varchar(10),
    @Options1 varchar(max),
    @Category varchar(max),
    @Description varchar(max),
    @Engine varchar(max),
    @ModelType varchar(max),
    @FTCode varchar(max),
    @Wholesale varchar(max),
    @Retail varchar(max),
    @Draft varchar(max),
    @myerror varchar(500),
    @Inventoryid int,
    @errornumber int,
    @errorseverity varchar(500),
    @errortable varchar(50),
    @errorstate int,
    @errorprocedure varchar(500),
    @errorline varchar(50),
    @errormessage varchar(1000),
    @Invt_Id int,
    @flatfile_createddate datetime,
    @FtpDate date,
    @Inv_cur varchar(1000),
    @S_Year varchar(4),
    @S_Month varchar(2),
    @S_Date varchar(2),
    @Date_Specfic varchar(50),
    @Param_list nvarchar(max),
    @Daily_Date Varchar(50);
    --====================================================================================
    --DECLARE CURSUR FOR SPECIFIC DATE (OR) DEALER-ID WITH SPECIFIC DATE (OR) CURRENT DATE
    --====================================================================================
    set @Date_Specfic = Substring(@Specific_Date,1,4) +'-'+Substring(@Specific_Date,5,2)+'-'+Substring(@Specific_Date,7,2);
    set @Daily_Date = SUBSTRING(@Date_Daily,14,4) + '-' + SUBSTRING(@Date_Daily,18,2)+ '-' + SUBSTRING(@date_Daily,20,2)
    IF @Daily_Date IS NOT NULL
    BEGIN
    Delete From [dbo].[DMS_INVENTORY_DETAILS]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    Delete From [dbo].[DMS_INVENTORY_AMOUNT]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    Delete From [dbo].[ICONIC_INVENTORY_VEHICLE]
    Where DMSInventoryVehicleID in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    Delete From [dbo].[DMS_INVENTORY_VEHICLE]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    Delete From [dbo].[ICONIC_EQUITY_INVENTORY_COMPARE]
    Where InventoryVehicleId in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    Delete From [dbo].[DMS_INVENTORY]
    Where ID in(select ID from [dbo].[DMS_INVENTORY] where CONVERT (date,FtpDate)=CONVERT (date,GETDATE()));
    DECLARE Inventory_Cursor CURSOR FOR
    SELECT * from [dbo].[FLATFILE_INVENTORY] where
    CONVERT (date,flatfile_createddate) = CONVERT (date,GETDATE()) order by flatfile_createddate;
    END
    Else
    BEGIN
    if (@Date_Specfic IS NOT NULL AND @DealerNum != '?????')
    BEGIN
    Delete From [dbo].[DMS_INVENTORY_DETAILS]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    Delete From [dbo].[DMS_INVENTORY_AMOUNT]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    Delete From [dbo].[ICONIC_INVENTORY_VEHICLE]
    Where DMSInventoryVehicleID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    Delete From [dbo].[DMS_INVENTORY_VEHICLE]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    Delete From [dbo].[ICONIC_EQUITY_INVENTORY_COMPARE]
    Where InventoryVehicleId in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    Delete From [dbo].[DMS_INVENTORY]
    Where ID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic AND DMSDealerID='ACTEST' + @DealerNum);
    DECLARE Inventory_Cursor CURSOR FOR
    SELECT * from [dbo].[FLATFILE_INVENTORY] where FtpDate=@Date_Specfic AND ACDealerID='ACTEST' + @DealerNum;
    END
    ELSE
    BEGIN
    Delete From [dbo].[DMS_INVENTORY_DETAILS]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    Delete From [dbo].[DMS_INVENTORY_AMOUNT]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    Delete From [dbo].[ICONIC_INVENTORY_VEHICLE]
    Where DMSInventoryVehicleID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    Delete From [dbo].[DMS_INVENTORY_VEHICLE]
    Where DMSInventoryID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    Delete From [dbo].[ICONIC_EQUITY_INVENTORY_COMPARE]
    Where InventoryVehicleId in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    Delete From [dbo].[DMS_INVENTORY]
    Where ID in(select ID from [dbo].[DMS_INVENTORY] where FtpDate=@Date_Specfic);
    DECLARE Inventory_Cursor CURSOR FOR
    SELECT * from [dbo].[FLATFILE_INVENTORY] where FtpDate=@Date_Specfic;
    END
    END
    OPEN Inventory_Cursor
    FETCH NEXT FROM Inventory_Cursor
    INTO
    @FileType ,
    @ACDealerID ,
    @ClientDealerID ,
    @DMSType ,
    @StockNumber ,
    @InventoryDate ,
    @StockType ,
    @DMSStatus ,
    @InvoicePrice ,
    @CostPack ,
    @SalesCost ,
    @HoldbackAmount ,
    @ListPrice ,
    @MSRP ,
    @LotLocation ,
    @TagLine ,
    @Certification ,
    @CertificationNumber ,
    @VehicleVIN ,
    @VehicleYear ,
    @VehicleMake ,
    @VehicleModel ,
    @VehicleModelCode ,
    @VehicleTrim ,
    @VehicleSubTrimLevel ,
    @Classification ,
    @TypeCode ,
    @VehicleMileage ,
    @EngineCylinderCount ,
    @TransmissionType ,
    @VehicleExteriorColor ,
    @VehicleInteriorColor ,
    @CreatedDate ,
    @LastModifiedDate ,
    @ModifiedFlag ,
    @InteriorColorCode ,
    @ExteriorColorCode ,
    @PackageCode ,
    @CodedCost ,
    @Air ,
    @OrderType ,
    @AgeDays ,
    @OutstandingRO ,
    @DlrAccessoryRetail ,
    @DlrAccessoryCost ,
    @DlrAccessoryDesc ,
    @ModelDesc ,
    @Memo1 ,
    @Memo2 ,
    @Weight ,
    @FloorPlan ,
    @Purchaser ,
    @PurchasedFrom ,
    @InternetPrice ,
    @InventoryAcctDollar ,
    @VehicleType ,
    @DealerAccessoryCode ,
    @AllInventoryAcctDollar ,
    @BestPrice ,
    @InStock ,
    @AccountingMake ,
    @GasDiesel ,
    @BookValue ,
    @FactoryAccessoryDescription ,
    @TotalReturn ,
    @TotalCost ,
    @SS ,
    @VehicleBody ,
    @StandardEquipment ,
    @Account ,
    @CalculatedPrice ,
    @OriginalCost ,
    @AccessoryCore ,
    @OtherDollar ,
    @PrimaryBookValue ,
    @AmountDue ,
    @LicenseFee ,
    @ICompany ,
    @InvenAcct ,
    @Field23 ,
    @Field24 ,
    @SalesCode ,
    @BaseRetail ,
    @BaseInvAmt ,
    @CommPrice ,
    @Price1 ,
    @Price2 ,
    @StickerPrice ,
    @TotInvAmt ,
    @OptRetail ,
    @OptInvAmt ,
    @OptCost ,
    @Options1 ,
    @Category ,
    @Description ,
    @Engine ,
    @ModelType ,
    @FTCode ,
    @Wholesale ,
    @Retail ,
    @Draft ,
    @flatfile_createddate,
    @FtpDate;
    WHILE @@FETCH_STATUS = 0
    BEGIN
    --==========================================================================
    -- INSERT INTO INVENTORY (PARENT TABLE)
    --==========================================================================
    BEGIN TRY
    INSERT INTO [dbo].[DMS_INVENTORY]
    DMSDealerID,
    StockNumber,
    DMSType,
    InventoryDate,
    FtpDate
    VALUES (@ClientDealerID,@StockNumber,@DMSType,@InventoryDate,@FtpDate);
    END TRY
    BEGIN CATCH
    SELECT
    @errornumber = ERROR_NUMBER(),
    @errorseverity = ERROR_SEVERITY(),
    @errortable = 'DMS_INVENTORY',
    @errorstate = ERROR_STATE(),
    @errorprocedure = ERROR_PROCEDURE(),
    @errorline = ERROR_LINE(),
    @errormessage = ERROR_MESSAGE();
    --==========================================================================
    -- INSERT ERRORS INTO DMSLOG_INVENTORY_ERROR
    --==========================================================================
    EXEC [SP_DMS_INVENTORY_ERROR] @FileType,@ACDealerID,@ClientDealerID,@DMSType,@StockNumber,@InventoryDate,@StockType,@DMSStatus,@InvoicePrice,@CostPack,
    @SalesCost,@HoldbackAmount,@ListPrice,@MSRP,@LotLocation,@TagLine,@Certification,@CertificationNumber,@VehicleVIN,@VehicleYear,@VehicleMake,@VehicleModel,@VehicleModelCode,
    @VehicleTrim,@VehicleSubTrimLevel,@Classification,@TypeCode,@VehicleMileage,@EngineCylinderCount,@TransmissionType,@VehicleExteriorColor,@VehicleInteriorColor,
    @CreatedDate,@LastModifiedDate,@ModifiedFlag,@InteriorColorCode,@ExteriorColorCode,@PackageCode,@CodedCost,@Air,@OrderType,@AgeDays,@OutstandingRO,
    @DlrAccessoryRetail,@DlrAccessoryCost,@DlrAccessoryDesc,@ModelDesc,@Memo1,@Memo2,@Weight,@FloorPlan,@Purchaser,@PurchasedFrom,@InternetPrice,
    @InventoryAcctDollar,@VehicleType,@DealerAccessoryCode,@AllInventoryAcctDollar,@BestPrice,@InStock,@AccountingMake,@GasDiesel,@BookValue,
    @FactoryAccessoryDescription,@TotalReturn,@TotalCost,@SS,@VehicleBody,@StandardEquipment,@Account,@CalculatedPrice,@OriginalCost,@AccessoryCore,
    @OtherDollar,@PrimaryBookValue,@AmountDue,@LicenseFee,@ICompany,@InvenAcct,@Field23,@Field24,@SalesCode,@BaseRetail,@BaseInvAmt,@CommPrice,@Price1,
    @Price2,@StickerPrice,@TotInvAmt,@OptRetail,@OptInvAmt,@OptCost,@Options1,@Category,@Description,@Engine,@ModelType,@FTCode,@Wholesale,@Retail,@Draft,
    @ERRORNUMBER,@ERRORSEVERITY,@ERRORTABLE,@ERRORSTATE,@ERRORPROCEDURE,@ERRORLINE,@errormessage,@FtpDate
    END CATCH
    -- PRINT @errornumber;
    -- PRINT @errorseverity;
    -- PRINT @errortable;
    -- PRINT @errorprocedure;
    -- PRINT @errorline;
    -- PRINT @errormessage;
    -- PRINT @errorstate;
    set @myerror = @@ERROR;
    -- This -- PRINT statement -- PRINTs 'Error = 0' because
    -- @@ERROR is reset in the IF statement above.
    -- PRINT N'Error = ' + @myerror;
    set @Inventoryid = scope_identity();
    -- PRINT @Inventoryid;
    --==========================================================================
    -- INSERT INTO DMS_INVENTORY_DETAILS (CHILD TABLE)
    --==========================================================================
    BEGIN TRY
    INSERT INTO [dbo].[DMS_INVENTORY_DETAILS]
    DMSInventoryID,
    StockType,
    DMSStatus,
    LotLocation,
    TagLine,
    Certification,
    CertificationNumber,
    CreatedDate,
    LastModifiedDate,
    ModifiedFlag,
    PackageCode,
    OrderType,
    AgeDays,
    OutstandingRO,
    Memo1,
    Memo2,
    Purchaser,
    PurchasedFrom,
    DealerAccessoryCode,
    InStock,
    AccountingMake,
    SS,
    Account,
    AccessoryCore,
    ICompany,
    InvenAcct,
    Field23,
    Field24,
    SalesCode,
    Draft,
    FTCode,
    FtpDate
    VALUES (
    @InventoryID,
    @StockType,
    @DMSStatus,
    @LotLocation,
    @TagLine,
    @Certification,
    @CertificationNumber,
    @CreatedDate,
    @LastModifiedDate,
    @ModifiedFlag,
    @PackageCode,
    @OrderType,
    @AgeDays,
    @OutstandingRO,
    @Memo1,
    @Memo2,
    @Purchaser,
    @PurchasedFrom,
    @DealerAccessoryCode,
    @InStock,
    @AccountingMake,
    @SS,
    @Account,
    @AccessoryCore,
    @ICompany,
    @InvenAcct,
    @Field23,
    @Field24,
    @SalesCode,
    @Draft,
    @FTCode,
    @FtpDate
    END TRY
    BEGIN CATCH
    SELECT
    @errornumber = ERROR_NUMBER(),
    @errorseverity = ERROR_SEVERITY(),
    @errorstate = ERROR_STATE(),
    @errortable = 'DMS_INVENTORY_DETAILS',
    @errorprocedure = ERROR_PROCEDURE(),
    @errorline = ERROR_LINE(),
    @errormessage = ERROR_MESSAGE();
    --==========================================================================
    -- INSERT ERRORS INTO DMSLOG_INVENTORY_ERROR
    --==========================================================================
    EXECUTE [SP_DMS_INVENTORY_ERROR] @FileType,@ACDealerID,@ClientDealerID,@DMSType,@StockNumber,@InventoryDate,@StockType,@DMSStatus,@InvoicePrice,@CostPack,
    @SalesCost,@HoldbackAmount,@ListPrice,@MSRP,@LotLocation,@TagLine,@Certification,@CertificationNumber,@VehicleVIN,@VehicleYear,@VehicleMake,@VehicleModel,@VehicleModelCode,
    @VehicleTrim,@VehicleSubTrimLevel,@Classification,@TypeCode,@VehicleMileage,@EngineCylinderCount,@TransmissionType,@VehicleExteriorColor,@VehicleInteriorColor,
    @CreatedDate,@LastModifiedDate,@ModifiedFlag,@InteriorColorCode,@ExteriorColorCode,@PackageCode,@CodedCost,@Air,@OrderType,@AgeDays,@OutstandingRO,
    @DlrAccessoryRetail,@DlrAccessoryCost,@DlrAccessoryDesc,@ModelDesc,@Memo1,@Memo2,@Weight,@FloorPlan,@Purchaser,@PurchasedFrom,@InternetPrice,
    @InventoryAcctDollar,@VehicleType,@DealerAccessoryCode,@AllInventoryAcctDollar,@BestPrice,@InStock,@AccountingMake,@GasDiesel,@BookValue,
    @FactoryAccessoryDescription,@TotalReturn,@TotalCost,@SS,@VehicleBody,@StandardEquipment,@Account,@CalculatedPrice,@OriginalCost,@AccessoryCore,
    @OtherDollar,@PrimaryBookValue,@AmountDue,@LicenseFee,@ICompany,@InvenAcct,@Field23,@Field24,@SalesCode,@BaseRetail,@BaseInvAmt,@CommPrice,@Price1,
    @Price2,@StickerPrice,@TotInvAmt,@OptRetail,@OptInvAmt,@OptCost,@Options1,@Category,@Description,@Engine,@ModelType,@FTCode,@Wholesale,@Retail,@Draft,
    @ERRORNUMBER,@ERRORSEVERITY,@ERRORTABLE,@ERRORSTATE,@ERRORPROCEDURE,@ERRORLINE,@errormessage,@FtpDate
    END CATCH
    --==========================================================================
    -- INSERT INTO DMS_INVENTORY_AMOUNT (CHILD TABLE)
    --==========================================================================
    BEGIN TRY
    INSERT INTO [dbo].[DMS_INVENTORY_AMOUNT]
    DMSInventoryID,
    AllInventoryAcctDollar,
    OtherDollar,
    PrimaryBookValue,
    AmountDue,
    LicenseFee,
    CalculatedPrice,
    OriginalCost,
    BookValue,
    TotalReturn,
    TotalCost,
    DlrAccessoryRetail,
    DlrAccessoryCost,
    DlrAccessoryDesc,
    InternetPrice,
    InventoryAcctDollar,
    BestPrice,
    Weight,
    FloorPlan,
    CodedCost,
    InvoicePrice,
    CostPack,
    SalesCost,
    HoldbackAmount,
    ListPrice,
    MSRP,
    BaseRetail,
    BaseInvAmt,
    CommPrice,
    Price1,
    Price2,
    StickerPrice,
    TotInvAmt,
    OptRetail,
    OptInvAmt,
    OptCost,
    Wholesale,
    Retail,
    FtpDate
    VALUES (
    @InventoryID,
    @AllInventoryAcctDollar,
    @OtherDollar,
    @PrimaryBookValue,
    @AmountDue,
    @LicenseFee,
    @CalculatedPrice,
    @OriginalCost,
    @BookValue,
    @TotalReturn,
    @TotalCost,
    @DlrAccessoryRetail,
    @DlrAccessoryCost,
    @DlrAccessoryDesc,
    @InternetPrice,
    @InventoryAcctDollar,
    @BestPrice,
    @Weight,
    @FloorPlan,
    @CodedCost,
    @InvoicePrice,
    @CostPack,
    @SalesCost,
    @HoldbackAmount,
    @ListPrice,
    @MSRP,
    @BaseRetail,
    @BaseInvAmt,
    @CommPrice,
    @Price1,
    @Price2,
    @StickerPrice,
    @TotInvAmt,
    @OptRetail,
    @OptInvAmt,
    @OptCost,
    @Wholesale,
    @Retail,
    @FtpDate
    END TRY
    BEGIN CATCH
    SELECT
    @errornumber = ERROR_NUMBER(),
    @errorseverity = ERROR_SEVERITY(),
    @errortable = 'DMS_INVENTORY_AMOUNT',
    @errorstate = ERROR_STATE(),
    @errorprocedure = ERROR_PROCEDURE(),
    @errorline = ERROR_LINE(),
    @errormessage = ERROR_MESSAGE();
    --==========================================================================
    -- INSERT ERRORS INTO DMSLOG_INVENTORY_ERROR
    --==========================================================================
    EXEC [SP_DMS_INVENTORY_ERROR] @FileType,@ACDealerID,@ClientDealerID,@DMSType,@StockNumber,@InventoryDate,@StockType,@DMSStatus,@InvoicePrice,@CostPack,
    @SalesCost,@HoldbackAmount,@ListPrice,@MSRP,@LotLocation,@TagLine,@Certification,@CertificationNumber,@VehicleVIN,@VehicleYear,@VehicleMake,@VehicleModel,@VehicleModelCode,
    @VehicleTrim,@VehicleSubTrimLevel,@Classification,@TypeCode,@VehicleMileage,@EngineCylinderCount,@TransmissionType,@VehicleExteriorColor,@VehicleInteriorColor,
    @CreatedDate,@LastModifiedDate,@ModifiedFlag,@InteriorColorCode,@ExteriorColorCode,@PackageCode,@CodedCost,@Air,@OrderType,@AgeDays,@OutstandingRO,
    @DlrAccessoryRetail,@DlrAccessoryCost,@DlrAccessoryDesc,@ModelDesc,@Memo1,@Memo2,@Weight,@FloorPlan,@Purchaser,@PurchasedFrom,@InternetPrice,
    @InventoryAcctDollar,@VehicleType,@DealerAccessoryCode,@AllInventoryAcctDollar,@BestPrice,@InStock,@AccountingMake,@GasDiesel,@BookValue,
    @FactoryAccessoryDescription,@TotalReturn,@TotalCost,@SS,@VehicleBody,@StandardEquipment,@Account,@CalculatedPrice,@OriginalCost,@AccessoryCore,
    @OtherDollar,@PrimaryBookValue,@AmountDue,@LicenseFee,@ICompany,@InvenAcct,@Field23,@Field24,@SalesCode,@BaseRetail,@BaseInvAmt,@CommPrice,@Price1,
    @Price2,@StickerPrice,@TotInvAmt,@OptRetail,@OptInvAmt,@OptCost,@Options1,@Category,@Description,@Engine,@ModelType,@FTCode,@Wholesale,@Retail,@Draft,
    @ERRORNUMBER,@ERRORSEVERITY,@ERRORTABLE,@ERRORSTATE,@ERRORPROCEDURE,@ERRORLINE,@errormessage,@FtpDate
    END CATCH
    --==========================================================================
    -- INSERT INTO DMS_INVENTORY_VEHICLE (CHILD TABLE)
    --==========================================================================
    BEGIN TRY
    INSERT INTO [dbo].[DMS_INVENTORY_VEHICLE]
    DMSInventoryID,
    InteriorColorCode,
    ExteriorColorCode,
    Air,
    ModelDesc,
    VehicleType,
    VehicleVIN,
    VehicleYear,
    VehicleMake,
    VehicleModel,
    VehicleModelCode,
    VehicleTrim,
    VehicleSubTrimLevel,
    Classification,
    TypeCode,
    VehicleMileage,
    FtpDate,
    EngineCylinderCount
    VALUES (
    @InventoryID,
    @InteriorColorCode,
    @ExteriorColorCode,
    @Air,
    @ModelDesc,
    @VehicleType,
    @VehicleVIN,
    @VehicleYear,
    @VehicleMake,
    @VehicleModel,
    @VehicleModelCode,
    @VehicleTrim,
    @VehicleSubTrimLevel,
    @Classification,
    @TypeCode,
    @VehicleMileage,
    @FtpDate,
    @EngineCylinderCount
    END TRY
    BEGIN CATCH
    SELECT
    @errornumber = ERROR_NUMBER(),
    @errorseverity = ERROR_SEVERITY(),
    @errortable = 'DMS_INVENTORY_VEHICLE',
    @errorstate = ERROR_STATE(),
    @errorprocedure = ERROR_PROCEDURE(),
    @errorline = ERROR_LINE(),
    @errormessage = ERROR_MESSAGE();
    --==========================================================================
    -- INSERT ERRORS INTO DMSLOG_INVENTORY_ERROR
    --==========================================================================
    EXEC [SP_DMS_INVENTORY_ERROR] @FileType,@ACDealerID,@ClientDealerID,@DMSType,@StockNumber,@InventoryDate,@StockType,@DMSStatus,@InvoicePrice,@CostPack,
    @SalesCost,@HoldbackAmount,@ListPrice,@MSRP,@LotLocation,@TagLine,@Certification,@CertificationNumber,@VehicleVIN,@VehicleYear,@VehicleMake,@VehicleModel,@VehicleModelCode,
    @VehicleTrim,@VehicleSubTrimLevel,@Classification,@TypeCode,@VehicleMileage,@EngineCylinderCount,@TransmissionType,@VehicleExteriorColor,@VehicleInteriorColor,
    @CreatedDate,@LastModifiedDate,@ModifiedFlag,@InteriorColorCode,@ExteriorColorCode,@PackageCode,@CodedCost,@Air,@OrderType,@AgeDays,@OutstandingRO,
    @DlrAccessoryRetail,@DlrAccessoryCost,@DlrAccessoryDesc,@ModelDesc,@Memo1,@Memo2,@Weight,@FloorPlan,@Purchaser,@PurchasedFrom,@InternetPrice,
    @InventoryAcctDollar,@VehicleType,@DealerAccessoryCode,@AllInventoryAcctDollar,@BestPrice,@InStock,@AccountingMake,@GasDiesel,@BookValue,
    @FactoryAccessoryDescription,@TotalReturn,@TotalCost,@SS,@VehicleBody,@StandardEquipment,@Account,@CalculatedPrice,@OriginalCost,@AccessoryCore,
    @OtherDollar,@PrimaryBookValue,@AmountDue,@LicenseFee,@ICompany,@InvenAcct,@Field23,@Field24,@SalesCode,@BaseRetail,@BaseInvAmt,@CommPrice,@Price1,
    @Price2,@StickerPrice,@TotInvAmt,@OptRetail,@OptInvAmt,@OptCost,@Options1,@Category,@Description,@Engine,@ModelType,@FTCode,@Wholesale,@Retail,@Draft,
    @ERRORNUMBER,@ERRORSEVERITY,@ERRORTABLE,@ERRORSTATE,@ERRORPROCEDURE,@ERRORLINE,@errormessage,@FtpDate
    END CATCH
    --==========================================================================
    -- MOVE CURSUR TO NEXT RECORD
    --==========================================================================
    FETCH NEXT FROM Inventory_Cursor
    INTO @FileType ,
    @ACDealerID ,
    @ClientDealerID ,
    @DMSType ,
    @StockNumber ,
    @InventoryDate ,
    @StockType ,
    @DMSStatus ,
    @InvoicePrice ,
    @CostPack ,
    @SalesCost ,
    @HoldbackAmount ,
    @ListPrice ,
    @MSRP ,
    @LotLocation ,
    @TagLine ,
    @Certification ,
    @CertificationNumber ,
    @VehicleVIN ,
    @VehicleYear ,
    @VehicleMake ,
    @VehicleModel ,
    @VehicleModelCode ,
    @VehicleTrim ,
    @VehicleSubTrimLevel ,
    @Classification ,
    @TypeCode ,
    @VehicleMileage ,
    @EngineCylinderCount ,
    @TransmissionType ,
    @VehicleExteriorColor ,
    @VehicleInteriorColor ,
    @CreatedDate ,
    @LastModifiedDate ,
    @ModifiedFlag ,
    @InteriorColorCode ,
    @ExteriorColorCode ,
    @PackageCode ,
    @CodedCost ,
    @Air ,
    @OrderType ,
    @AgeDays ,
    @OutstandingRO ,
    @DlrAccessoryRetail ,
    @DlrAccessoryCost ,
    @DlrAccessoryDesc ,
    @ModelDesc ,
    @Memo1 ,
    @Memo2 ,
    @Weight ,
    @FloorPlan ,
    @Purchaser ,
    @PurchasedFrom ,
    @InternetPrice ,
    @InventoryAcctDollar ,
    @VehicleType ,
    @DealerAccessoryCode ,
    @AllInventoryAcctDollar ,
    @BestPrice ,
    @InStock ,
    @AccountingMake ,
    @GasDiesel ,
    @BookValue ,
    @FactoryAccessoryDescription ,
    @TotalReturn ,
    @TotalCost ,
    @SS ,
    @VehicleBody ,
    @StandardEquipment ,
    @Account ,
    @CalculatedPrice ,
    @OriginalCost ,
    @AccessoryCore ,
    @OtherDollar ,
    @PrimaryBookValue ,
    @AmountDue ,
    @LicenseFee ,
    @ICompany ,
    @InvenAcct ,
    @Field23 ,
    @Field24 ,
    @SalesCode ,
    @BaseRetail ,
    @BaseInvAmt ,
    @CommPrice ,
    @Price1 ,
    @Price2 ,
    @StickerPrice ,
    @TotInvAmt ,
    @OptRetail ,
    @OptInvAmt ,
    @OptCost ,
    @Options1 ,
    @Category ,
    @Description ,
    @Engine ,
    @ModelType ,
    @FTCode ,
    @Wholesale ,
    @Retail ,
    @Draft ,
    @flatfile_createddate,
    @FtpDate;
    END
    CLOSE Inventory_Cursor;
    DEALLOCATE Inventory_Cursor;
    SET ANSI_PADDING OFF
    END
    Arunraj Kumar

    Thank you.
    And another question if the data is already there in the child table if i try to load alone it must delete the old data in the child tablee and need to get load the new data and 
    How to do this ?
    Arunraj Kumar
    You can do that with an IF EXISTS condition
    IF EXISTS (SELECT 1
    FROM YourChildTable c
    INNER JOIn @temptable t
    ON c.Bkey1 = t.Bkey1
    AND c.Bkey2 = t.Bkey2
    DELETE t
    FROM YourChildTable c
    INNER JOIn @temptable t
    ON c.Bkey1 = t.Bkey1
    AND c.Bkey2 = t.Bkey2
    INSERT INTO YourChildTable
    where Bkey1,Bkey2 etc forms the business key of the table
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

Maybe you are looking for

  • Enhancements to the WEB Templete 0ANALYSIS_PATTREN

    Hi,   We are using 0ANALYSIS_PATTREN web templete for WEB Bex Analyzer. User access queries using this templete. I got couple of requirments that i need to enhance the WEB templete. Please guide me how to proceed to achieve... When user executes quer

  • Unable to process RAW .PEF .DNG from Pentax K-7

    I have the latest updates. Camera Raw 3.1, Aperture 3.0.2, OS 10.6.3... when i first import the images I can process them as normal. My RAW adjustments are available. But then after a few minutes aperture will update them and it will say the file has

  • NI 5620 acquisitio​n

    Hello, I have NI 5660 RF Signal Analyzer, and I want to configure the digitizer to start acquiring data when a certain RF signal is detected (for examples from a remote control, I press the buton and the device starts acquiring data, I release the bu

  • Abnormal Shutdown and roles missing

    Yesterday my database shutdown abnormally.. after opening the connect,dba ansd some other roles missing . and users cannot able to connect .later I give the create session privilage to all users then they can able to connect How it happened? please h

  • Contact person number range assignment

    Hi all, I have Created contact person number range using T Code : VPN1. where do we assign this number range. can any one tell me the "assignment process" menupath or T code. Thanks in advance. Regards, Shaik