Re-Write the Node-DOM code with SQL-XML funtions

Hi Friends,
Could you please help in re-writing the below code using SQl-XML functions
DECLARE
l_domdoc dbms_xmldom.DOMDocument;
l_xmltype XMLTYPE;
l_root_node dbms_xmldom.DOMNode;
l_departments_node dbms_xmldom.DOMNode;
l_dept_element dbms_xmldom.DOMElement;
l_dept_node dbms_xmldom.DOMNode;
l_name_node dbms_xmldom.DOMNode;
l_name_textnode dbms_xmldom.DOMNode;
l_location_node dbms_xmldom.DOMNode;
l_location_textnode dbms_xmldom.DOMNode;
l_employees_node dbms_xmldom.DOMNode;
l_emp_element dbms_xmldom.DOMElement;
l_emp_node dbms_xmldom.DOMNode;
l_emp_first_name_node dbms_xmldom.DOMNode;
l_emp_first_name_textnode dbms_xmldom.DOMNode;
l_emp_last_name_node dbms_xmldom.DOMNode;
l_emp_last_name_textnode dbms_xmldom.DOMNode;
BEGIN
-- Create an empty XML document
l_domdoc := dbms_xmldom.newDomDocument;
-- Create a root node
l_root_node := dbms_xmldom.makeNode(l_domdoc);
-- Create a new node Departments and add it to the root node
l_departments_node := dbms_xmldom.appendChild( l_root_node
, dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'Deptartments' ))
FOR r_dept IN (SELECT dept.department_id
, dept.department_name
, loc.city
FROM departments dept
JOIN locations loc
ON loc.location_id = dept.location_id
WHERE dept.department_id IN (10,20)
LOOP
-- For each record, create a new Dept element with the Department ID as attribute.
-- and add this new Dept element to the Departments node
l_dept_element := dbms_xmldom.createElement(l_domdoc, 'Dept' );
dbms_xmldom.setAttribute(l_dept_element, 'Deptno', r_dept.Department_Id );
l_dept_node := dbms_xmldom.appendChild( l_departments_node
, dbms_xmldom.makeNode(l_dept_element)
-- Each Dept node will get a Name node which contains the department name as text
l_name_node := dbms_xmldom.appendChild( l_dept_node
, dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'Name' ))
l_name_textnode := dbms_xmldom.appendChild( l_name_node
, dbms_xmldom.makeNode(dbms_xmldom.createTextNode(l_domdoc, r_dept.department_name ))
-- Each Dept node will aslo get a Location node which contains the location(city) as text
l_location_node := dbms_xmldom.appendChild( l_dept_node
, dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'Location' ))
l_location_textnode := dbms_xmldom.appendChild( l_location_node
, dbms_xmldom.makeNode(dbms_xmldom.createTextNode(l_domdoc, r_dept.city ))
-- For each department, add an Employees node
l_employees_node := dbms_xmldom.appendChild( l_dept_node
, dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'Employees' ))
FOR r_emp IN (SELECT employee_id
, first_name
, last_name
FROM employees
WHERE department_id = r_dept.department_id
LOOP
-- For each record, create a new Emp element with the Employee ID as attribute.
-- and add this new Emp element to the Employees node
l_emp_element := dbms_xmldom.createElement(l_domdoc, 'Emp' );
dbms_xmldom.setAttribute(l_emp_element, 'empid', r_emp.employee_id );
l_emp_node := dbms_xmldom.appendChild( l_employees_node
, dbms_xmldom.makeNode(l_emp_element)
-- Each emp node will get a First name and Last name node which contains the first name and last name as text
l_emp_first_name_node := dbms_xmldom.appendChild( l_emp_node
, dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'FirstName' ))
l_emp_first_name_textnode := dbms_xmldom.appendChild( l_emp_first_name_node
, dbms_xmldom.makeNode(dbms_xmldom.createTextNode(l_domdoc, r_emp.first_name ))
l_emp_last_name_node := dbms_xmldom.appendChild( l_emp_node
, dbms_xmldom.makeNode(dbms_xmldom.createElement(l_domdoc, 'LastName' ))
l_emp_last_name_textnode := dbms_xmldom.appendChild( l_emp_last_name_node
, dbms_xmldom.makeNode(dbms_xmldom.createTextNode(l_domdoc, r_emp.last_name ))
END LOOP;
  END LOOP;
l_xmltype := dbms_xmldom.getXmlType(l_domdoc);
dbms_xmldom.freeDocument(l_domdoc);
dbms_output.put_line(l_xmltype.getClobVal);
END;
thanks and regards,
Arun Thomas T

It's as easy as this :
SQL> select xmlserialize(document
  2           xmlelement("Departments"
  3           , xmlagg(
  4               xmlelement("Dept"
  5               , xmlattributes(d.department_id as "Deptno")
  6               , xmlforest(
  7                   d.department_name as "Name"
  8                 , l.city as "Location"
  9                 )
10               , xmlelement("Employees"
11                 , (
12                     select xmlagg(
13                              xmlelement("Emp"
14                              , xmlattributes(e.employee_id as "empid")
15                              , xmlforest(
16                                  e.first_name as "FirstName"
17                                , e.last_name as "LastName"
18                                )
19                              )
20                            )
21                     from hr.employees e
22                     where e.department_id = d.department_id
23                   )
24                 )
25               )
26             )
27           )
28           indent
29         )
30  from hr.departments d
31       join hr.locations l on l.location_id = d.location_id
32  where d.department_id in (10,20) ;
XMLSERIALIZE(DOCUMENTXMLELEMEN
<Departments>
  <Dept Deptno="10">
    <Name>Administration</Name>
    <Location>Seattle</Location>
    <Employees>
      <Emp empid="200">
        <FirstName>Jennifer</FirstName>
        <LastName>Whalen</LastName>
      </Emp>
    </Employees>
  </Dept>
  <Dept Deptno="20">
    <Name>Marketing</Name>
    <Location>Toronto</Location>
    <Employees>
      <Emp empid="201">
        <FirstName>Michael</FirstName>
        <LastName>Hartstein</LastName>
      </Emp>
      <Emp empid="202">
        <FirstName>Pat</FirstName>
        <LastName>Fay</LastName>
      </Emp>
    </Employees>
  </Dept>
</Departments>

Similar Messages

  • Mix jython code with sql

    Hi,
    I have just read the following sentence in the odi jyhon reference:
    "Oracle Data Integrator users may write procedures or knowledge modules using Jython, and may mix Jython code with SQL, PL/SQL, OS Calls, etc."
    Does anyone of you know how jython can be mixed with SQL in a knowledge module? I just know how to embed java code with the <% %> tag. But how about jython (e.g. when used in a knowledge module task with technology = "Oracle"?
    I appreciate your help.
    best regards,
    Hans

    So Firstly I have never done this in KM but it works well in Procedure so I think it would work in a KM but I'm not sure.
    So I will show you an exemple which will be easyer than lot of explanation.
    This exemple is a step of a procedure which is supposed to send an email if there is an error in an execution.
    This Step retrieve informations about the execution as the error message or the execution context...
    In the Target Command :
    Technology= Jython
    I have :
    EmailBody = EmailBody + r'''<TR><TD><CENTER>#NO</CENTER></TD><TD>#SESS_NAME</TD><TD>#STEP_NAME
    </TD><TD>#CONTEXT</TD><TD>#DEBUT</TD><TD>#MSG</TD></TR>'''
    Contexte = '#CONTEXT'.
    --> the #variable are the informations that I will extract in the source.
    In the Source Command :
    Technology = Oracle .
    SELECT L.SESS_NO || ' / ' || L.NNO "NO", STEP_NAME, SESS_NAME, SS.CONTEXT_CODE "CONTEXT", L.STEP_BEG "DEBUT", X.TXT "MSG", L.step_rc "RC"
    FROM <%=snpRef.getObjectName("L", "SNP_STEP_LOG", "D")%> L,
    <%=snpRef.getObjectName("L", "SNP_SESS_STEP", "D")%> SS,
    <%=snpRef.getObjectName("L", "SNP_SESSION", "D")%> S,
    <%=snpRef.getObjectName("L", "SNP_EXP_TXT", "D")%> X
    WHERE L.SESS_NO = <%=snpRef.getSession("SESS_NO")%> AND
    L.SESS_NO = SS.SESS_NO AND L.NNO = SS.NNO AND S.SESS_NO = L.SESS_NO AND
    STEP_STATUS = 'E' and L.I_TXT_STEP_MESS=X.I_TXT and X.TXT_ORD=0
    And with this the Jython keep the information of the Query...
    So I would like to apologize cause in my last post I have inversed the Target and the Source... Sorry. Hope that your problem didn't come from here...
    Evidently you will have SQL as Source and Jython as Target...

  • For server Eagle-PROD-Instance, the Node Manager associated with machine

    I have a wlst script that creates a domain and a managed server. I associate the server with a machine that's attached to a node manager. It creates the managed server fine but when I try and start it I get this error
    For server Eagle-PROD-Instance, the Node Manager associated with machine Eagle-Machine is not reachable.
    All of the servers selected are currently in a state which is incompatible with this operation or are not associated with a running Node Manager or you are not authorized to perform the action requested. No action will be performed.
    The machine is associated with the Node Manager and the NM is running. I can start the managed server from the command line, but not from the admin console
    This is the script, am I missing something?
    Thanks
    name: createManagedServer.py
    description: This script create the weblogic domain, and executes each weblogic queue module
    subfile. it reads a property file : weblogic_wlst.properties for server domain information
    author     : mike reynolds - edifecs 2011
    created     : April 8th 2011
    import sys
    from java.lang import System
    from java.util import Properties
    from java.io import FileInputStream
    from java.io import File
    from weblogic.management.security.authentication import UserEditorMBean
    from weblogic.management.security.authentication import GroupEditorMBean
    from weblogic.management.security.authentication import UserPasswordEditorMBean
    # Loads the contents a properties file into a java.util.Properties
    # configPropFile = "weblogic_wlst.properties"
    def loadPropertiesFromFile(configPropFile):
         configProps = Properties()
         propInputStream = FileInputStream(configPropFile)
         configProps.load(propInputStream)
         propInputStream.close()
         return configProps
    def getProperties():
         importConfigFile = sys.argv[1]
         print importConfigFile
         domainProps = loadPropertiesFromFile(importConfigFile)
         properties = Properties()
         input = FileInputStream(importConfigFile)
         properties.load(input)
         input.close()
         return properties
    def create_users(username, password, description):
    # create admin user
    cmo.getFileRealms()
    try:
    userObject=cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider("DefaultAuthenticator")
    userObject.createUser(username,password,description)
    print "Created user " + username + "successfully"
    except:
    print "check to see if user " + username + " exists "
    def add_user_to_group(username):
    print "Adding a user to group ..."
    cmo.getFileRealms()
    try:
    userObject2 = cmo.getSecurityConfiguration().getDefaultRealm().lookupAuthenticationProvider("DefaultAuthenticator")
    userObject2.addMemberToGroup('Administrators',username)
    print "Done adding user " + username
    except:
    print "check to see if user " + username + " is already in group "
    def connect_server(user,pw,url):
              connect(user,pw,url)
    def create_machine():     
    try:
    print 'Creating machine' + machine
    # cd('/')
    # create(machine, 'Machine')
    mach = cmo.createUnixMachine(machine)
    mach.setPostBindUIDEnabled(true)
    mach.setPostBindUID('oracle')
    mach.setPostBindGIDEnabled(true)
    mach.setPostBindGID('oracle')
    mach.getNodeManager().setNMType('ssl')
    except:
         print "machine exists"
    def build_domain():
    ### Read Basic Template
    WL_HOME = "C:/Oracle/Middleware/wlserver_10.3"     
    readTemplate(WL_HOME+"/common/templates/domains/wls.jar")
    template=WL_HOME+"/common/templates/domains/wls.jar"
    cd('Servers/AdminServer')
    set('ListenAddress', adminServerAddress)
    set('ListenPort', int(adminServerPort))
    cd('/')
    cd('/Security/base_domain/User/weblogic')
    cmo.setPassword('w3bl0g1c')
    ### Write Domain
    setOption('OverwriteDomain', 'true')
    print "writing domain " + domainDir + domainName
    writeDomain(domainDir+'/'+domainName)
    closeTemplate()
    create_machine()
    arg = "Arguments=\" -server -Xms256m -Xmx768m -XX:MaxPermSize=256m -da\""
    prps = makePropertiesObject (arg)
    domain = domainDir + domainName
    try:
         #startNodeManager()
    #nmConnect('weblogic', 'w3bl0g1c', host, 5556, 'AdminServer', domain, 'ssl')
    # nmStart('AdminServer')
    startServer('AdminServer', domainName, url, adminUser, adminPassword, domainDir, 'true')
    except:
    print "could not connect to Node Manager"
    def create_server():     
    # get server instance properties
    name = properties.getProperty("serverName")
    domain = properties.getProperty("domainName")
    port = properties.getProperty("listenPort")
    address = properties.getProperty("listenAddress")
    servermb=getMBean("Servers/" + name)
    machine = properties.getProperty("machineName")
    nodePort = properties.getProperty("nodeManagerPort")
    domainDir = properties.getProperty("domainDir")
    if servermb is None:
              startEdit()
              cd('/')
              cmo.createServer(name)
              cd('/Servers/'+ name)
              cmo.setListenAddress(address)
              cmo.setListenPort(int(port))
              cd('/')
              cmo.createMachine(machine)
              cd('/Machines/' + machine + '/NodeManager/' + machine )
              cmo.setNMType('Plain')
              cmo.setListenAddress(address)
              cmo.setListenPort(int(nodePort))
              cmo.setDebugEnabled(false)
              cd('/Servers/' + name)
              cmo.setListenPortEnabled(true)
              cmo.setJavaCompiler('javac')
              cmo.setClientCertProxyEnabled(false)
              cmo.setMachine(getMBean('/Machines/' + machine ))
              cmo.setCluster(None)
              cd('/Servers/' + name + '/SSL/' + name)
              cd('/Servers/' + name + '/ServerDiagnosticConfig/' + name)
              cmo.setWLDFDiagnosticVolume('Low')
              cd('/Servers/' + name)
              cmo.setCluster(None)
              cd('/Servers/' + name + '/SSL/' + name)
              cmo.setEnabled(false)
    ### Executable Script
    ### CreateDomain.py
    ### Define constants
    WL_HOME = "C:/Oracle/Middleware/wlserver_10.3"
    print "Starting the script ..."
    print "Getting properties ... "
    properties = getProperties()
    adminServerAddress = properties.getProperty("adminServerAddress")
    adminServerPort = properties.getProperty("adminServerPort")
    adminUser = properties.getProperty("adminUser")
    adminPassword = properties.getProperty("adminPassword")
    edifecsUser = properties.getProperty("edifecsUser")
    edifecsPassword = properties.getProperty("edifecsPassword")
    host = properties.getProperty("host")
    domainDir = properties.getProperty("domainDir")
    domainName = properties.getProperty("domainName")
    user = properties.getProperty("username")
    pw = properties.getProperty("passwd")
    url = properties.getProperty("adminURL")
    machine = properties.getProperty("machineName")
    print "Building the domain..."
    build_domain()
    print "Connecting to server"     
    connect_server(adminUser, adminPassword, url)
    edit()
    startEdit()
    # create managed server
    # create_machine()
    create_server()
    print "Creating users"
    # starting configuration tree
    serverConfig()
    create_users(adminUser, adminPassword, "Administrator")
    add_user_to_group(adminUser)
    create_users(edifecsUser, edifecsPassword,"Administrator")
    add_user_to_group(edifecsUser)
    # have to restart edit to save config
    edit()
    startEdit()
    # nmKill('AdminServer')
    print "saving configuration"
    try:
         save()
         activate(block="true")
         print "script returns SUCCESS"
         print "admin server is running"
         print "starting server " + name
         startServer(domainName, name ,url,adminUser, adminPassword, domainDir,'true')
    except:
         print "failed to save server"
         dumpStack()

    Actually the cert is coming from your Dev machine but it is sending the Prod cert.
    What cert is used by your admin server ? It should match the host name.
    So your Dev machine is apparently using a copy of the prod cert / keystore rather than using its own DEV cert. It's not clear from your post whether this is the nodemanager using the wrong cert, or the managed server. So both should be checked.
    The managed servers need to be using a cert that matches their host name. If you have a managed server on VM-BEA-DEV, then the cert needs to be CN=VM-BEA-DEV. You can also use a load-balancer CN name in the cert if you have the cluster's HTTP values set to match.
    In your nodemanager.properties, are you explicitly accessing keystores, such as with:
    KeyStores=CustomIdentityAndJavaStandardTrust
    CustomIdentityAlias=some_alias
    CustomIdentityKeyStoreFileName=some_path_to_keystore
    CustomIdentityKeyStorePassPhrase={3DES}...
    CustomIdentityKeyStoreType=jks
    CustomIdentityPrivateKeyPassPhrase={3DES}
    In my multi-machine clusters, I have multiple certificates such as:
    admin machine1:
    has a cert for use by the admin server and NM that matches the host name ( with node manager.properties entries such as the above )
    has a 2nd cert that matches the load-balancer name for the cluster - used by the managed servers
    all other machines:
    has a cert for use by NM that matches the host name ( with node manager.properties entries such as the above )
    has a 2nd cert that matches the load-balancer name for the cluster - used by the managed servers

  • Pagination of output  php code with sql code

    if one program of php including sql query
    it seems to output wrong .(means some data will be calculated sum)
    if php code output all data in one page.pagination
    it seems to output right(means some data will be calculated sum)
    if there has column of company including two companies of A and B.
    and if each page output 3 lines while A company has 4 lines in sql query,so
    the last line of A company will output in second page,
    i want to calculate A company including 4 lines sum
    how to calculate sum of company of A in second page.
    i think it will be a good interesting question of php code with sql code.
    who can solution thus question ?
    thanks !

    Hi,
    for Example:
    SELECT sum(quantity * price)
    FROM orders
    WHERE COMPANY = 'A';
    This will give you the total amount for company A.
    But remember that your example table will give no output, since you have no price column. So you must decide, what which sum to calculate.
    A sum only calculated over the quantity makes IMHO no sense, because there are apples and bananas ...
    Greetings from Hamburg
    Thorsten Körner

  • My iPod touch tells me to connect it to iTunes, but iTunes tells me to write the 4 digit code on the iPod, which is locked.

    My iPod touch tells me to connect it to iTunes, but iTunes tells me to write the 4 digit code on the iPod. Problem is that the iPod only shows an image of the iTunes logo, and I can't write the code anywhere.

    The link is not really broken.  I get:
    "Due to a scheduled upgrade of Apple's support systems, some features of the website are currently unavailable. We apologize for any inconvenience."
    What happens when you try to restore the iPod via iTunes?  Error messages?

  • For server the Node Manager associated with machine is not reachable

    Hello all,
    I am getting this error, when i start my Managed Server which is in shutdown state
    For server SAA-Dev-1, the Node Manager associated with machine vm-bea-dev is not reachable.
    All of the servers selected are currently in a state which is incompatible with this operation or are not associated with a running Node Manager. No action will be performed.
    The configuration details are
    i am using weblogic 9.2 MP3 version in windows 2k3 server.
    It has a machine vm-bea-dev, a cluster cluster-saa-dev, to which both the managed servers saa-dev-1 and saa-dev-2 are assigned. There are 3 applications deployed onto managed Server 1 and 1 for managed Server 2.
    Managed Server 1 is in shutdown state, and when i start the server, it gives the error specified below
    For server SAA-Dev-1, the Node Manager associated with machine vm-bea-dev is not reachable.
    All of the servers selected are currently in a state which is incompatible with this operation or are not associated with a running Node Manager. No action will be performed.
    The same for Managed Server 2 too, and this server is in Admin State, i dont know how it went into that state.
    Can somebody please help me reslove it.
    Thanks in advance

    Actually the cert is coming from your Dev machine but it is sending the Prod cert.
    What cert is used by your admin server ? It should match the host name.
    So your Dev machine is apparently using a copy of the prod cert / keystore rather than using its own DEV cert. It's not clear from your post whether this is the nodemanager using the wrong cert, or the managed server. So both should be checked.
    The managed servers need to be using a cert that matches their host name. If you have a managed server on VM-BEA-DEV, then the cert needs to be CN=VM-BEA-DEV. You can also use a load-balancer CN name in the cert if you have the cluster's HTTP values set to match.
    In your nodemanager.properties, are you explicitly accessing keystores, such as with:
    KeyStores=CustomIdentityAndJavaStandardTrust
    CustomIdentityAlias=some_alias
    CustomIdentityKeyStoreFileName=some_path_to_keystore
    CustomIdentityKeyStorePassPhrase={3DES}...
    CustomIdentityKeyStoreType=jks
    CustomIdentityPrivateKeyPassPhrase={3DES}
    In my multi-machine clusters, I have multiple certificates such as:
    admin machine1:
    has a cert for use by the admin server and NM that matches the host name ( with node manager.properties entries such as the above )
    has a 2nd cert that matches the load-balancer name for the cluster - used by the managed servers
    all other machines:
    has a cert for use by NM that matches the host name ( with node manager.properties entries such as the above )
    has a 2nd cert that matches the load-balancer name for the cluster - used by the managed servers

  • Strange Behavior with SQL/XML

    Our University have had for quite some time now a rather difficult situation with a very significant course handbook web site that creates HTML based on database XSL transformation of XML content generated with SQL/XML. The database is 10.2.0.2.0. The HTML is passed via a distributed database link to an Oracle Portal dynamic portlet for display. Some of the derived XML originates from XML Schema registered instance documents and some from relational storage.
    Let me explain. Occasionally after a period of operating (could be one week, sometimes even less) we will experience a problem whereby our derived XML content (just prior to PL/SQL database XSL transformation) will develop a parsing problem. Once this happens to one XSL transform of a course then subsequently it happens for every course viewed/transformed there-after.
    Recently I experienced the problem and then added the XMLNS argument to the extract function. That seemed to fix things and I thought I had it licked.
    Today we started to get the same problem again. The error reported was:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00242: invalid use of ampersand ('&') character (use &amp;)
    Error at line 1
    Now this might have been reasonable for one course. But every course reported the same problem there-after without fail. I managed to fix the issue but in a way that really doesn't seem to make sense. What I did was to alter the SQL/XML statement by adding in an extra XMLEMENT and then to recompile the function that returns an XMLTYPE based on the execution of the SQL statement. After compiling the function everything returned to normal.
    This doesn't seem to make sense.
    I am pretty desperate for help on this. I really don't know how to progress the solution. I don't get much joy from Oracle Support as our application covers too many high tech areas. This is really shaking confidence in our organization's use of Oracle technology.

    Hi Mark.
    We've isolated the problem a bit more now and there is a support SR (6089662.994). At this stage we are unable to reproduce - I am testing out an export though. The problem only occurs when a certain condition has been reached. Once that happens then extraneous characters are produced in the XMLTYPE feed returned by a function. We are not at all sure about how to make this condition occur. This doesn't just happen with one SQL/XML cursor - I've seen it happen with 3 different cursors. All are located in the same function that returns an XMLTYPE.
    We are convinced the problem lies with one or more SQL/XML cursors located in the same function. Once one of these cursors malfunctions it will produce XML that is not well formed OR on occasion has content omitted but is well formed (there often seem to be extraneous characters). When the XML content is not well formed then the parsing stage (dbms_xmlparser.parseclob(myparser, xml_clob)) of XSL transformation crashes. This error then propagates to the dynamic portlet in Oracle Portal thus removing the content on the page. This happens for every execution of the cursor while the condition manifests, the only difference between calls being bind variables.
    The interesting thing is that the error if left to itself will eventually stop. The cursor seems to right itself eventually. On the last occurrence, the problem commenced at 4.30am and went for 3.5 hrs and then seemed to right itself.

  • Is there any way to upload Tariff Code (with multiple XML files) from application server?

    Hi All,
    Is there any way to upload Tariff Code (with multiple XML files) from application server?. Its urgent.
    Regards,
    Jatin

    Hi Jatin,
    Yes, of course you can upload multiple files for tariff codes.
    This can be done by the below path:-
    SAP GTS Cockpit(tcode-/sapsll/menu_legal)-->Customs Management-->Classification-->Classification Master Data-->Upload Tariff Code Numbers from XML file(tocde- /SAPSLL/LLNS_UPL101).
    In the above area after browsing and choosing the first file, please select multiple check box to choose more files as well. Then you can further select your application server and upload all those files in one go.
    PS:- Although, we have an option to upload multiple such files but actually we should avoid multiple file uploads due to various reasons. Hence, please take utmost care during such procedure.
    Regards,
    Aman

  • How do I create an undeclared namespace node with sql/xml?

    I have to interact with a .NET web service that is expecting to have an xml node with an undeclared namespace, i.e. <address xmlns=""> I figured that I could create this by using XMLATTRIBUTES ( '' AS "xmlns") but a null attribute will not be added to the attribute listing. This works fine for other xmlns entries that contain values. Without this undeclared namespace node, the web service reports an Internal SOAP failure message, so I have to include it. Do I have to resort to manually injecting this null attribute via DOM after I produce the xml? I'm using SQL/XML query generate the xml as a view which gives me the entire packet for this document/literal web service OTHER THAN this missing undeclared namespace element.
    Any tips/suggestions would be helpful! Thanks a bunch, and have a Happy Holiday Season.
    Eric

    You can use UTL_RAW package.
    First, convert string to raw with UTL_RAW.CAST_TO_RAW, then using UTL_RAW.CONVERT to convert raw to utf-8 and finally UTL_RAW.CAST_TO_VARCHAR to get utf-8 string.
    Regards

  • How to Populate the JTable Object programatically with SQL Results

    I'm wondering if someone could help me on how to populate the JTable Object with SQL Results wherein the Row of tjhe JTable object is automatically adjusted depending on how many records you have queried.
    Thanks in advance and God bless! (",)
    * frmMain.java
    * Created on October 4, 2006, 6:15 AM
    package tds;
    import java.io.*;
    import java.awt.Toolkit;
    import javax.swing.JFrame;
    import javax.imageio.*;
    import javax.swing.JFrame;
    import java.sql.*;
    import javax.swing.table.DefaultTableModel;
    * @author Dexter.Carlit
    public class frmMain extends javax.swing.JFrame {
    private Connection connection = null;
    private DefaultTableModel model;
    /** Creates new form frmMain */
    public frmMain() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
    jSplitPane = new javax.swing.JSplitPane();
    jScrollPane1 = new javax.swing.JScrollPane();
    jPanel3 = new javax.swing.JPanel();
    jScrollPane2 = new javax.swing.JScrollPane();
    jTree1 = new javax.swing.JTree();
    jTabbedPane1 = new javax.swing.JTabbedPane();
    jPanel1 = new javax.swing.JPanel();
    jPanel4 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    jLabel2 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jTextField2 = new javax.swing.JTextField();
    jLabel3 = new javax.swing.JLabel();
    jTextField3 = new javax.swing.JTextField();
    jLabel4 = new javax.swing.JLabel();
    jTextField4 = new javax.swing.JTextField();
    jPanel5 = new javax.swing.JPanel();
    jScrollPane3 = new javax.swing.JScrollPane();
    jGrid = new javax.swing.JTable();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jProgressBar1 = new javax.swing.JProgressBar();
    jPanel2 = new javax.swing.JPanel();
    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowOpened(java.awt.event.WindowEvent evt) {
    formWindowOpened(evt);
    getAccessibleContext().setAccessibleName("frmMain");
    jSplitPane.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
    jSplitPane.setDividerLocation(200);
    jSplitPane.setDividerSize(10);
    jScrollPane2.setViewportView(jTree1);
    org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
    jPanel3.setLayout(jPanel3Layout);
    jPanel3Layout.setHorizontalGroup(
    jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jPanel3Layout.createSequentialGroup()
    .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 916, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    jPanel3Layout.setVerticalGroup(
    jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE)
    jScrollPane1.setViewportView(jPanel3);
    jSplitPane.setLeftComponent(jScrollPane1);
    jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
    jLabel1.setText("First Name:");
    jLabel2.setText("Last Name:");
    jLabel3.setText("Position :");
    jLabel4.setText("Department:");
    jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("Search Results"));
    jGrid.setModel(new javax.swing.table.DefaultTableModel(
    new Object [][] {
    new String [] {
    "LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
    jGrid.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
    jGrid.setColumnSelectionAllowed(true);
    jGrid.setName("");
    jGrid.setTableHeader(jGrid.getTableHeader());
    jScrollPane3.setViewportView(jGrid);
    jScrollPane3.getAccessibleContext().setAccessibleName("rset");
    org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
    jPanel5.setLayout(jPanel5Layout);
    jPanel5Layout.setHorizontalGroup(
    jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
    jPanel5Layout.setVerticalGroup(
    jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 175, Short.MAX_VALUE)
    jButton1.setText("Find");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
    jButton1MouseClicked(evt);
    jButton2.setText("Clear");
    jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
    public void mouseClicked(java.awt.event.MouseEvent evt) {
    jButton2MouseClicked(evt);
    org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
    jPanel4.setLayout(jPanel4Layout);
    jPanel4Layout.setHorizontalGroup(
    jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel4Layout.createSequentialGroup()
    .addContainerGap()
    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
    .add(jLabel1)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jTextField1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE))
    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
    .add(jLabel2)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jTextField2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
    .add(1, 1, 1))
    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4Layout.createSequentialGroup()
    .add(jLabel3)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jTextField3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jLabel4)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jTextField4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE))
    .add(jPanel4Layout.createSequentialGroup()
    .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 66, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
    .addContainerGap())
    jPanel4Layout.linkSize(new java.awt.Component[] {jButton1, jButton2}, org.jdesktop.layout.GroupLayout.HORIZONTAL);
    jPanel4Layout.setVerticalGroup(
    jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jPanel4Layout.createSequentialGroup()
    .addContainerGap()
    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(jLabel1)
    .add(jTextField1))
    .add(18, 18, 18)
    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(jLabel2)
    .add(jTextField2))
    .add(16, 16, 16)
    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(jLabel3)
    .add(jTextField3)
    .add(jLabel4)
    .add(jTextField4))
    .add(14, 14, 14)
    .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
    .add(jButton2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
    org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout.setHorizontalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
    .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .add(org.jdesktop.layout.GroupLayout.LEADING, jProgressBar1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 438, Short.MAX_VALUE))
    .addContainerGap())
    jPanel1Layout.setVerticalGroup(
    jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(org.jdesktop.layout.GroupLayout.TRAILING, jPanel1Layout.createSequentialGroup()
    .addContainerGap()
    .add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
    .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
    .add(jProgressBar1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
    jTabbedPane1.addTab("Search", jPanel1);
    org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
    jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(0, 458, Short.MAX_VALUE)
    jPanel2Layout.setVerticalGroup(
    jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(0, 401, Short.MAX_VALUE)
    jTabbedPane1.addTab("Directory", jPanel2);
    jSplitPane.setRightComponent(jTabbedPane1);
    org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jSplitPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 675, Short.MAX_VALUE)
    layout.setVerticalGroup(
    layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
    .add(jSplitPane)
    pack();
    }// </editor-fold>//GEN-END:initComponents
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
    }//GEN-LAST:event_jButton1ActionPerformed
    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
    jGrid.setModel(new javax.swing.table.DefaultTableModel(
    new Object [][] {
    {null, null, null, null, null, null, null, null, null, null},
    {null, null, null, null, null, null, null, null, null, null},
    {null, null, null, null, null, null, null, null, null, null},
    {null, null, null, null, null, null, null, null, null, null}
    new String [] {
    "LName", "FName", "Position", "Department", "Office No", "Local No", "Office Mobile No", "Home No", "MobileNo", "Email Address"
    jGrid.updateUI();
    }//GEN-LAST:event_jButton2MouseClicked
    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
    try {
    //Load and register SQL Server driver
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    //Establish a connection
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://X.X.X.X:1433","MyAccount","MyPassword");
    //Create a Statement object
    Statement sql_stmt = connection.createStatement();
    //Create a ResultSet object, execute the query and return a
    // resultset
    ResultSet rset = sql_stmt.executeQuery("SELECT * FROM EpxDirectory..Directory Order By LName");
    // Populates a JTABLE Object
    int i=0;
    while (rset.next()){
    String LName = rset.getString(1);
    String FName = rset.getString(2);
    String Position = rset.getString(3);
    String Dept_Code = rset.getString(4);
    String OffPhoneNo = rset.getString(5);
    String LocalNo = rset.getString(6);
    String OffMobileNo = rset.getString(7);
    String HomePhoneNo = rset.getString(8);
    String MobileNo = rset.getString(9);
    String Email = rset.getString(10);
    jGrid.updateUI();
    jGrid.setValueAt(rset.getString(1).trim(),i,0);
    jGrid.setValueAt(rset.getString(2).trim(),i,1);
    jGrid.setValueAt(rset.getString(3).trim(),i,2);
    jGrid.setValueAt(rset.getString(4).trim(),i,3);
    jGrid.setValueAt(rset.getString(5).trim(),i,4);
    jGrid.setValueAt(rset.getString(6).trim(),i,5);
    jGrid.setValueAt(rset.getString(7).trim(),i,6);
    jGrid.setValueAt(rset.getString(8).trim(),i,7);
    jGrid.setValueAt(rset.getString(9).trim(),i,8);
    jGrid.setValueAt(rset.getString(10).trim(),i,9);
    i++;
    //Close the ResultSet and Statement
    rset.close();
    sql_stmt.close();
    //Close the database connection
    connection.close();
    System.out.println(Integer.toString(i) + " rows found");
    } catch(Exception e) {
    System.out.println("Failed to connect; Please view Stack Trace");
    e.printStackTrace();
    }//GEN-LAST:event_jButton1MouseClicked
    private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
    }//GEN-LAST:event_formWindowOpened
    public static void run(){
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    frmMain frmMain = new frmMain();
    frmMain.setLocationRelativeTo(null); // Center the JFrame on the
    frmMain.setVisible(true);
    private void exitApplication() {
    // try {
    // //gui.putStatus("Closing the connection....please wait.....");
    // if(connection != null) {
    // // connection.close(); //Closing the connection object.
    // } catch(SQLException ex) { //Trap SQLException
    // //gui.putStatus(ex.toString());
    System.exit(0); //Exit the aplication
    * @param args the command line arguments
    public static void main(String args[]) {
    run();
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JTable jGrid;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JSplitPane jSplitPane;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTextField jTextField1;
    private javax.swing.JTextField jTextField2;
    private javax.swing.JTextField jTextField3;
    private javax.swing.JTextField jTextField4;
    private javax.swing.JTree jTree1;
    // End of variables declaration//GEN-END:variables
    }

    Use code tags.
    Don't mix GUI and JDBC together. Split them out into separate classes.
    You have a good start, but you will need to loop through your resultset and also pull the ResultSet metaData for you column headings

  • Change the mapping generation code from sql*loader to pl/sql

    I want to use a mapping with a flat file operator to generate pl/sql code even if a mapping generate sql*loader code as default.
    I tried to change the Language generation property of the mapping but an API8548 error message is shown. The suggested solution by OWB is to change the language generation code in the property inspector of the mapping.
    I can't use external table because I have to work with a remote machine.
    What i have to do to change the generation code from SQL*Loader to PL/SQL?

    How about breaking this out into 2 mappings? In the first mapping, map a flat file operator to an table using SQL*Loader code. Then define a second mapping using the table as source and therefore generate PL/SQL. Then use process flow to launch the 2nd map to run after completion of first.

  • How to write the new records not with existing records.

    hi,
    I have a script.If i execute the script it writes the records.but its writing with the exisiting records.It writes not only the new records but also the old records.
    for eg: the exisiting records are:
    1111115-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111116-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111117-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111118-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111119-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    but now what happend is the new records such as
    1111116-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111117-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111118-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111119-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    it gets appended with the old existing records,
    1111117-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111118-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111119-2,USD,DINESH,1,1,,,,9,,,,123456184001,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111113-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111114-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111115-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111116-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111117-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111118-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    1111119-2,USD,DINESHBABU,1,1,,,,9,,,,123456184003,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,9999,,,,
    there will be some problem happens when we are going to upload a bulk data of say 25000 records.if its gonna update 20000 records,rest 5000 records i have to do it in next step,if this is going to happen then the first 20000 records will be displayed forever.because it have the capacity to write 20000 records.thenext 500 records will not be written.so there is a chance of redundancy.how to avoid this redundancy while running this script
    my script is
    create or replace procedure input_tables(table1 in varchar2)
    is
    str varchar2(32767);
    cnt number(2);
    cursor c1(tname in varchar2)
    is
    select column_name
    from all_tab_columns
    where table_name = tname
    order by column_id;
    rec c1%rowtype;
    begin
    cnt:= 1;
    str:= 'declare '||
    'cursor c2 '||
    'is '||
    'select ';
    open c1(table1);
    loop
    fetch c1 into rec;
    exit when c1%notfound;
    if cnt = 1 then -- Added New
    str:= str||rec.column_name; -- Added New
    cnt:= cnt + 1; -- Added New
    else -- Added New
    str:= str||'||'',''||'||rec.column_name; -- Added New
    end if; -- Added New
    end loop;
    close c1;
    str:= str||' SRC from '||table1||';'||
    ' r2 c2%rowtype;'||
    ' ft UTL_FILE.file_type;'||
    ' str2 varchar2(200);'|| --Added New
    ' begin '||
    ' ft := UTL_FILE.fopen(''SAMPLE'',''OUTPUT.csv'',''w'');'||
    ' for r2 in c2'||
    ' loop '||
    ' UTL_FILE.put_line(ft,r2.SRC);'||
    ' end loop;'||
    ' UTL_FILE.fclose(ft);'||
    ' end;';
    execute immediate(str);
    end;
    thanks,
    Ratheesh.

    Hi!
    U can check the following script --
    create or replace procedure input_tables(table1 in varchar2,start_col in number,last_col in number)
    is
         str varchar2(32767);
         cnt number(2);
         cursor c1(tname in varchar2)
         is
           select column_name
           from all_tab_columns
           where table_name = tname
           order by column_id;
         rec c1%rowtype;
    begin
         cnt:= 1;
         str:= 'declare '||
         'cursor c2 '||
         'is '||
         'select ';
         open c1(table1);
         loop
              fetch c1 into rec;
              exit when c1%notfound;
                   if cnt = 1 then -- Added New
                        str:= str||rec.column_name; -- Added New
                        cnt:= cnt + 1; -- Added New
                   else -- Added New
                        str:= str||'||'',''||'||rec.column_name; -- Added New
                   end if; -- Added New
         end loop;
         close c1;
         str:= str||' SRC from '||table1||
         ' where rownum between '||start_col||' and '||last_col||';'|| -- Added New
         ' r2 c2%rowtype;'||
         ' ft UTL_FILE.file_type;'||
         ' str2 varchar2(200);'|| --Added New
         ' begin '||
         ' ft := UTL_FILE.fopen(''SAMPLE'',''OUTPUT.csv'',''w'');'||
         ' for r2 in c2'||
         ' loop '||
         ' UTL_FILE.put_line(ft,r2.SRC);'||
         ' end loop;'||
         ' UTL_FILE.fclose(ft);'||
         ' end;';
         execute immediate(str);
    end;
    / To print first ten rows --
    exec input_tables('EMP',1,10);  --first 10 rowsTo print next remain rows --
    exec input_tables('EMP',11,15);N.B: No tested....
    Regrads.
    Satyaki De.

  • Can we write client object model code with Server object model?

    Hi everyone,
    I have to create one timer job using client object model (C#) in Sharepoint 2010 template on feature activation. Is it possible to write the code of client object in sharepoint empty project to create timer job? If yes/no? then why?
    Thanks in advance!!!

    Hi ShindeK,
    Yes you can used CSOM in Sharepoint but Timer jobs run directly on the server. The Client Side Object Model is a wrapper that brokers its calls to the server via the built in web services that SharePoint provides.
    You will not get any performance gains in this scenario using CSOM. You should use the full server object model of SharePoint
    SharePoint 2010 also has three Client Object Models (Managed, Silverlight, JavaScript) which are meant to be used by code accessing SharePoint remotely.
    --You can also used powershell script in timer job
    Chekc the link which cann help you step by step CSOM in Sharepoint timer job
    http://www.youtube.com/watch?v=Z7wHj-bSk0g
    You can also try the below link....
    https://bramdejager.wordpress.com/2013/08/02/using-csom-and-powershell-to-query-sharepoint-online-or-on-premise/
    http://stackoverflow.com/questions/3656920/run-sharepoint-timer-jobs-from-powershell
    Please mark the Answer and Vote me if you think that it will help you to resolved your issue

  • How to have the name of code PL/SQL

    I make a generique tools for logging in PL/SQL : http://log4plsql.sourceforge.net/
    1. how to have the name of the code PL/SQL which is run ?
    2. how have a pl/sql call stack dynamically ?
    proc1 -> proc2 -> package1.proc3

    For 2, check if DBMS_UTILITY.FORMAT_CALL_STACK will work for you:
    http://tahiti.oracle.com/pls/db901/db901.tabbed?section=32613
    For 1, is there anything in DBMS_DEBUG that would help?
    http://otn.oracle.com/docs/products/oracle9i/doc_library/901_doc/appdev.901/a89852/dbms_deb.htm#1015019

  • How to restrict the BBPMAININT t code with diplay mode in srm system.

    Hi experts,
    I want to restrict the T code BBPMAININT : Maintain Business Partner with DISPLAY mode in SRM system?
    Action Taken:1. I have restricted with "03 Activity"  of all check and maintainauthorization objects for this  tocde .
    2. I have performed the authorization trace also, there also I have not found any new objects.
    Here are list of auth object I have restricted:
    BBP_FUNCT
    BBP_PD_AUC
    BBP_PD_BID
    BBP_PD_CNF
    BBP_PD_CTR
    BBP_PD_INV
    BBP_PD_PCO
    BBP_PD_PO
    BBP_PD_QUO
    But I have not  clearly understand of the object : BBP_FUNCT.
    In this Object, I have maintained BE_F4_HELP value only.   And rest of the auth object I have restricted to 03 activity only.
    But still users are able to acess the CREATE and MANAGE buttons.
    So how Can I restrict the this T code in display mode?
    Please suggest me...
    Thanks in advance.
    Regards,
    Siva

    Dear Poster
    Your thread has had no response since it's creation over
    2 weeks ago, therefore, I recommend that you either:
    - Rephrase the question.
    - Provide additional Information to prompt a response.
    - Close the thread if the answer is already known.
    Thank you for your compliance in this regard.
    Jason Boggans
    SAP SRM SDN Moderator

Maybe you are looking for

  • Linked Report Object Error

    Hi,I am trying to use LROAddObject and the sts is not 0.The sts value = 1042015 which is error code for Net_Tcp_Name.Does anyone know what that status code mean and what should I do to return sts 0. I am also sending my code.Desc.userName = "Admin"De

  • IPhoto's deficiencies: Archiving and streamlining

    I feel there are two pressing deficiencies in iPhoto that a future release must address. Both are due to the burgeoning size of my iPhoto library. 1. iPhoto offers to archive photos to CD or DVD, but Apple have clearly indicated Optical media is on i

  • Canon HG21 and Final Cut Pro

    Anyone out there using the Canon HG21 and importing the video into FCP? What settings are being used and is there problems when bringing the video in? Getting a Canon HG21 and plan on bringing HD content using the FCP as my editor, just checking to s

  • Recent iPhoto update

    I don't know why iPhotos needed a update, now all my pics are screwed up. Please put it back the way it was. ty.

  • Recover the lion recovery partition?

    Hi all, After removing bootcamp partition my lion recovery partition is missing. Is there any way to recover the recovery partition? Thanks..