Help  needed  in inserting  into column  of XML type

i have requirement of inserting data into column of xml type
eg
cust product cost
1 a 3
1 b 7
1 c 5
now required result should
<PROD-LIST>
<a>3</a>
<b>7</b>
<c>5</c>
</PROD-LIST>
Please let me know how to achieve this , i was trying write function , it was working for one values ,but how to do if many values exist .

Take a deep breath, then retype this putting in all the words and punctuation you missed out the first time until it makes sense.
Your sample data, for example, could be better formatted using the [pre] and [/pre] tags to preserve formatting and put in a table format. Similarly with your output. Why are two of the numbers floating around freely in your xml but the 3rd isn't?

Similar Messages

  • Help needed badly Insert text data from xml files into tables

    Hi all, I have asked to do insertion of text from a xml file into tables upon receiving using pro*c. i've done quite an amount of research on xml parser in c but there wasn't much information for mi to use for implementation...
    Guys don't mind helping me to clarify few doubts of mine...
    1. Where can i get the oracle xml parser libs? Is it included when i installed oracle 8i?
    2. Is there any tutorials or help files for xml parser libs where i can read up?
    I need the xml parser to recognise the tags, followed by recognising the text after the tags.
    eg. xml format
    <studentID> 0012 </studentID>
    <student> john </student>
    <studentID> 0013 </studentID>
    <student> mary </student>
    text willl be inserted into tables like this:
    studentID | student
    0012 | john
    0013 | mary
    by the way i'm using oracle 8i on HP-UX. Thanks in advance.

    I can answer one of of your questions at least
    1. Where can i get the oracle xml parser libs? Is it included when i installed oracle 8i?You need the XML XDK. You can use http://www.oracle.com/technology/tech/xml/xdkhome.html as your starting point. I believe the 9i version works for 8i.
    I have no pro*c experience so I can't offer any other suggestions regarding how to do this in pro*c.

  • Need to insert into NVARCHAR2 column in a database table

    I need to insert into a table with column type NVARCHAR2(2000) in java.
    Cant use normal setString on that column. How can I do this using PreparedStatement in Java?

    The scenario is:
    I have to read a CSV file which contains a column in Urdu language, and show it on the JTable first.
    Then I have to import the JTable contents into a database table.
    Database Table structure is:
    CREATE TABLE IMPORT_TMP (
    ctype          VARCHAR2(3),
    urdu_name  NVARCHAR2(2000)
    );My java code which inserts into the database table is:
                    Vector dataVector = tableModel.getDataVector();
                    rowVector = (Vector) dataVector.get(row);
                  cType = "";
                    if (rowVector.get(INDEX_BANK) != null) {
                        cType = rowVector.get(INDEX_CTYPE).toString();
                    urduName = "";
                    if (rowVector.get(INDEX_URDU_NAME) != null) {
                        urduName = rowVector.get(INDEX_URDU_NAME).toString();
                    statementInsert.setString(1, cType);
                    statementInsert.setString(2, urduName);I also applied Renderer on the table column, my renderer class is:
    public class LangFontRenderer extends JLabel implements TableCellRenderer {
        private Font customFont;
        public LangFontRenderer(Font font) {
            super();
            customFont = font;
            System.out.println("font = " + font.getFontName());
            this.setFont(font);
        @Override
        public Component getTableCellRendererComponent(JTable table,
                Object value, boolean isSelected, boolean hasFocus, int row, int column) {
            if (value != null) {
                if (value instanceof String) {
                    setText((String) value);
                    return this;
            return this;
        @Override
        public Font getFont() {
            return customFont;
        // overriding other methods for performance reasons only
        @Override
        public void invalidate() {
        @Override
        public boolean isOpaque() {
            return true;
        @Override
        public void repaint() {
        @Override
        public void revalidate() {
        @Override
        public void validate() {
    }I applied the renderer on the column as:
            TableColumn col = IATable.getColumnModel().getColumn(INDEX_URDU_NAME);
            LangFontRenderer langRenderer = new LangFontRenderer(new java.awt.Font("Urdu Naskh Asiatype", 0, 11));
            col.setCellRenderer(langRenderer);It does not give any error but when i query on the database table it does not show the column data in Urdu language.
    Also it does not show the correct value on JTable column, some un-identified symbols.
    Furthermore when I open the CSV file in notepad, it shows the correct language in that column, as I have installed the Urdu language and font on my system.

  • I have a DVD format VTS and I need to insert into a powerpoint presentation can anyone tell me the steps because what I normally do to insert media into a presentation is not working

    I have a DVD which I need to insert into a presentation does anyone know how to do this.
    The video format is VTS and I have saved the DVD on my desk top but it wont let me insert into my presentation.

    Sounds like your issue is between gmail and charter. Thunderbird would have no part in this operation.

  • Hi, extract data from xml file and insert into another exiting xml file

    i am searching code to extract data from xml file and insert into another exiting xml file by a java program. I understood it is easy to extract data from a xml file, and how ever without creating another xml file. We want to insert the extracted data into another exiting xml file. Suggestions?
    1st xml file which has two lines(text1.xml)
    <?xml version="1.0" encoding="iso-8859-1"?>
    <xs:PrintDataRequest xmlns:xs="http://com.unisys.com/Anid"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
    <xs:Person>
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://com.unisys.com/Anid file:ANIDWS.xsd">
    These two lines has to be inserted in the existing another xml(text 2.xml) file(at line 3 and 4)
    Regards,
    bubbly

    Jadz_Core wrote:
    RandomAccessFile? If you know where you want to insert it.Are you sure about this? If using this, the receiving file would have to have bytes inserted that exactly match the number of bytes replaced. I'm thinking that you'll likely have to stream through the second XML with a SAX parser and copy information (or insert new information) as you stream with an XML writer of some sort.

  • Extract data from xml file and insert into another exiting xml fil

    hello,
    i am searching extract data from xml file and insert into another exiting xml file by a java program. I understood it is easy to extract data from a xml file, and how ever without creating another xml file. We want to insert the extracted data into another exiting xml file. Suggestions?
    Regards,
    Zhuozhi

    If the files are small, you can load the target file in a DOM document, insert the data from the source file and persist the DOM.
    If the files are large, you probably want to use a StAX or SAX.

  • Urgent help needed in inserting data into a custom table in oracle WorkFlow

    Hi
    I am trying to get data from the WF and insert into a custom table..
    I read that workflow procedures WONT allow commits...
    Oracle Workflow will not support autonomous commits in any procedure it calls directly. If you need to perform commits, then embed your SQL in a subprocedure and declare it as an autonomous block. This subprocedure must be capable of being rerun. Additionally, note that Oracle Workflow handles errors by rolling back the entire procedure and setting its status to ERROR. Database updates performed by autonomous commits cannot be rolled back, so you will need to write your own compensatory logic for error handling
    Have anyone did this..
    Please give me some idea ...It is urgent
    I am getting data using getitemattribute..and try to insert it into a custom table
    thanks
    kp

    Pl do not post duplicate threads - insert dont work in Workflow
    Srini

  • Help! about insert into one table from two tables'data?

    hi,all friends!
    i have a question:
    i have two table as like this:
    table_one(id,ipaddr,col1,col2) primary key(id,ipaddr)
    table_two(id,ipaddr,col1,col3,col4) primary key(id,ipaddr)
    about table_one and table_two,it's columns may change execept id and ipaddr,
    how can i insert the data of table_one and table_two into table_three,the columns of table_three may change with the columns of table_one and table_two
    table_three may dynamic create,but it's primary key is (id,ipaddr)
    thanks!
    pls help!
    any suggestion welcome!

    insert into table_3
    (id, ipaddr, col1, col2, col3, col4)
    select t1.id, t1.ipaddr, t1.col1, t1.col2, t2.col3, t2.col4
    from table_1 t1, table_2 t2
    where t2.id = t1.id
    and t2.ipaddr = t1.ipaddr;

  • Please help --Error in insert into Statement

    Error in insert into statement while connecting to ms-access.
    import java.sql.*;
    public class stupid8
         public stupid8()
              try{
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection con=DriverManager.getConnection("jdbc:odbc:Driver={MicroSoft Access Driver (*.mdb)};"+"DBQ=d:/Servlet/registration.mdb");
                   PreparedStatement s=con.prepareStatement("insert into Deposit (username,date,amount) values(?,?,?)");
                   s.setString(1,"username");
                   s.setString(2,"date");
                   s.setString(3,"amount");
                   s.executeUpdate();
                   System.out.println("Success");
              catch(Exception e)
                   System.out.println("Error: "+e);
         public static void main(String args[])
              new stupid8();
    }

    My first guess is that the database is objecting to the use of "date" as a column name; "date" is often a reserved word in databases.
    It would be less of a guess if you posted the actual error message.

  • SSIS - Script Task creates a DTS var and using Foreach loop, Execute SQL needs to INSERT into table from this DTS var.

    I have a script task written in C# that creates an array of strings "arrayFields" after parsing a text file. It saves the array of strings in a DTS variable.
    Each row in array represents a row is comma separated and is a row that must be inserted into a table. For example,
    X and Z are fields in the table
    X1, X2,....Xn
    Z1,Z2,...Zn
    I am using a Foreach Loop  to grab each row and then  Execute SQL Task to take each row from the array and insert each field per row in a table,
    The SQL is something like,
    INSERT dbo.table values(field1, field2,...fieldn) arrayFields?
    What should this this INSERT look like?

    I guess you implemented
    Shredding a Recordset
    Based on what I understood (correct me if I am wrong) you have difficulties mapping the input parameters, if so here is the guide
    http://www.sqlis.com/sqlis/post/The-Execute-SQL-Task.aspx
    In short it might look like
    INSERT dbo.table  (ColumnA, ColumnB,...) VALUES (?,?...)
    The syntax for the T-SQL INSERT is http://technet.microsoft.com/en-us/library/dd776381%28v=sql.105%29.aspx
    Arthur
    MyBlog
    Twitter

  • Help on Chinese insert into mysql (urgent)

    Dear Friends,
    we are running an coldfusion mx application on window,
    perfect, the database is mysql, utf-8 encoding.
    But when we moved to redhat linux +mysql, the chinese in the
    database displayed as ?????. when we insert into database, the
    chinese inserted like ????? as well...
    Any thing that we missed to config...please help.
    thanks,

    [This page|http://java.sun.com/developer/technicalArticles/Intl/HTTPCharset/] has a good explanation of where the issues might be.
    The thing with character encodings is that you have to get it right at every step. If you miss one of them, then the whole thing blows apart.
    From the minimal info you have here, I would take a look at the request.setCharacterEncoding() methd.
    cheers,
    evnafets

  • Help need on inserting system date on database

    hello every body,
    I need to insert system date into database through prepared statement.
    i wrote code :
    java.util.Date d=new java.util.Date();
    Preparestatement psmt;
    psmt.setDate(8, java.sql.Date(d));
    am getting class cast exception :
    could u please tell me how to insert system date through prepared statement..
    thanks in advance..

    Surround your code with a
    try{
    //Insert date here
    catch(Exception e){
    //handle exceptions here
    e.printStackTrace();
    Who says he didn't already?
    Try this:
    java.util.Date d=new java.util.Date();
    >
    Preparestatement psmt;
    psmt.setDate(8, new
    java.sql.Date(d.getTime()));This is correct, but can be condensed (if you want)
    psmt.setDate(8, new java.sql.Date(new java.util.Date().getTime()));
    >
    It's good idea to use the JDBC escape function
    instead of using a specific DBMS function. This way,
    your code will be portable.
    sql = "INSERT INTO USERS VALUES("
    + "'" + userName + "'" + ","
    + "'" + userPw   + "'" + ","
    + "  {fn now() }  )"; e Real's How To
    (http://64.18.163.122/rgagnon/javadetails/java-0567.ht
    ml)
    And this is only marginally applicable.  If he wishes to use the same statement for the current date, as well as other dates, he cannot make use of this.  Of course, I don't really know if I would trust or recommend a tutorial site that advocates building statements that are screaming for injection attack attempts.
    Edit:  Too slow by a mile!                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Help with ASP Insert Into Command

    Hi All,
    I'm trying to get the following command (insert into) to
    work, but am having
    no joy. I would be greatful if you could highlight what i
    have done wrong.
    Its an for an ASP site using an MS SQL database -
    <%
    if(Session("BATCHID2") <> "") then
    insertaccountinvoice__MMColParam =
    Session("BATCHID2")
    if(Session("SITEID") <> "") then
    insertaccountinvoice__MMColParam2 =
    Session("SITEID")
    %>
    <%
    set insertaccountinvoice =
    Server.CreateObject("ADODB.Command")
    insertaccountinvoice.ActiveConnection = MM_recruta2_STRING
    insertaccountinvoice.CommandText = "INSERT INTO
    dbo.JBAccountInvoice
    (JBACISiteID, JBACIClientID, JBACIAccountType,
    JBACIAccountOverwrite,
    JBACIBillingContact, JBACIClientName, JBACIClientAddress,
    JBACIClientEmail,
    JBACIBatchID) VALUES (dbo.JBClient(JBCLSiteID, JBCLID,
    JBCLAccountType,
    JBCLreguserMonthlyOverwrite, JBCLBillingContact, JBCLName,
    JBCLAddress,
    JBCLEmail ), " + Replace(insertaccountinvoice__MMColParam,
    "'", "''") + "
    WHERE JBCLSiteID = '" +
    Replace(insertaccountinvoice__MMColParam2, "'", "''")
    + "' and JBCLAccountLive = 'y' and (JBCLAccountType = 'Reg
    User' OR
    JBCLAccountType = 'Reg User5' OR JBCLAccountType = 'Reg
    User10' OR
    JBCLAccountType = 'Multi User')) "
    insertaccountinvoice.CommandType = 1
    insertaccountinvoice.CommandTimeout = 0
    insertaccountinvoice.Prepared = true
    insertaccountinvoice.Execute()
    %>
    <% Response.Redirect("
    http://www.recruta.co.uk")
    %>

    In general, the syntax for this kind of insert is:
    insert into t1 (a,b,c)
    select a,b,c from t2 where a=5
    Jules
    http://www.charon.co.uk/products.aspx
    Charon Cart
    Ecommerce for ASP/ASP.NET

  • Help needed regarding insertion of data into oracle

    Hi,
    I am student currently trying to do a project to up a semantic database using oracle. Have set up the semantic technologies for oracle 11gr2 and used the jena adapter to load an owl into oracle.
    But i am not sure how do i insert sample data that could reference the owl.
    Tried searching but unable to find any simple tutorial and have also looked through the developer's guide and also jenaadaptor guide.
    Is there any tutorials available that could help? thank you

    Hi,
    Please go to the OTN site for more information:
    http://www.oracle.com/technology/tech/semantic_technologies/index.html
    There you can find some training info (try the NCI Oracle By Example, it's a good tutorial):
    http://www.oracle.com/technology/tech/semantic_technologies/htdocs/semtech_training.html
    Regards,
    Vladimir

  • Help needed in returning multiple columns from one field

    Hi,
    I have been given a task to rewrite the query (see below), so that I get three columns from the one field, based on their contents.
    The script returns all the columns and concatenates them into one, but returns them as comma delimmited within the returned column, to generate a report.
    These tables are from Siebel.
    Our Oracle version is:
    select banner from sys.v_$version;
    --returns
    Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
    PL/SQL Release 8.1.7.4.0 - Production
    CORE     8.1.7.0.0     Production
    TNS for Solaris: Version 8.1.7.4.0 - Production
    NLSRTL Version 3.4.1.0.0 - Production
    Here is what I was given;
    set arraysize 200
    Spool d:\Daily_reports\Data\RegManage\Electricity\eCISPLUS_Product_Switch_Not_Started_Discount.csv
    -- this will concatenate all the returned columns into one
    SELECT DISTINCT '"'||
    rtrim(ltrim(S_ORG_EXT.OU_NUM)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.NAME)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.TODO_CD)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.EVT_STAT_CD)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_SOURCE_TYPE)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_TXU_PRICELIST_NAME)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PEAKANYTIME_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PA_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.X_OTH_ACCOUNT_NUMBER)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_NUM)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_CHECKSUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.QUOTE_NUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_COOLING_OFF_DATE)) || '","' ||
    rtrim(ltrim(S_PROD_INT.NAME)) || '"'
    The field S_PROD_INT.NAME is the one that I need to split so that it is retured
    into three different columns.
    1st column needed -
    where S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge __ %'
    OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now __ %'
    OR S_PROD_INT.NAME Like 'Electricity Go for More __ %'
    OR S_PROD_INT.NAME Like 'Electricity Mates Rates __ %'
    2nd column needed -
    where S_PROD_INT.NAME Like 'Gas TRUenergy Business Edge __ %'
    OR S_PROD_INT.NAME Like 'Gas TRUenergy Business Now __ %'
    OR S_PROD_INT.NAME Like 'Gas Go for More __ %'
    OR S_PROD_INT.NAME Like 'Gas Mates Rates __ %'
    3rd column needed from
    S_PROD_INT.NAME Like '* ___ Discount for Paying Your Bill by the Due Date')
    -- Tables
    FROM SIEBEL.S_ADDR_PER S_ADDR_PER,
    SIEBEL.S_DOC_QUOTE S_DOC_QUOTE,
    SIEBEL.S_EVT_ACT S_EVT_ACT,
    SIEBEL.S_ORG_EXT S_ORG_EXT,
    SIEBEL.S_PRI_LST S_PRI_LST,
    SIEBEL.S_PROD_INT S_PROD_INT,
    SIEBEL.S_QUOTE_ITEM S_QUOTE_ITEM
    WHERE S_EVT_ACT.TARGET_OU_ID = S_ORG_EXT.ROW_ID
    AND S_DOC_QUOTE.ROW_ID = S_QUOTE_ITEM.SD_ID
    AND S_ADDR_PER.ROW_ID = S_ORG_EXT.PR_ADDR_ID
    AND S_PROD_INT.ROW_ID = S_QUOTE_ITEM.PROD_ID
    AND S_ORG_EXT.ROW_ID = S_DOC_QUOTE.TARGET_OU_ID
    AND S_DOC_QUOTE.PRI_LST_ID = S_PRI_LST.ROW_ID
    AND S_EVT_ACT.TODO_CD = 'Product Switch-Electricity'
    AND S_EVT_ACT.EVT_STAT_CD In ('In Progress','Not Started','On Hold')
    AND S_DOC_QUOTE.STAT_CD In ('Completed','Verbal Acceptance','Written Acceptance')
    AND S_DOC_QUOTE.X_OFFER_TYPE = 'Product Switch'
    AND (S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge __ %' OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now __ %'
    OR S_PROD_INT.NAME Like 'Electricity Go for More __ %' OR S_PROD_INT.NAME Like 'Electricity Mates Rates __ %'
    OR S_PROD_INT.NAME Like 'Electricity __ Discount for Paying Your Bill by the Due Date' or S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge ___ %'
    OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now ___ %'
    OR S_PROD_INT.NAME Like 'Electricity Go for More ___ %'
    OR S_PROD_INT.NAME Like 'Electricity Mates Rates ___ %'
    OR S_PROD_INT.NAME Like 'Electricity ___ Discount for Paying Your Bill by the Due Date')
    UNION
    SELECT DISTINCT '"'||
    rtrim(ltrim(S_ORG_EXT.OU_NUM)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.NAME)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.TODO_CD)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.EVT_STAT_CD)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_SOURCE_TYPE)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_TXU_PRICELIST_NAME)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PEAKANYTIME_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PA_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.X_OTH_ACCOUNT_NUMBER)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_NUM)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_CHECKSUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.QUOTE_NUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_COOLING_OFF_DATE)) || '"'
    FROM SIEBEL.S_ADDR_PER S_ADDR_PER,
    SIEBEL.S_DOC_QUOTE S_DOC_QUOTE,
    SIEBEL.S_EVT_ACT S_EVT_ACT,
    SIEBEL.S_ORG_EXT S_ORG_EXT,
    SIEBEL.S_PRI_LST S_PRI_LST
    WHERE S_EVT_ACT.TARGET_OU_ID = S_ORG_EXT.ROW_ID
    AND S_ADDR_PER.ROW_ID = S_ORG_EXT.PR_ADDR_ID
    AND S_ORG_EXT.ROW_ID = S_DOC_QUOTE.TARGET_OU_ID
    AND S_DOC_QUOTE.PRI_LST_ID = S_PRI_LST.ROW_ID
    AND S_EVT_ACT.TODO_CD = 'Product Switch-Electricity'
    AND S_EVT_ACT.EVT_STAT_CD In ('In Progress','Not Started','On Hold')
    AND S_DOC_QUOTE.STAT_CD In ('Completed','Verbal Acceptance','Written Acceptance')
    AND S_DOC_QUOTE.X_OFFER_TYPE = 'Product Switch'
    AND NOT EXISTS (SELECT /*+ unnest */ 'X'
    FROM SIEBEL.S_PROD_INT S_PROD_INT, SIEBEL.S_QUOTE_ITEM S_QUOTE_ITEM
    WHERE S_DOC_QUOTE.ROW_ID = S_QUOTE_ITEM.SD_ID
    AND S_PROD_INT.ROW_ID = S_QUOTE_ITEM.PROD_ID
    AND (S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge __ %'
    OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now __ %'
    OR S_PROD_INT.NAME Like 'Electricity Go for More __ %'
    OR S_PROD_INT.NAME Like 'Electricity Mates Rates __ %'
    OR S_PROD_INT.NAME Like 'Electricity __ Discount for Paying Your Bill by the Due Date' or S_PROD_INT.NAME Like 'Electricity TRUenergy Business Edge ___ %'
    OR S_PROD_INT.NAME Like 'Electricity TRUenergy Business Now ___ %'
    OR S_PROD_INT.NAME Like 'Electricity Go for More ___ %'
    OR S_PROD_INT.NAME Like 'Electricity Mates Rates ___ %'
    OR S_PROD_INT.NAME Like 'Electricity ___ Discount for Paying Your Bill by the Due Date'));
    spool off
    This is what one row looks like;
    "1-UWLHY","Alpha Vic Kelly Kay","Product Switch-Electricity","Not Started","AMBASS_50REBATE","Go Green PKANY-Powercor","QEGS1","GG","QEGS1","GG","","6407421678","8","1-UWLI6","12-JUN-07","Electricity Mates Rates 7% Discount"
    we want
    "1-UWLHY","Alpha Vic Kelly Kay","Product Switch-Electricity","Not Started","AMBASS_50REBATE","Go Green PKANY-Powercor","QEGS1","GG","QEGS1","GG","","6407421678","8","1-UWLI6","12-JUN-07",'Electricity Mates Rates 7% Discount","Gas TRUenergy Business Edge 10% Discount","Electricity 3% Discount for Paying Your Bill by the Due Date"
    I have tried to:
    - create a cursor
    - each column as - ie
    S_PROD_INT.NAME as "EVD",
    S_PROD_INT.NAME as "GVD",
    S_PROD_INT.NAME as "PbDDD"
    but when I try to use them in where "EVD" Like 'etc...'
    error that table does not exist
    I have tried also as
    where 'EVD' Like 'etc...' -- error
    where EVD Like 'etc...' -- error
    - create them as %TYPE variable
    - more
    but keep getting errors
    Any ideas and help will be most appreciated as I have tried and researched all I can think and get my hands on with my limited skills.
    Thanks.
    Regards, Steve

    Unfortunately my skills are not high enough as I obviously don't know where to put the code exaclty.
    I am first just running it on the top part of the script but get the error;
    ORA-00900: invalid SQL statement
    What I am running is; -- Commented
    WITH s_prod_int AS
    SELECT 1 row_id, 'Electricity Mates Rates 7% Discount' name FROM s_prod_int --these were 'FROM dual' originally, I changed to s_prod_int (Received same error regardless whether from dual or s_prod_int)
    UNION ALL
    SELECT 1, 'Gas TRUenergy Business Edge 10% Discount' FROM s_prod_int
    UNION ALL
    SELECT 1, 'Electricity 3% Discount for Paying Your Bill by the Due Date' FROM s_prod_int
    SELECT DISTINCT '"'||
    rtrim(ltrim(S_ORG_EXT.OU_NUM)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.NAME)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.TODO_CD)) || '","' ||
    rtrim(ltrim(S_EVT_ACT.EVT_STAT_CD)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_SOURCE_TYPE)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_TXU_PRICELIST_NAME)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PEAKANYTIME_ELEC)) || '","' ||
    rtrim(ltrim(S_PRI_LST.X_TXU_CISRATE_PA_CLASS_ELEC)) || '","' ||
    rtrim(ltrim(S_ORG_EXT.X_OTH_ACCOUNT_NUMBER)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_NUM)) || '","' ||
    rtrim(ltrim(S_ADDR_PER.X_NMI_CHECKSUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.QUOTE_NUM)) || '","' ||
    rtrim(ltrim(S_DOC_QUOTE.X_COOLING_OFF_DATE)) || '","' ||
    rtrim(ltrim(a.name)) ||'","'|| --I assume I am still able to right and left trim
    rtrim(ltrim(b.name)) ||'","'||
    rtrim(ltrim(c.name))||'"' name -- not sure what this name is here for (have ran with and without it here
    FROM SIEBEL.S_ADDR_PER S_ADDR_PER,
    SIEBEL.S_DOC_QUOTE S_DOC_QUOTE,
    SIEBEL.S_EVT_ACT S_EVT_ACT,
    SIEBEL.S_ORG_EXT S_ORG_EXT,
    SIEBEL.S_PRI_LST S_PRI_LST,
    s_prod_int a, -- I assume these needed to go in here
    s_prod_int b,
    s_prod_int c
    SIEBEL.S_QUOTE_ITEM S_QUOTE_ITEM
    WHERE S_EVT_ACT.TARGET_OU_ID = S_ORG_EXT.ROW_ID
    AND S_DOC_QUOTE.ROW_ID = S_QUOTE_ITEM.SD_ID
    AND S_ADDR_PER.ROW_ID = S_ORG_EXT.PR_ADDR_ID
    AND S_PROD_INT.ROW_ID = S_QUOTE_ITEM.PROD_ID
    AND S_ORG_EXT.ROW_ID = S_DOC_QUOTE.TARGET_OU_ID
    AND S_DOC_QUOTE.PRI_LST_ID = S_PRI_LST.ROW_ID
    AND S_EVT_ACT.TODO_CD = 'Product Switch-Electricity'
    AND S_EVT_ACT.EVT_STAT_CD In ('In Progress','Not Started','On Hold')
    AND S_DOC_QUOTE.STAT_CD In ('Completed','Verbal Acceptance','Written Acceptance')
    AND S_DOC_QUOTE.X_OFFER_TYPE = 'Product Switch'
    AND a.NAME LIKE 'Electricity TRUenergy Business Edge%' --Placed all the where part in the original where clause
    OR a.NAME LIKE 'Electricity TRUenergy Business Now%'
    OR a.NAME LIKE 'Electricity Go for More%'
    OR a.NAME LIKE 'Electricity Mates Rates%'
    AND a.row_id = b.row_id
    AND (
    b.NAME LIKE 'Gas TRUenergy Business Edge%'
    OR b.NAME LIKE 'Gas TRUenergy Business Now%'
    OR b.NAME LIKE 'Gas Go for More%'
    OR b.NAME LIKE 'Gas Mates Rates%'
    AND b.row_id = c.row_id
    AND (
    c.NAME LIKE '%Discount for Paying Your Bill by the Due Date'
    NAME -- Not sure what this NAME is for - tried with and without - same error

Maybe you are looking for

  • How to check my iphone original

    dear madam/sir i have a iphone 4 i want to check my phone original or fake model MC318LL/A AND S.R. 79034QM84S AND IMEI 012425008121464 AND ICCID 8991020113326384483 so can you tell how can i check my phone if you can check so plz tell me original or

  • Sql Developer compatible problem with Vista aero

    My computer is Vista Ultimate x64 en-US. I have downloaded Sql Developer from here http://www.oracle.com/technology/software/products/sql/index.html When I run it, the aero glass effect turn off automatically, When I close the sql developer, the aero

  • Old Email Messages

    A few days ago i started receiving old emails on my bb that I had previously deleted. These msgs are now going as far back as January! It seems whenever someone sends me a new email, 9 old ones get sent along with it! I have tried to rework my email

  • I really, really miss "File-Save As..."

    After upgrading to Mac OS X v10.7 Lion I find that the only way to do a "Save As..." of a document is to "browse all verisions", Restore, Duplicate, then select Save of the copied file, and select "Save As" in the dialog box that appears. That is WAY

  • Command to goto primarylist from secondarylist

    hi,     what is the command/transactioncode to move from secondarylist to basic/primarylist and what happens if we create 21 secondarylist will the control goto 21st from 20th , on selecting a field will it directly goto 21st list.