Applying stylesheet to XMLType using SQL operator

How can I apply a stylesheet to a XMLType in the database using a SQL query?
I am using Oracle 9i Release 2.
I have seen it referenced in many different PDF's from Oracle but haven't
seen any code examples.
Any help would be very appreciated!
Best regards
Christer Nordvik
System Developer

Just read the fabulous manual (in this case, A96616-01: Oracle9i API Reference - XDK and Oracle XML DB, page 24-9); or search for "transform". One of my working examples:
select data1.transform(xdburitype('/age/default.xslt').getxml(), NULL) from data1 data1; Make sure you use an alias for the table name (I just use the same name as the real table).
Age Jan

Similar Messages

  • Error while using between operator with sql stmts in obiee 11g analytics

    Hi All,
    when I try to use between operator with two select queries in OBIEE 11g analytics, I'm getting the below error:
    Error Codes: YQCO4T56:OPR4ONWY:U9IM8TAC:OI2DL65P
    Location: saw.views.evc.activate, saw.httpserver.processrequest, saw.rpc.server.responder, saw.rpc.server, saw.rpc.server.handleConnection, saw.rpc.server.dispatch, saw.threadpool.socketrpcserver, saw.threads
    Odbc driver returned an error (SQLExecDirectW).
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27002] Near <select>: Syntax error [nQSError: 26012] . (HY000)
    can anyone help me out in resolving this issue.

    Hi All,
    Thank u all for ur replies, but I dint the exact solution for what I'm searching for.
    If I use the condition as
    "WHERE "Workforce Budget"."Used Budget Amount" BETWEEN MAX("Workforce Budget"."Total Eligible Salaries") AND MAX("Workforce Budget"."Published Worksheet Budget Amount"",
    all the data will be grouped with the two columns which I'm considering in the condition.
    my actual requirement with this query is to get the required date from a table to generate the report either as daily or weekly or monthly report. If I use repository variables, variables are not getting refreshed until I regenerate the server(which I should not do in my project). Hence I have created a table to hold weekly start and end dates and monthly start and end dates to pass the value to the actual report using between operator.
    please could anyone help me on this, my release date is fast approaching.

  • How to pass variable into lov sql query using like operator

    hi.
    i want to use a lov where i want to pass a variable using like operator.
    my query is
    select empno,name from table where empno like ':ed%';
    my empno is A001 TO A199 AND B001 TO B199 so i want show either A% or B% empno
    how can i do this ?
    reagrds

    kindly press Shift+F1 at a time you face this error to see the exact Oracle error message.
    and provide us with that detail
    and its better if you start new topic for that error... because that will be new error,,,
    -- Aamir Arif
    Edited by: Aamiz on Apr 7, 2010 12:27 PM

  • Apply Stylesheet to XML Document

    Is there a way to query relational data and apply a stylesheet to it using PLSQL code and then query the results using dbms_xmlgen.getxml?

    What database version are you on?
    Convert relational data to XML instances ( / XMLType datatype), for instance via functions, like XMLElement, XMLroot, etc or dbms package; and then use the XMLtransform function to apply your stylesheet. The moment you defined your select statement, you also could create a XMLType view. Anyway this could be handled via PL/SQL and queried by dbms_xmlgen.getxml via a collection (on stack/in memory) etc...
    Pinpoint on xmltransform questions on this forum:
    Re: Most effecient way to generate XML output
    XML DB

  • Got an error while creating bind variables using sql database.

    iam going to use sql database for ADF-BC .
    i created the bind variable and apply the bind position for the corresponding variable in the view object editor.when i click test it shows me "query is valid". when i tried to run that it gives me two errors.
    1) sql error during statement preparation.(ie) select empid ,empname......from the emptable where empid like :'emp' and
    2) [Microsoft][SQl server  2000 driver  for jDBC] invalid parameter bindings
    i need help to know the solution for this...(or) is there any other way to create bind variable ......

    The 3 binding styles supported by JDev:
    Oracle Named - ie. SELECT xxxx FROM xxxx WHERE emp_id = :vEmp (note colon and variable name)
    Oracle Positional - ie SELECT xxxx FROM xxxx WHERE emp_id = :1 (note colon)
    JDBC Positional - ie SELECT xxxx FROM xxxx WHERE emp_id = ?
    Literally this query is sent to the database to execute, then the bind variables values are applied as a separate database operation. If SQL Server doesn't suport any of these binding styles, it's not going to work. As Chris Noonan suggests, try the JDBC Positional style though as you're using a JDBC driver to connect to SQL Server and it should support that style (the others are Oracle styles), and make sure you've switched the binding style on the VO query page to "JDBC Positional" too.
    You must also on the VO bind variable page define your bind variables.
    Also read the 10.1.3 JDev guide on ADF Business Components and View Object bind variables.
    CM.

  • Load XML File into temporary tables using sql loader

    Hi All,
    I have an XML file as below. I need to insert the contents into a temporary staging table using sql loader. Please advice how I need to do that.
    For example Portfolios should go into a seperate table, and all the tags inside it should be populated in the columns of the table.
    Family should go into a seperate table and all the tags inside it should be populated in the columns of the table.
    Similarly offer, Products etc.
    - <ABSProductCatalog xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <ProductSalesHierachy>
    - <Portfolios>
    - <Portfolio productCode="P1">
      <Attribute name="CatalogProductName" value="Access" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
    - <Portfolio productCode="P2">
      <Attribute name="CatalogProductName" value="Data" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
    - <Portfolio productCode="P3">
      <Attribute name="CatalogProductName" value="Voice" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
    - <Portfolio productCode="P4">
      <Attribute name="CatalogProductName" value="Wireless" />
      <Attribute name="Status" value="Active" />
      </Portfolio>
      </Portfolios>
    - <Families>
    - <Family productCode="F1">
      <Attribute name="CatalogProductName" value="Internet Access Services" />
      <Attribute name="Status" value="Active" />
    - <ParentHierarchy>
      <Item productCode="P1" modelType="Portfolio" />
      </ParentHierarchy>
      </Family>
    - <Family productCode="F2">
      <Attribute name="CatalogProductName" value="Local Access Services" />
      <Attribute name="Status" value="Active" />
    - <ParentHierarchy>
      <Item productCode="P2" modelType="Portfolio" />
      </ParentHierarchy>
      </Family>
      </Families>
    - <SubFamilies>
    - <SubFamily productCode="SF1">
      <Attribute name="CatalogProductName" value="Business Internet service" />
      <Attribute name="Status" value="Active" />
    - <ParentHierarchy>
      <Item productCode="F1" modelType="Family" />
      </ParentHierarchy>
      </SubFamily>
      </SubFamilies>
    - <ProductRefs>
    - <ProductRef productCode="WSP1" modelType="Wireline Sales Product">
      <ActiveFlag>Y</ActiveFlag>
    - <ProductHierarchy>
      <SalesHierarchy family="F1" subFamily="SF1" portfolio="P1" primary="Y" />
      <SalesHierarchy family="F2" portfolio="P2" primary="N" />
      <FinancialHierarchy quotaBucket="Voice" strategicProdCategory="Local Voice" />
      </ProductHierarchy>
      </ProductRef>
    - <ProductRef productCode="MSP2" modelType="Handset">
      <ActiveFlag>Y</ActiveFlag>
    - <ProductHierarchy>
      <SalesHierarchy portfolio="P4" primary="Y" />
      </ProductHierarchy>
      </ProductRef>
      </ProductRefs>
      </ProductSalesHierachy>
    - <Offers>
    - <Offer productCode="ABN">
      <OfferName>ABN</OfferName>
      <OfferDescription>ABN Description</OfferDescription>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      </Segments>
      <OfferUpdateDate>2009-11-20</OfferUpdateDate>
      <ActiveFlag>Y</ActiveFlag>
      </Offer>
    - <Offer productCode="OneNet">
      <OfferName>OneNet</OfferName>
      <OfferDescription>OneNet Description</OfferDescription>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      <Segment>PCG2</Segment>
      </Segments>
      <OfferUpdateDate>2009-11-20</OfferUpdateDate>
      <ActiveFlag>Y</ActiveFlag>
      </Offer>
      </Offers>
    - <Products>
    - <Product productCode="WSP1" modelType="Wireline Sales Product">
      <ProductName>AT&T High Speed Internet</ProductName>
      <ProductDescription>High Speed Internet</ProductDescription>
      <LegacyCoProdIndicator>SBC</LegacyCoProdIndicator>
      <RevenueCBLCode>1234B</RevenueCBLCode>
      <VolumeCBLCode>4567A</VolumeCBLCode>
      <SAARTServiceIDCode>S1234</SAARTServiceIDCode>
      <MarginPercentRequired>Y</MarginPercentRequired>
      <PercentIntl>%234</PercentIntl>
      <UOM>Each</UOM>
      <PriceType>OneTime</PriceType>
      <ProductStatus>Active</ProductStatus>
      <Compensable>Y</Compensable>
      <Jurisdiction>Everywhere</Jurisdiction>
      <ActiveFlag>Y</ActiveFlag>
    - <Availabilities>
      <Availability>SE</Availability>
      <Availability>E</Availability>
      </Availabilities>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      </Segments>
      <VDIndicator>Voice</VDIndicator>
      <PSOCCode>PSOC 1</PSOCCode>
      <USBilled>Y</USBilled>
      <MOWBilled>N</MOWBilled>
      <ProductStartDate>2009-11-20</ProductStartDate>
      <ProductUpdateDate>2009-11-20</ProductUpdateDate>
      <ProductEndDate>2010-11-20</ProductEndDate>
    - <AliasNames>
      <AliasName>AT&T HSI</AliasName>
      <AliasName>AT&T Fast Internet</AliasName>
      </AliasNames>
    - <OfferTypes>
      <OfferType productCode="ABN" endDate="2009-11-20" />
      <OfferType productCode="OneNet" />
      </OfferTypes>
    - <DynamicAttributes>
    - <DynamicAttribute dataType="String" defaultValue="2.5 Mbps" name="Speed">
      <AttrValue>1.5 Mbps</AttrValue>
      <AttrValue>2.5 Mbps</AttrValue>
      <AttrValue>3.5 Mbps</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="TransportType">
      <AttrValue>T1</AttrValue>
      </DynamicAttribute>
      </DynamicAttributes>
      </Product>
    - <Product productCode="MSP2" modelType="Handset">
      <ProductName>Blackberry Bold</ProductName>
      <ProductDescription>Blackberry Bold Phone</ProductDescription>
      <LegacyCoProdIndicator />
      <RevenueCBLCode />
      <VolumeCBLCode />
      <SAARTServiceIDCode />
      <MarginPercentRequired />
      <PercentIntl />
      <UOM>Each</UOM>
      <PriceType />
      <ProductStatus>Active</ProductStatus>
      <Compensable />
      <Jurisdiction />
      <ActiveFlag>Y</ActiveFlag>
    - <Availabilities>
      <Availability />
      </Availabilities>
    - <Segments>
      <Segment>SCG</Segment>
      <Segment>PCG</Segment>
      </Segments>
      <VDIndicator>Voice</VDIndicator>
      <PSOCCode />
      <USBilled />
      <MOWBilled />
      <ProductStartDate>2009-11-20</ProductStartDate>
      <ProductUpdateDate>2009-11-20</ProductUpdateDate>
    - <AliasNames>
      <AliasName />
      </AliasNames>
    - <OfferTypes>
      <OfferType productCode="ABN" />
      </OfferTypes>
    - <DynamicAttributes>
    - <DynamicAttribute dataType="String" name="StlmntContractType">
      <AttrValue />
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="BMG 2 year price">
      <AttrValue>20</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="MSRP">
      <AttrValue>40</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="BMGAvailableType">
      <AttrValue />
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="ProductId">
      <AttrValue>123456</AttrValue>
      </DynamicAttribute>
    - <DynamicAttribute dataType="String" name="modelSource">
      <AttrValue>product</AttrValue>
      </DynamicAttribute>
      </DynamicAttributes>
      </Product>
      </Products>
      <CatalogChanged>Y</CatalogChanged>
      </ABSProductCatalog>

    Two options that come to mind. Others exist.
    #1 - {thread:id=474031}, which is basically storing the XML in an Object Relational structure for parsing
    #2 - Dump the XML into either an XMLType based table or column and use SQL (with XMLTable) to create a view that parses the data. This would be the same as the view shown in the above post.
    Don't use sql*loader to parse the XML. I was trying to find a post from mdrake about that but couldn't. In short, sql*loader was not build as an XML parser so don't try to use it that way.

  • To use SQL or to not use SQL ..... That is the question

    A couple of posts lately have brought something to my attention that I wanted to discuss between the folks that view this forum because I believe it is important. I highly value the opinions of many of the members here so I think getting your insight would not only benefit me, but many other forum members as well.
    This discussion stems from two posts:
    {message:id=3786432} (Billy)
    ...The question that you need to ask yourself is why use such a technique? For rendering the data a specific way in the client? Well, rendering data is NOT a SQL function and in essence a result of ignorance of how to correctly use client-server. Rendering on the client is dealt with by the client itself. Using SQL to do it.. not only nasty (as many of these examples above are), but also far from optimal and efficient SQL. And in most cases, will not scale. Increase the data volume of the table queried and there will be a hefty performance knock as SQL is incorrectly used.
    ...>
    {message:id=3914362} (Sven W.)
    ...For the Pivot considerations. It is usually much better not to try to do this inside the database. If you think about it. The data itself can be fetch from the database very easily. To do a PIVOT is a kind of GUI/Layout representation for this data. This should be done in the GUI Layer.
    >
    I tried to respond to the thread Billy posted in, so I'll cut and paste my response here:
    Discussion
    Where do we as database developers draw the line between the correct use of SQL or not? Or between rendering on the client and just returning data?
    Now with LISTAGG, PIVOT and UNPIVOT all available to us would these be considered correct uses of SQL?
    Where does this leave the TO_CHAR function? Is this considered rendering?
    I'm fully expecting a fuzzy answer with something along the lines of "do the work where it makes the most sense" from a ease of development and maintainability perspective but I just wanted to ask.
    Hopefully this is a valuable discussion.
    Thanks!

    Let me give a simple example. You can store images in a table as a LOB. You can serve these images to a web browser client via mod_plsql.
    However, the data is static. It requires I/O (and some hefty ones for larger images). What is the biggest performance penalty we have in Oracle? I/O? What is affected by doing I/O to read these images? The buffer cache (which will age out other data in the cache).
    Where else can we store this data? The web server. At what cost to the performance of Oracle? None. Impact on web server? Heck, web servers are designed at their very core to do this!
    So where is the best place to storage static images in this specific case? Not the database, but the web server.
    Now simply extend this concept to the client - where is the best place to render data?
    Should the data be formatted for rendering (e.g. converted into HTML) in the database layer, or should it rather be done in the presentation layer?
    Now I can already hear the argument that the former is exactly what we are doing using APEX. We create dynamic HTML pages on the Oracle server side and then dish that up to the rendering layer to display.
    Two issues that need to be considered. Firstly, this is not done using SQL. This is done using a procedure language called PL/SQL - not using native SQL. PL/SQL in this case is used exactly as Java or PHP or Perl or any other "+app layer+" language would be used. It only happens that PL/SQL resides in the database too. But do not mistake it for what it really is - the application layer.
    The second issue drives home the point that even in 3 tier client server, the application layer is not the best place to do the formatting for the rendering layer. Web 2.0 aka AJAX.. Where the app layer delivers a dynamic rendering engine (as Javascript) to the rendering layer. After which rendering and formatting are done solely inside that rendering layer. And interaction between that and the app layer is requests for new/fresh data to be rendered.
    Why is AJAX becoming so popular? Key issues and concepts like performance, and a rich client interface and so on.
    This all points that the fundamental principle of using the rendering layer to do its thing and using the SQL layer to do its (separate and different) thing, still holds true.
    Yes, we may not always stick to this principle - as we do with doing the rendering (creating HTML) in PL/SQL using APEX for example.. but this is not because the principle is unsound. It is because of technology reasons (different browsers, different behaviour), lack of support for W3C standards (hello IE) and so on.
    It is only recently that these problem areas have been meaningfully addressed.. and why rendering frameworks like extJS is the (rendering layer) future of 3 tier client server.
    If the concept of using SQL to perform rendering and formatting had any substance.. then there would have been a lot of resistance to AJAX for example. The reverse is true.. as we all want to use SQL to do SQL and want the rendering layer to do its thing without us having to code in SQL to specifically support rendering and formatting. It is clunky. It slows down the SQL (every formatting function is a tiny overhead that adds up). It does not bode well for maintenance and changes to the presentation layer. And all those tiny overheads can spell doom for scalability.
    I do not see any gray lines here, or a question of "+opinion+", or "+it depends+". The architecture is clear. The fundamentals are sound.
    The real issue is how we choose to apply these. But (the "+incorrect+") application (of these fundamentals) does not invalidate the fundamentals.

  • Using SQL Loader in a procedure

    Can we use SQL Loader in a stored procedure to load data in an Excel file into the database? If so, how. Also, how can it create a log file to save records that have not been loaded.

    You can..Try this out..
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    finalCommand = new String[4];
    finalCommand[0] = "C:\\windows\\system32\\cmd.exe";
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    new Thread(new Runnable() {
    public void run() {
    try {
    BufferedReader br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("Process out :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    catch (IOException ioe) {
    System.out.println("Exception caught printing process output.");
    ioe.printStackTrace();
    }).start();
    new Thread(new Runnable() {
    public void run() {
    try {
    BufferedReader br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("Process err :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    catch (IOException ioe) {
    System.out.println("Exception caught printing process error.");
    ioe.printStackTrace();
    }).start();
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    public static boolean isWindows() {
    if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
    return true;
    else
    return false;
    show errors java source "Host"
    And now create an Oracle wrapper
    SQL>
    CREATE OR REPLACE PROCEDURE Host_Command (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    Procedure created.
    Now invoke the procedure with an operating system command
    BEGIN
    Host_Command (p_command => 'sqlldr system/tiburon@"(DESCRIPTION\=(ADDRESS_LIST\=(ADDRESS\=(PROTOCOL\=TCP)(HOST\=ICCW3053)(Port\=1521)))(CONNECT_DATA\=(SERVICE_NAME\=orcl)))" control=C:\anupama\emp_join.ctl log=C:\anupama\emp_join.log');
    END;
    /Let me know if it works\encounter any troubles.
    Good luck!!!
    Bhagat

  • Running multiple SSIS packages using SQL Server Agent question.

    I have a multitude of SSIS packages I want to run using SQL Server Agent.  What would the best practice be for running these jobs using SQL Server Agent?  One job per package or running all pakages from one job?  If you have an answer can
    you explain the technical reasoning behind your answer?  Thanks in advance.
    Stan Benner

    Hi, maybe a bit more analysis will give a better answer
    Do all the packages have to run in sequence? (if yes, single job better)
    Can the list of packages to be executed be grouped by dependency (ex package 1,2 and 5 must run in sequence and can be executed by one job, while package 3,4 are not dependent on package 1,2 and 5 can be run by a separate job).
    Can any jobs be run in parallel?
    How often will the package execution sequence change?
    How will you deploy your packages and job? (the more jobs to create the more install script needed and upgrade scenarios become messy).
    My personal preference:
    I create ONE ssis package which is executed by ONE sql agent job. lets call this 'PackageExecutionWrapper.dtsx'
    PackageExectionWrapper then contains multiple 'Execute Package' tasks for the packages you want to execute.
    In the package you can apply any package execution rules - which packages have to run after the other, which packages can run concurrently, which packages should only run if previous succeeded.
    If you need to change the sequence, simple, just update the PackageExecutionWrapper package.

  • Problem in JDBC , when using LIKE operator. - VERY URGENT

    Problem in JDBC , when using LIKE operator.
    LINE 1 : String temp = "AA";
    LINE 2 : String query = "select * from emp where EMPNAME like '*temp*' ";
    LINE 3 : Staement st = con.createStaement();
    LINE 4 : ResultSet rs = st.executeQuery(query);
    '*' character is not getting evaluated. In MS ACCESS2000 only * is accepted instead of '%'. Moreover in MS ACCESS the like operator has to be used within double quotes as a String. whereas in other databases, it accepts single quotes as a String.
    Ex:
    In MS ACCESS
         select * from emp where ename like "*aa*";
    Other Databases
         select * from emp where ename like '%aa%';
    In my situation iam passing a Variable inside a like operator and '*' is used.
    For the above Scenario, Please help me out.
    If possible Kindly let me know the exact Syntax.
    Please give me the answer as LINE1,LINE2,LINE3,LINE4,
    I have verified in JDBC Spec also, it has been specified to use escape sequence.that too did not work.
    Due to this, My project is in hold for about 4 days. I could not find a suitable solution.
    Please help me out.

    I made a LIKE clause work with M$ Access, using PreparedStatement and the % wildcard:
                escapeStr                   = "%";
                String sql                  = "SELECT USERNAME, PASSWORD FROM USERS WHERE USERNAME LIKE ?";
                PreparedStatement statement = connection.prepareStatement(sql);
                statement.setString(1, ("user" + escapeStr));
                ResultSet resultSet         = statement.executeQuery();
                while (resultSet.next())
                    System.out.println("username: " + resultSet.getObject("USERNAME") + " password: " + resultSet.getObject("PASSWORD"));

  • Loading XML file using sql*loader (10g)

    Hi Everyone....
    I have a major problem. I have a 10g database and I need to use sql loader to load a large XML file into the database. This file contains records for many, many customers. This will be done several times and the number of records will vary. I want to use sql loader and load to a staging table, BUT SPLIT THE RECORDS OUT and add a sequence. I am having 2 problems.
    In the 10g documentation, when you want to split the records you use the BEGINDATA clause and indicate something (like a 0) for each instance of a record. Well my first file has 3,722 records in it. How do I know the number of records in each XML file?
    The second problem is that because this is XML, I thought that I could use ENCLOSED BY. But the start tag has an attribute /counter in it, sql*loader doesnt recognize the starting tag. (i.e.: start tag is: </CustomerRec number=1>
    end tag is: </CustomerRec> )
    So, I used TERMINATED BY '</CustomerRec>'. This will split out the records, but it will NOT include the ending tag of </CustomerRec> and when I use extract, I receive an XML parsing error.
    I have tried to get the ending tag using CONTINUEIF and SKIP. But those options are for "records" and not lines.
    Does anyone have any ideas for the 2 problems above. I am at my wits end and I need to finish this ASAP. Any help would be appreciated.
    Thank you!

    Sorry.... here is an example of what my control file looks like. At the end, I have 92 "0", but remember, I have 3722 records in this first file.
    LOAD DATA (SKIP 1)
    INFILE *
    INTO TABLE RETURN_DATA_STG
    TRUNCATE
    XMLType(xmldata)
    FIELDS
    (fill FILLER CHAR(1),
    loadseq SEQUENCE(MAX,1),
    xmldata LOBFILE (CONSTANT F001AB.XML)
    TERMINATED BY '</ExtractObject>'
    ------ ":xmldata||'</ExtractObject>'"
    BEGINDATA
    0
    0
    0
    0
    0
    0

  • SQL operations are not allowed with no global transaction by default for X

    Hi All,
    I am getting the above mentioned error.
    java.sql.SQLException: SQL operations are not allowed with no global transaction by default for XA drivers. If the XA driver supports performing SQL operations with no global transaction, explicitly allow it by setting "SupportsLocalTransaction" JDBC connection pool property to true. In this case, a
    lso remember to complete the local transaction before using the connection again for global transaction, else a XAER_OUTSIDE XAException may result. To complete a local transaction, you can either set auto commit to true or call Connection.commit() or Connection.rollback().
    I am developing a web application. I have jsp, servlets, JDBC classes.
    I am using DataSource and Connection pools.
    I am on WLS 8.1 sp3 and Oracle 10.1.
    Part of My Config file looks as follows:
    <JDBCConnectionPool DriverName="weblogic.jdbcx.oracle.OracleDataSource" KeepLogicalConnOpenOnRelease="true" KeepXAConnTillTxComplete="false" Name="AUMDataSource" NeedTxCtxOnClose="false" NewXAConnForCommit="false" Password="{3DES}AKRkWgdzXN8WrXSRtSvJ6g==" Properties="user=pibsrmgr;portNumber=1521;SID=pibsrdod;serverName=pibsrdod.dtu.mlam.ml.com" RollbackLocalTxUponConnClose="true" SupportsLocalTransaction="false" Targets="myserver" TestTableName="SQL SELECT 1 FROM DUAL" URL="jdbc:bea:oracle://pibsrdod.dtu.mlam.ml.com:1521" XAEndOnlyOnce="false" />
    <JDBCTxDataSource EnableTwoPhaseCommit="true" JNDIName="jdbc/AUMDataSource" Name="AUMDataSource" PoolName="AUMDataSource" Targets="myserver" />
    Any help will be appreciated.
    Thanks
    ---Radhe

    Hi,
    Regarding Transactions , the following link can helpful to you .
    Regards,
    Prasanna Yalam

  • Transformations not occuring properly using PIVOT operator in OWB mapping.

    Hi ,
    In our project we have a OWB Map UII_D_MAP_SPC_CUST_FAULT_NATTR which is used to populate UII_CUSTOMER_FAULT table in our target side.
    The source table which populate UII_CUSTOMER_FAULT is SR_S_TABLE_N_ATTRIBUTEVALUE (a materialized view in another External Db)
    This Mview has 2 columns: S_N_STRINGVALUE & N_NAME.
    When N_NAME is 'FAULT_REPORT_CODE' the corresponding S_N_STRINGVALUE value should populate the REPORT_CODE field in UII_CUSTOMER_FAULTin the target sde.
    This source to target transformations is being done by using UNPIVOT operator in this mapping UII_MAP_SPC_CUST_FAULT_NATTR.
    In ideal case when S_N_STRINGVALUE is NOT NULL, REPORT_CODE value should be populated with the value of source field value (ie the value of S_N_STRINGVALUE) and when S_N_STRINGVALUE is NULL , REPORT_CODE should be populated with 'XX'.
    But in some cases REPORT_CODE value in UII_CUSTOMER_FAULT table is populated as NULL when S_N_STRINGVALUE is NOT NULL
    which should not happen.
    We suspect that there is some prpblem in the UNPIVOT operator, but we are not able to track down the exact location where it is failing. Can you please help in resolving this problem?
    Shall we remove Unpivot operator and use CASE statement in some package that will be called through Expression operator?
    Please advise.
    Regards
    Arinjit Dhar

    Arinjit,
    Have got any solution forthis. Today I ran into exactly the same problem. If you have got the solution, can you please post it in the forum.
    Ott Karesz,
    I have posted my SQL which got generated. The problem is when I am running the SQL just for the particular data set, it is giving the output properly. But what confuses me more is, when I run the mapping just for few records, it is populating the values correctly, but when running the mapping for all the records, then it populates null values for those records.
    Generated SQL:
    INSERT
    INTO
    "TB_PIPE_1"
    ("ASSETNUM",
    "SITEID",
    "TYPE",
    "STATUS",
    "YEARLAID",
    "MATERIALCODE",
    "PRESSURECODE",
    "DIAMETER",
    "METHODLAID",
    "JOINTTYPE",
    "SDRCOL",
    "LENGTHLAID",
    "LENGTHDIGITISED",
    "MEASUREUNITID")
    SELECT
    "UNPIVOT"."ASSETNUM" "ASSETNUM$1",
    "UNPIVOT"."SITEID" "SITEID$1",
    "UNPIVOT"."CLASSIFICATIONID" "CLASSIFICATIONID$1",
    "UNPIVOT"."STATUS" "STATUS$1",
    "UNPIVOT"."YEAR_LAID" "YEAR_LAID$1",
    "UNPIVOT"."MATERIAL" "MATERIAL$1",
    "UNPIVOT"."PRESSURE" "PRESSURE$1",
    "UNPIVOT"."DIAMETER" "DIAMETER$1",
    "UNPIVOT"."METHODLAID" "METHODLAID$1",
    "UNPIVOT"."JOINTTYPE" "JOINTTYPE$1",
    "UNPIVOT"."SDR" "SDR$1",
    "UNPIVOT"."LENGTHLAID" "LENGTHLAID$1",
    "UNPIVOT"."LENGTHDIGITESED" "LENGTHDIGITESED$1",
    "UNPIVOT"."MESUREUNIT" "MESUREUNIT$1"
    FROM (SELECT
    "ASSETNUM" "ASSETNUM",
    "SITEID" "SITEID",
    "STATUS" "STATUS",
    "YEAR_LAID" "YEAR_LAID",
    "CLASSIFICATIONID" "CLASSIFICATIONID",
    MIN(CASE WHEN "ASSETATTRID" = 'MATERIAL' THEN "ALNVALUE" ELSE NULL END) "MATERIAL",
    MIN(CASE WHEN "ASSETATTRID" = 'PRESSUREREGIME' THEN "ALNVALUE" ELSE NULL END) "PRESSURE",
    MIN(CASE WHEN "ASSETATTRID" = 'DIAMETER' THEN "NUMVALUE" ELSE NULL END) "DIAMETER",
    MIN(CASE WHEN "ASSETATTRID" = 'METHODLAID' THEN "ALNVALUE" ELSE NULL END) "METHODLAID",
    MIN(CASE WHEN "ASSETATTRID" = 'JOINTTYPE' THEN "ALNVALUE" ELSE NULL END) "JOINTTYPE",
    MIN(CASE WHEN "ASSETATTRID" = 'SDR' THEN "ALNVALUE" ELSE NULL END) "SDR",
    MIN(CASE WHEN "ASSETATTRID" = 'LENGTHLAID' THEN "NUMVALUE" ELSE NULL END) "LENGTHLAID",
    MIN(CASE WHEN "ASSETATTRID" = 'LENGTHDIGITISED' THEN "NUMVALUE" ELSE NULL END) "LENGTHDIGITESED",
    MIN(CASE WHEN "ASSETATTRID" = 'DIAMETER' THEN "MEASUREUNITID" ELSE NULL END) "MESUREUNIT"
    FROM (SELECT
    "MV_PIPE"."ASSETNUM" "ASSETNUM",
    "MV_PIPE"."SITEID" "SITEID",
    "MV_PIPE"."STATUS" "STATUS",
    "MV_PIPE"."YEAR_LAID" "YEAR_LAID",
    "MV_PIPE_SPEC"."ASSETATTRID" "ASSETATTRID",
    "MV_PIPE_SPEC"."NUMVALUE" "NUMVALUE",
    "MV_PIPE_SPEC"."ALNVALUE" "ALNVALUE",
    "MV_PIPE_SPEC"."MEASUREUNITID" "MEASUREUNITID",
    "MV_PIPE"."CLASSIFICATIONID" "CLASSIFICATIONID"
    FROM "MV_PIPE_SYN" "MV_PIPE",
    "MV_PIPE_SPEC_SYN" "MV_PIPE_SPEC" WHERE "MV_PIPE"."ASSETNUM" in ('466651706','606703143') and ( "MV_PIPE"."ASSETNUM" = "MV_PIPE_SPEC"."ASSETNUM" )) "OUTGRP1"
    GROUP BY
    "ASSETNUM", "SITEID", "STATUS", "YEAR_LAID", "CLASSIFICATIONID") "UNPIVOT"

  • How do I access XMLType using JDBC ?

    This thread will address a number of issues related to accessing XMLType tables and columns from Java via JDBC.

    The following code shows examples of accessing XMLType using Java getting an instance of W3C DOM interface org.w3c.dom.Document. It also shows how which DOM implementation is returned by the getDOM() method is dependant on whether or not the OCI driver or Thin Dirver is in used.
    The code also show how to use the createNonSchemaBasedXMLType() method to access a schema based XMlLType via the thin driver...
    public class GetXMLTypeDOM extends BaseApplication
       protected String driverType;
       protected String getDriver() {
         return this.driverType;
       public void doSomething(String[] Args) throws Exception
         OraclePreparedStatement  statement = null;
         this.driverType = this.OCI_DRIVER;
         this.initializeConnection();
         statement = (OraclePreparedStatement) getConnection().prepareStatement("select object_value from PURCHASEORDER_NSB_XMLTYPE where rownum < 2");
         getDocument(statement);
         statement = (OraclePreparedStatement) getConnection().prepareStatement("select object_value from PURCHASEORDER_SB_XMLTYPE where rownum < 2");
         getDocument(statement);
         getConnection().close();
         this.driverType = this.THIN_DRIVER;
         this.initializeConnection();
         statement = (OraclePreparedStatement) getConnection().prepareStatement("select object_value from PURCHASEORDER_NSB_XMLTYPE where rownum < 2");
         getDocument(statement);
         statement = (OraclePreparedStatement) getConnection().prepareStatement("select object_value from PURCHASEORDER_SB_XMLTYPE where rownum < 2");
         getDocument(statement);
         statement = (OraclePreparedStatement) getConnection().prepareStatement("select x.object_value.createNonSchemaBasedXML() from PURCHASEORDER_SB_XMLTYPE x where rownum < 2");
         getDocument(statement);
         getConnection().close();
       private void getDocument(OraclePreparedStatement statement)
         OracleResultSet resultSet = null;
         org.w3c.dom.Document  doc = null;
         XMLType xml = null;
         try {
           resultSet = (OracleResultSet) statement.executeQuery();
           while (resultSet.next())
              xml = (XMLType) resultSet.getObject(1);
              doc = xml.getDOM();
              System.out.println("DOM Implementation is " + doc.getClass().getName());
              xml.close();
           resultSet.close();
           statement.close();
        catch (SQLException sqle) {
            System.out.println("Caught SQL Exception : " + sqle.getMessage());
      public static void main (String[] args)
        try
          GetXMLTypeDOM example = new GetXMLTypeDOM();
          example.doSomething(args);
        catch (Exception e)
          e.printStackTrace();
    }Here's the output from running this class..
    C:\TEMP>
    C:\Oracle\JDeveloper\jdk\bin\javaw.exe -client -classpath C:\xdb\JDeveloper\Classes;C:\Oracle\product\10.2.0\db_1\jdbc\lib\ojdbc14.jar;C:\Oracle\product\10.2.0\db_1\LIB\xmlparserv2.jar;C:\Oracle\product\10.2.0\db_1\RDBMS\jlib\xdb.jar;C:\xdb\JDeveloper\jakarta-slide-webdavclient-bin-2.1\lib\jakarta-slide-webdavlib-2.1.jar;C:\xdb\JDeveloper\jakarta-slide-webdavclient-bin-2.1\lib\commons-httpclient.jar;C:\xdb\JDeveloper\jakarta-slide-webdavclient-bin-2.1\lib\commons-logging.jar;C:\xdb\JDeveloper\jakarta-slide-webdavclient-bin-2.1\lib\jdom-1.0.jar -Dcom.oracle.st.xmldb.pm.ConnectionParameters=C:\\xdb\\jdeveloper\\SimpleExamples\\LocalConnection.xml -Dhttp.proxyHost=www-proxy.us.oracle.com -Dhttp.proxyPort=80 -Dhttp.nonProxyHosts=192.168.0.77|localhost|192.168.1.1|*.oracle.com|*.us.oracle.com -Dhttps.proxyHost=www-proxy.us.oracle.com -Dhttps.proxyPort=80 -Dhttps.nonProxyHosts=192.168.0.77|localhost|192.168.1.1|*.oracle.com|*.us.oracle.com com.oracle.st.xmldb.pm.examples.GetXMLTypeDOM -mx2048M
    ConnectionProvider.establishConnection(): Connecting as SCOTT/TIGER@jdbc:oracle:oci8:@(description=(address=(host=localhost)(protocol=tcp)(port=1521))(connect_data=(service_name=ORA10GR2.xp.mark.drake.oracle.com)(server=DEDICATED)))
    ConnectionProvider.establishConnection(): Database Connection Established
    DOM Implementation is oracle.xdb.dom.XDBDocument
    DOM Implementation is oracle.xdb.dom.XDBDocument
    ConnectionProvider.establishConnection(): Connecting as SCOTT/TIGER@jdbc:oracle:thin:@localhost:1521:ORA10GR2
    ConnectionProvider.establishConnection(): Database Connection Established
    DOM Implementation is oracle.xml.parser.v2.XMLDocument
    Caught SQL Exception : Only LOB or String Storage is supported in Thin XMLType
    DOM Implementation is oracle.xml.parser.v2.XMLDocument
    Process exited with exit code 0.

  • How to use LIKE operator in plsql

    Hi
    I wanted to select certain rows using like operator in plsql(Input should be given by the user). I have given my experiment here .I couldn't get any result.
    As per sql syntax while using LIKE operator we should give search criteria within single quote.where as in plsql if we give within single quote its takes as string so no output is comming.what is solution ? How to use like operator in plsql?
    sql syntax
    SQL>SELECT customer_name FROM customer_header
    WHERE customer_name LIKE 'B%' ; customer_name
    Bala murali
    Babu
    Basker
    plsql syntax
    PROCEDURE pro_custheader_like ( v_cname IN varchar2
         ,answer OUT type_refcur_customer) IS
         BEGIN
         OPEN answer FOR
         SELECT customer_name FROM customer_header
              WHERE customer_name LIKE ( ' v_cname ' );
    END pro_custheader_like;
    execution command
    sql>variable answer refcursor;
    sql>set serveroutput on
    sql>exec package_name.pro_custheader_like( 'R',:answer);
    plsql successfully completed
    sql>print :answer
    no row selected
    by
    balamuralikrishnan.s

    plsql syntax
    PROCEDURE pro_custheader_like ( v_cname IN
    varchar2
    ,answer OUT
    type_refcur_customer) IS
    N
         OPEN answer FOR
         SELECT customer_name FROM customer_header
    WHERE customer_name LIKE ( v_cname );
    END pro_custheader_like;
    Try it without any quotes. And, let us know your feedback.
    Regards.
    Satyaki De.
    Message was edited by:
    Satyaki_De

Maybe you are looking for

  • New Domain Names and Contact Form Issue

    Hello all, I'm working for a client who is using one of the newer domain name extensions. It reads like this: www.COMPANYNAME.farm The .farm is a new extension. On my contact form I use the e-mail address [email protected] The e-mails are never sent

  • What happened to the buttons in chrome?

    All my application buttons where fine in appearance about a couple of months ago, but recently the right hand side of the button is a bit tilted now! I thought it must be a local problem; but then I noticed that the appearance of the button is the sa

  • [SOLVED]dwm - back into tiling?

    If I accidentally move or resize a window while dwm is in tiling mode, how can I get that window to tile with other programs without opening/closing it. For example, if open chromium, resize or move it a little while it is in tiling mode, and open an

  • I am going to be traveling to Switzerland, will my wifi on my ipod touch work there?

    I am going to be traveling to Switzerland, will my wifi on my ipod touch work there?

  • Wifi--more trouble than its worth??

    it seems like pretty much every discussion in the iTouch category has to do with wifi problems. im looking into getting a router, but before i do, is wifi more trouble than its worth?? whats your opinon?