Needed help to add columns from one table to another table

Hi,
I have emp and dept tables. I think most of all might know what columns it's contain. Now I want to create table emp_dept with all emp and dept table columns.
I have wrote the below query it's worked too. But I think there should be some more other queries to get accomplish the same task. Plz let me know.
create table emp_dept as select a.*, b.dname, b.loc from emp a full outer join dept b on a.deptno = b.deptno where 1=2
Thanks for your time..

Hi,
1004909 wrote:
Hi,
I have emp and dept tables. I think most of all might know what columns it's contain. Now I want to create table emp_dept with all emp and dept table columns.
I have wrote the below query it's worked too. But I think there should be some more other queries to get accomplish the same task. Why do you think that?
Plz let me know.
create table emp_dept as select a.*, b.dname, b.loc from emp a full outer join dept b on a.deptno = b.deptno where 1=2"WHERE 1 = 2" means you want to create the table, but not put any rows in it. In that case, theere's no need for a full outer join; a simple inner join would do just as well.
There is no single "right" or "best" table. (Most of us would have differerent jobs if there were.)
It does, however, make sense to talk about the "right" or "best" table for some specific purpose .
The emp and dept tables in the scott schema are great for transaction processing, where rows are frequenctly INSERTed, UPDATEd and/or DELETEd. For example, if department 10 moves from New York to Pune, you only have to find and UPDATE 1 row, and that one UPDATE will affect all employees in departemnt 10, regardess of how many there are.
What purpose will the emp_dept table have? Why is the table design used in the scott schema not best for you?
One possibility is that you need a tale that is very fast to query, even though it may be very inefficient for transactions. For example, you might want a data warehouse that is only refreshed once a day, and were you can run several common queries quickly, without joining the emp and dept tales.
Another possibility is that your data model (that is, what are the entities and the attributes) is different. For example, you may have a model where employees King and Miller both work in department 10, but King's location is New York, but Miller's is Pune.
In either of these situations, the table you posted migt be the best design. Why are you asking the question? What is the problem with the emp_dept table you posted?

Similar Messages

  • Need help in passing parameters from one page to another!

    Hi,
    I need to pass values that are retrieved from database from one page to another.
    But even when I use pageContext.putParameter(), I am not able to view the value in the 2nd page.
    Any pointers on how to pass parameters would be helpful..
    Thanks in advance!

    The requirement is on the main page there are 6 fields out of which 4 are read-only and are taken from the database and 1 is taken from database, but can be edited, and the 6th one is completly editable for the user. I am trying to pass these parameters using setForwardURL, and on the second page (Preview page, where all these fields are read-only), I am able to retrieve these parameters using pageContext.getParameters() and am able to display it as an exception but I am not able to set these into the fields using pageContext.putParameters().

  • I can't import a table contains BLOB column  from one user to another user.

    1) I create two user both have connect role,and each has its own tablespace, DDL:
    create user d2zd identified by d2zd default tablespace d2zd quota unlimited on d2zd account unlock;
    grant connect to d2zd;
    create user d3zd identified by d3zd default tablespace d3zd quota unlimited on d3zd account unlock;
    grant connect to d3zd;
    2)Then enter oracle as d2zd and create a table contains BLOB column and insert data to the table.
    3) export d2zd as follow:
    exp d2zd/d2zd file=d2zd.dmp
    4) import to d3zd as follow:
    imp d3zd/d3zd fromuser=d2zd touser=d3zd file=d2zd.dmp
    the question is the table with BOLB colum can't be import,
    it says:have no privilege on tablespace d2zd.
    How can I import a table contains BLOB column from one user to another user?

    Hi - the reason for as our friend already told ist that a blob can be stored outside of the table segment, in another Tablespace, This is for performance reason.
    Sou you would need to have Quota on two tablespaces.
    the one which holds the table segment the other which holds the blob(segment).
    Regards
    Carl
    Message was edited by:
    kreitsch

  • Drag a column from one position to another within the table.

    Hello All,
    In Web Dynpro Java, Is it possible to provide user a functionality with which he/she can move the columns of a table from one position to another ?
    Scenario : Users want flexibility to decide the location the columns as per their convinience while they are working with the application.
    So can we develop some code or can we use some UI element so that user is able to drag a column from one position to another within the table.
    Regards
    Mrinalini.

    Hi Mrinalini,
    Yes this is possible you can try to move the table columns (Change the order). for this you don't need to do additional coding or property change its a default property for web Dynpro java tables.
    Regards
    Jeetendra

  • Move column from one place to another..

    Hi
    I need to  arrange the order in which the columns are displayed in my ALV Grid displayed so that i can move the columns from one position to another but its not been allowed in the program so could u pls suggest which field needs to be set for this?
    Regards
    Gunjan

    Hi
    You can use the following statement
    ls_fcat-col_pos           =  01.
    By using this you can fix your column position
    or else to sort the column try like this
    sort-spos = '10'.
    SORT-FIELDNAME = 'Years'.
    SORT-TABNAME = 'DATA_TAB2'.
    sort-UP = 'X'.
    sort-subtot = 'X'.
    SORT-GROUP = '* '.
    APPEND SORT. CLEAR SORT.
    In the It_SOET internal table write:
    IT_SORT-Group = 'X'.
    REPORT  ZSDN                                    .
    TABLES : ekkn,ekko,EKPO,EKET,VBEP,LFA1.
    TYPE-POOLS : slis, ICON.
    DATA : DATE1 TYPE SY-DATUM.
    data : begin of itab occurs 0,
          VBELN like ekkn-VBELN, "SALE ORDER
          VBELP LIKE EKKN-VBELP, "LINE ITEM
          BEDAT LIKE EKKO-BEDAT, "DOCUMENT DATE
          KUNNR LIKE VBAK-KUNNR, "SOLD TO PARTY
          VBELN1 like VBEP-VBELN, "SALE ORDER1
          POSNR1 LIKE VBEP-POSNR, "LINE ITEM
          EDATU LIKE VBEP-EDATU, "END DATE
          EMATN LIKE EKPO-EMATN, "STATUS
          BMENG LIKE VBEP-BMENG, "DAYS
          TDDAT LIKE VBEP-TDDAT, "START DATE
          LMENG LIKE VBEP-LMENG, "DAYS -START DATE
          LABNR LIKE EKPO-LABNR, "STATUS
          PLNUM LIKE VBEP-PLNUM, "OVERALL STATUS
          EKGRP like ekko-EKGRP, "PURCHASING GROUP
          EBELN LIKE EKKN-EBELN, "PO NO
          EBELP like ekkn-EBELP, "LINE ITEM
          EINDT LIKE EKET-EINDT, "DELIVERY DATE
          MATNR LIKE EKPO-MATNR, "MATERIAL NUMBER
          TXZ01 LIKE EKPO-TXZ01, "MATERIAL TEXT
          LIFNR LIKE EKKO-LIFNR, "VENDOR
          MENGE LIKE EKPO-MENGE, "QUANTITY
          WEMNG LIKE EKET-WEMNG, "GR QTY
          WAMNG LIKE EKET-WAMNG, "BAL QTY
          MEINS LIKE EKPO-MEINS, "OUn
          NETPR LIKE EKPO-NETPR, "PRICE
          LOEKZ LIKE EKPO-LOEKZ, "DELETED
          LIFNR1 LIKE LFA1-LIFNR, "VENDOR
          NAME1 LIKE LFA1-NAME1, "VENDOR NAME
          WERKS LIKE EKPO-WERKS, "PLANT
          end of itab.
    DATA : BEGIN OF it_final OCCURS 0,
          KUNNR LIKE VBAK-KUNNR, "SOLD TO PARTY
          LABNR LIKE EKPO-LABNR, "STATUS
          EMATN LIKE EKPO-EMATN, "STATUS
          VBELN like ekkn-VBELN, "SALE ORDER
          VBELP LIKE EKKN-VBELP, "LINE ITEM
          BEDAT LIKE EKKO-BEDAT, "DOCUMENT DATE
          EDATU LIKE VBEP-EDATU, "END DATE
          TDDAT LIKE VBEP-TDDAT, "START DATE
          PLNUM LIKE VBEP-PLNUM, "OVERALL STATUS
          EKGRP like ekko-EKGRP, "PURCHASING GROUP
          EBELN LIKE EKKN-EBELN, "PO NO
          EBELP like ekkn-EBELP, "LINE ITEM
          EINDT LIKE EKET-EINDT, "DELIVERY DATE
          MATNR LIKE EKPO-MATNR, "MATERIAL NUMBER
          TXZ01 LIKE EKPO-TXZ01, "MATERIAL TEXT
          NAME1 LIKE LFA1-NAME1, "VENDOR NAME
          MENGE LIKE EKPO-MENGE, "QUANTITY
          WEMNG LIKE EKET-WEMNG, "GR QTY
          WAMNG LIKE EKET-WAMNG, "BAL QTY
          MEINS LIKE EKPO-MEINS, "OUn
          NETPR LIKE EKPO-NETPR, "PRICE
          WERKS LIKE EKPO-WERKS, "PLANT
    END OF it_final.
    DATA: color TYPE TABLE OF lvc_s_scol WITH HEADER LINE,
          st_layout TYPE slis_layout_alv.
    DATA : fcat TYPE slis_t_fieldcat_alv,
          ls_fcat LIKE LINE OF fcat,
          fheader TYPE TABLE OF slis_listheader WITH NON-UNIQUE DEFAULT KEY
          WITH HEADER LINE INITIAL SIZE 0.
    DATA :i_repid LIKE sy-repid,
         gs_layout   TYPE slis_layout_alv,
         week type n.
    SELECTION-SCREEN BEGIN OF BLOCK bk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: zso FOR ekkn-vbeln.
    SELECT-OPTIONS: zpgr FOR ekko-EKGRP.
    SELECT-OPTIONS: ZPL FOR EKPO-WERKS.
    SELECTION-SCREEN END OF BLOCK bk1.
    gs_layout-colwidth_optimize = 'X'.
    select A~VBELN
          A~VBELP
          A~EBELN
          A~EBELP
          B~MATNR
          B~TXZ01
          B~MENGE
          B~MEINS
          B~NETPR
          B~WERKS
          B~LOEKZ
          C~EINDT
          C~WEMNG
          D~EKGRP
          D~LIFNR
          D~BEDAT
          INTO CORRESPONDING FIELDS OF TABLE ITAB
          FROM EKKN AS A
          INNER JOIN EKPO AS B ON A~EBELN = B~EBELN
          AND A~EBELP = B~EBELP
          INNER JOIN EKET AS C ON A~EBELN = C~EBELN
          AND A~EBELP = C~EBELP
          INNER JOIN EKKO AS D ON A~EBELN = D~EBELN
          WHERE A~VBELN IN ZSO
          AND D~EKGRP IN ZPGR
          AND B~WERKS IN ZPL.
    LOOP AT ITAB.
    ITAB-WAMNG = ITAB-MENGE - ITAB-WEMNG.
    SELECT SINGLE VBELN KUNNR
    FROM VBAK INTO (ITAB-VBELN , ITAB-KUNNR )
    WHERE VBELN = ITAB-VBELN.
    SELECT SINGLE VBELN EDATU
    FROM VBEP INTO (ITAB-VBELN , ITAB-EDATU)
    WHERE VBELN = ITAB-VBELN.
    DATE1 =  SY-DATUM.
    ITAB-BMENG = ITAB-EDATU - DATE1.
    if itab-BMENG  < 0.
       ITAB-EMATN = 'OVER DUE'.
    elseif itab-BMENG ge 0 AND itab-BMENG le 10.
       ITAB-EMATN = 'CRITICAL'.
    elseif itab-BMENG > 10.
       ITAB-EMATN = 'UNDER FOLLOW-UP'.
    endif.
    SELECT SINGLE VBELN POSNR TDDAT
    FROM VBEP INTO (ITAB-VBELN1 , ITAB-POSNR1 , ITAB-TDDAT)
    WHERE VBELN = ITAB-VBELN AND
    POSNR = ITAB-VBELP.
    ITAB-LMENG = ITAB-TDDAT - DATE1.
    if itab-LMENG  < 0.
       ITAB-LABNR = 'OVER DUE'.
    elseif itab-LMENG ge 0 AND itab-LMENG le 10.
       ITAB-LABNR = 'CRITICAL'.
    elseif itab-LMENG > 10.
       ITAB-LABNR = 'UNDER FOLLOW-UP'.
    endif.
    IF ITAB-WAMNG LE 0 OR
        ITAB-LOEKZ = 'L' OR
        ITAB-LOEKZ = 'S'.
        ITAB-PLNUM = 'CLOSED'.
    ELSE.
        ITAB-PLNUM = 'OPEN'.
    ENDIF.
    SELECT SINGLE LIFNR NAME1
    FROM LFA1 INTO (ITAB-LIFNR1 , ITAB-NAME1)
    WHERE LIFNR = ITAB-LIFNR.
    MODIFY ITAB.
    ENDLOOP.
    loop at itab.
       move-corresponding itab to it_final.
       append it_final.
    endloop.
    perform edit_mask.
    i_repid = sy-repid.
    PERFORM fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program      = i_repid
         i_callback_user_command = 'USER_COMMAND'
         it_fieldcat             = fcat
         i_save                  = 'A'
       TABLES
         t_outtab                = it_final
       EXCEPTIONS
         program_error           = 1
         OTHERS                  = 2.
    *&      Form  fieldcat
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM fieldcat .
    MOVE sy-repid TO i_repid.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-decimals_out = 2.
    ls_fcat-col_pos = 1.
    ls_fcat-fieldname = 'KUNNR'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'Sold to Party'.
    ls_fcat-emphasize = 'C310'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  6.
    ls_fcat-fieldname = 'LABNR'.
    ls_fcat-outputlen = 20.
    ls_fcat-seltext_m = 'Window Start Status'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C510'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  5.
    ls_fcat-fieldname = 'EMATN'.
    ls_fcat-outputlen = 15.
    ls_fcat-seltext_m = 'Window End Status'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C410'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  2.
    ls_fcat-fieldname = 'VBELN'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'Sale Order'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C710'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  3.
    ls_fcat-fieldname = 'VBELP'.
    ls_fcat-outputlen = 5.
    ls_fcat-seltext_m = 'Item'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C710'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  4.
    ls_fcat-fieldname = 'EBELN'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'PO Number'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C710'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  7.
    ls_fcat-fieldname = 'EBELP'.
    ls_fcat-outputlen = 5.
    ls_fcat-seltext_m = 'PO Item'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  8.
    ls_fcat-fieldname = 'EKGRP'.
    ls_fcat-outputlen = 3.
    ls_fcat-seltext_m = 'Pur.Group'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  9.
    ls_fcat-fieldname = 'BEDAT'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'PO Doc.Date'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  10.
    ls_fcat-fieldname = 'EINDT'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'PO Delivery Date'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  11.
    ls_fcat-fieldname = 'MATNR'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'Material Number'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  12.
    ls_fcat-fieldname = 'TXZ01'.
    ls_fcat-outputlen = 15.
    ls_fcat-seltext_m = 'Description'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  13.
    ls_fcat-fieldname = 'NAME1'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'Vendor'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C110'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  14.
    ls_fcat-fieldname = 'MENGE'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'PO Quantity'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  15.
    ls_fcat-fieldname = 'WEMNG'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'Quantity Recvd'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  16.
    ls_fcat-fieldname = 'WAMNG'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'Bal Qty'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  17.
    ls_fcat-fieldname = 'MEINS'.
    ls_fcat-outputlen = 2.
    ls_fcat-seltext_m = 'OUn'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  18.
    ls_fcat-fieldname = 'NETPR'.
    ls_fcat-outputlen = 8.
    ls_fcat-seltext_m = 'NetPrice'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  19.
    ls_fcat-fieldname = 'TDDAT'.
    ls_fcat-outputlen = 15.
    ls_fcat-seltext_m = 'Window Start date'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  20.
    ls_fcat-fieldname = 'EDATU'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'Window End date'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  21.
    ls_fcat-fieldname = 'PLNUM'.
    ls_fcat-outputlen = 10.
    ls_fcat-seltext_m = 'PO Status'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C610'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ls_fcat-col_pos           =  22.
    ls_fcat-fieldname = 'WERKS'.
    ls_fcat-outputlen = 5.
    ls_fcat-seltext_m = 'Plant'.
    ls_fcat-tabname = 'IT_FINAL'.
    ls_fcat-emphasize = 'C210'.
    APPEND ls_fcat TO fcat.
    clear ls_fcat.
    ENDFORM.                    " fieldcat
    *&      Form  edit_mask
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM edit_mask .
    loop at it_final.
       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
         EXPORTING
           INPUT  = it_final-vbeln
         IMPORTING
           OUTPUT = it_final-vbeln.
    Read table it_final.
    *  modify it_final.
    endloop.
    ENDFORM.                    " edit_mask
    Reward all helpfull answers
    Regards
    Pavan

  • HT1495 Can I add music from one iPod to another without losing music on the first ipod

    Looking for a way to add music from one iPod to another iPod without losing music on the first iPod ... Please help

    iPods are not backups or data transfer tools.
    Move the music from the computer where it exists to the computer where you want it.
    Then sync the music to the iPod.

  • I need to move 1000 photos from one library to another. How do I do that and keep the ratings and dates they were created?

    I need to move 1000 photos from one library to another. How do I do that and keep the ratings and dates they were created? I tried exporting them, but it loses all info. Also, how do I move the quicktime movies from one iphoto library to another? They were exported as jpgs

    Add both libraries to iPhoto Library Manager.  Then select the events or albums that you want to copy from library A  and drag them to library B in iPLM.
    This video shows the process:
    OT

  • Need to Create Search Help Based on Condtions from one table to another tab

    Hi All,
    I have a table like ZGROUP Which contains the data below
    Filed name Filed Name Filed Name
    ZGROUP ZTYPE ZTEXT
    Entries
    ABC P TEXT FOR
    C P SDFNSDFKLN
    DDDD PSG TEPRTPERERTWERT
    DEF P TEST
    FFFFF PSG
    SEF PS SDFSDFLASLDFNASDLFN
    XYZ PS TESTING
    Whree P is Product , PS- Point of Sales, PSG-Sales Group
    Now i am going to crate another ZPROUDCT TABLE
    FIELDNAME FIELDDESCRITPON
    PRODUCT PROD_DESC
    Entry
    abc pRELATED ENTRY
    My Questions
    1) ZGROUPS table has 3 kinds of data P, PSG, PS type records,
    1) In Table ZPROUDCT , I want to create search help only P records for Table Zproduct of the field Product FROM zGROUPS table
    2) In Table Zsales , I want to create search help only PS records from ZGROUPS table
    3) In Table ZPSG, I want to create search help only PSG records from table ZGROUPS
    is it possible to create search help from One Master Table(ZGROUPS) table to other tables based on conditions.
    Please help me.
    very urgent
    Regards,
    Raju

    if  <condition>
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR <field>
    SELECT <field>
             FROM <table>
             INTO TABLE i_tab
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'                  "function module to provide f4 help to sold-to-party
        EXPORTING
          retfield        = "XXXX"
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = '<field name>'
          value_org       = 'S'
        TABLES
          value_tab       = i_tab
    endif.
    lkike this u can check the condition and selec the data from table and assign it into one internal table and then call the FM it will give the f4 help to particular field
    reward if helpful
    regards,
    Khan.

  • HELP ME i need to pass String variables from one Frame to another

    I need help with some code.
    i need to pass a set of string values from one frame to another.
    from the mainscreen i need to pass what type of seats the user has requested this is done by radio buttons. i need this information to then be passed onto the next frame called Mydialog1 and placed in a textbox with label st. it dosn't comple and i don't know why
    this is getting me depressed. I need some serious help with this
    can anybody get this to work??
    here is the code
    Mainscreen1 code
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class mainscreen1 extends Applet implements ItemListener,
    ActionListener
    private Image layout1;
    private int frame;
    private int xpos,ypos,xdir,ydir;
    public TextField tn, tt1, tt2, total;
    public int value, ticketnum, sum, nr_seats, ctot;
    public Label title, seat, need, payable;
    public Button b1, b2, b3;
    Mydialog1 d;
    String stype, c1, sr;
    public void init()
         setBackground(Color.pink);
    setSize (600, 460);
    setLayout(null);
    //Mydialog1.mehod(sr);
    title=new Label("The Almeida Theater booking system");
         title.setBounds(100,0,400,30);
         title.setFont(new Font("Verdana", Font.PLAIN,24));
         add(title);
    seat=new Label("Please choose a seating location:");
         seat.setBounds(300,40,190,20);
         seat.setFont(new Font("Verdana", Font.BOLD,12));
         add(seat);
    payable=new Label("Total Payable:�");
         payable.setBounds(300,390,100,20);
         payable.setFont(new Font("Verdana", Font.BOLD,12));
         add(payable);
         need=new Label("Please enter the number of seats needed:");
         need.setBounds(300,180,245,20);
         need.setFont(new Font("Verdana", Font.BOLD,12));
         add(need);
         CheckboxGroup sr = new CheckboxGroup();
         Checkbox Stalls = new Checkbox("Stalls", true, sr);
         Stalls.setBounds(490,40,60,25);
         add(Stalls);
         Stalls.addItemListener(this);
         Checkbox Balcony = new Checkbox("Balcony", false, sr);
         Balcony.setBounds(490,65,65,25);
         add(Balcony);
         Balcony.addItemListener(this);
         Checkbox Concessions = new Checkbox("Concessions", false,
    sr);
         Concessions.setBounds(490,90,94,25);
         add(Concessions);
         Concessions.addItemListener(this);
    Button b1=new Button("Quote");
         b1.setBounds(20,395,80,30);
         add(b1);
         b1.addActionListener( this );
         Button b2=new Button("Confirm booking");
         b2.setBounds(110,395,100,30);
         add(b2);
         b2.addActionListener( this );
         Button b3=new Button("Clear");
         b3.setBounds(480,410,100,30);
         add(b3);
         b3.addActionListener( this );
         tt1=new TextField(60);
         tt1.setBounds(300,250,270,20);
    add(tt1);
         tt1.setEditable (false);
         tt1.addActionListener(this);
         tt2=new TextField(60);
         tt2.setBounds(300,300,150,20);
         add(tt2);
         tt2.setEditable (false);
         tt2.addActionListener(this);
         tn=new TextField(3);
         tn.setBounds(545,180,30,20);
         add(tn);
         tn.addActionListener(this);
         total=new TextField(5);
         total.setBounds(400,390,45,20);
         add(total);
         total.setEditable (false);
         total.addActionListener(this);
         xpos = getSize().width/-1400;
         ypos = getSize().height/12;
         layout1 = getImage(getDocumentBase(),"layout1.gif");
         repaint();
    public void itemStateChanged(ItemEvent e)
         String c1 = (String) e.getItem();
         if (c1 == "Stalls")
              value = 20;
         else if (c1 == "Balcony")
              value = 15;
         else
              value = 10;
         tt1.setText("You have chosen to sit in the " + c1 + "
    area");
         tt2.setText("Each seat will cost: �" + value);
         repaint();
    public void clearValue()
              //cb.setSelectiob
              total.setText("");
              tt1.setText("");
              tt2.setText("");
              tn.setText("");
    public void actionPerformed ( ActionEvent e )
    if( e.getActionCommand() == "Quote" )
         int nr_seats = Integer.parseInt(tn.getText());
         total.setText("" +nr_seats*value);
    else if( e.getActionCommand() == "Confirm booking")
         int nr_seats = Integer.parseInt(tn.getText());
         int ctot = Integer.parseInt(total.getText());
         //String stype = String.parseString(c1.getText());
         total.setText("" +nr_seats*value);   
         d = new Mydialog1();      
         d.set_text(nr_seats);
         d.set_texts(ctot);
         stype = sr.getSelectedItem();
    else if ( e.getActionCommand() == "Clear")
         clearValue();
              ticketnum = Integer.parseInt(tn.getText());
              repaint();
         public void paint(Graphics g)
              g.setColor(Color.black);
              g.drawString ("You have chosen:" + ticketnum +"
    seats", 300, 365);
              g.drawImage(layout1,xpos,ypos,null);
    Mydialog1 code
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class Mydialog1 extends Frame implements ItemListener,
    ActionListener
    public Label title, custd, custd1, custfn, custad, custsn, custpc,
    custph, custem, custem1, need;
    public Button b1, b2, b3;
    public TextField cfnt, csnt, cdt,cdt2,cdt3,cdt4, tf, tt, st,
    cpct, cph, cem;
    public int value, nr_seats, ctot;
    creditcard cc;
    String stype, c;
    public Mydialog1() //constructor
         init();
    public void init()
         custer(String c)
         stype = c;
         setBackground(Color.yellow);
    setSize (500, 500);
    setLayout(null);
         setLocation(320,140);
         setVisible(true);
         //Mydialog1(Frame f);
    title=new Label("The Almeida Theater booking system");
         title.setBounds(70,20,400,30);
         title.setFont(new Font("Verdana", Font.PLAIN,24));
         add(title);
         CheckboxGroup ct = new CheckboxGroup();
         Checkbox Mr = new Checkbox("Mr", true, ct);
         Mr.setBounds(5,190,36,25);
         add(Mr);
         Mr.addItemListener(this);
         Checkbox Mrs = new Checkbox("Mrs", false, ct);
         Mrs.setBounds(50,190,42,25);
         add(Mrs);
         Mrs.addItemListener(this);
         Checkbox Miss = new Checkbox("Miss", false, ct);
         Miss.setBounds(95,190,45,25);
         add(Miss);
         Miss.addItemListener(this);
    custd=new Label("If above booking details are correct please
    fill in your deatils below");
         custd.setBounds(5,140,400,30);
         add(custd);
         custd1=new Label("If they are incorrect please click on
    close and re-book seats.");
         custd1.setBounds(5,160,400,30);
         add(custd1);
         custfn=new Label("*ForeName:");
         custfn.setBounds(5,220,60,20);
         add(custfn);
         cfnt=new TextField(60);
         cfnt.setBounds(70,220,150,20);
    add(cfnt);
         custsn=new Label("*SurName:");
         custsn.setBounds(230,220,60,20);
         add(custsn);
         csnt=new TextField(60);
         csnt.setBounds(300,220,150,20);
    add(csnt);
         custad=new Label("*Address:");
         custad.setBounds(5,250,55,20);
         add(custad);
         cdt=new TextField(60);
         cdt.setBounds(70,250,180,20);
    add(cdt);
         cdt2=new TextField(60);
         cdt2.setBounds(70,270,180,20);
    add(cdt2);
         cdt3=new TextField(60);
         cdt3.setBounds(70,290,180,20);
    add(cdt3);
         cdt4=new TextField(60);
         cdt4.setBounds(70,310,180,20);
    add(cdt4);
         custpc=new Label("*Postcode:");
         custpc.setBounds(5,330,60,20);
         add(custpc);
         cpct=new TextField(60);
         cpct.setBounds(70,330,180,20);
    add(cpct);
         custph=new Label("*Telephone:");
         custph.setBounds(5,360,65,20);
         add(custph);
         cph=new TextField(60);
         cph.setBounds(70,360,180,20);
    add(cph);
         custem=new Label("E-mail:");
         custem.setBounds(5,390,65,20);
         add(custem);
         cem=new TextField(60);
         cem.setBounds(70,390,180,20);
    add(cem);
         custem1=new Label("eg: [email protected]");
         custem1.setBounds(250,390,150,20);
         add(custem);
         need=new Label("* = required field.");
         need.setBounds(350,400,150,20);
         add(need);
         //seat number being pased into this textbox
         tf = new TextField();
    tf.setBounds(5, 80, 160,20);
         tf.setEditable (false);
    add(tf);
         //seat number being pased into this textbox
         tt = new TextField();
    tt.setBounds(5, 100, 160,20);
         tt.setEditable (false);
    add(tt);
         //seat number being pased into this textbox
         st = new TextField(stype);
    st.setBounds(5, 120, 230,20);
         st.setEditable (false);
    add(st);
         setVisible(true);
         Button b1=new Button("Close");
         b1.setBounds(20,440,80,30);
         add(b1);
         b1.addActionListener( this );
         Button b2=new Button("Proced with booking");
         b2.setBounds(110,440,150,30);
         add(b2);
         b2.addActionListener( this );
         Button b3=new Button("Clear");
         b3.setBounds(350,440,100,30);
         add(b3);
         b3.addActionListener( this );
    public void itemStateChanged(ItemEvent e)
         String c2 = (String) e.getItem();
         if (c2 == "Mr")
              value = 20;
         else if (c2 == "Mrs")
              value = 15;
         else
              value = 10;
    public void clearValuea()
              //cb.setSelectiob
              cem.setText("");
              cph.setText("");
              cdt.setText("");
              cdt2.setText("");
              cdt3.setText("");
              cdt4.setText("");
              cfnt.setText("");
              csnt.setText("");
              cpct.setText("");
              cph.setText("");
              cem.setText("");
    public void actionPerformed( ActionEvent e )
    if( e.getActionCommand() == "Close" )
    this.dispose();
    else if( e.getActionCommand() == "Proced with booking")
    cc = new creditcard();
    else if( e.getActionCommand() == "Clear")
    clearValuea();
         public void set_text (int nr_seats)
         tf.setText (" You have booked " + nr_seats + " seat/s");
         public void set_texts (int ctot)
         tt.setText (" The total is � " + ctot);
         public void SetTextField(String c1)
         st.setText(c1);
    creditcard
    import java.applet.*;
    import java.awt.*;
    import java.awt.event.*;
    public class creditcard extends Frame implements ActionListener
         public Label title, ccd1, ccfn;
         public Button b1, b2;
         public TextField cnt, cdt, ccfnt;
         public String cfnt;
    public creditcard() //constructor
         init();
    public void init()
         setBackground(Color.green);
    setSize (500, 500);
    setLayout(null);
         setLocation(320,140);
         setVisible(true);
         //Mydialog1(Frame f);
    title=new Label("The Almeida Theater booking system");
         title.setBounds(70,20,400,30);
         title.setFont(new Font("Verdana", Font.PLAIN,24));
         add(title);
         ccd1=new Label("If billing address is different please edit below information.");
         ccd1.setBounds(5,50,400,20);
         ccd1.setFont(new Font("Verdana", Font.BOLD,12));
         add(ccd1);
         ccfn=new Label("*ForeName:");
         ccfn.setBounds(5,220,60,20);
         add(ccfn);
         ccfnt=new TextField(60);
         ccfnt.setBounds(70,220,150,20);
    add(ccfnt);
         Button b1=new Button("Close");
         b1.setBounds(20,440,80,30);
         add(b1);
         b1.addActionListener( this );
         Button b2=new Button("Proced with booking");
         b2.setBounds(110,440,150,30);
         add(b2);
         b2.addActionListener( this );
    public void actionPerformed( ActionEvent e )
    if( e.getActionCommand() == "Close" )
    this.dispose();
    else if( e.getActionCommand() == "Proced with booking")
    setBackground(Color.red);

    Here's the new mainscreen1.java file...
    public class mainscreen1 extends Applet implements ItemListener,
    ActionListener
      private Image layout1;
      private int frame;
      private int xpos,ypos,xdir,ydir;
      public TextField tn, tt1, tt2, total;
      public int value, ticketnum, sum, nr_seats, ctot;
      public Label title, seat, need, payable;
      public Button b1, b2, b3;
      Mydialog1 d;
      CheckboxGroup checkGroup; // heres the new global CheckboxGroup variable.
      String stype, c1, dialogString; // new name for the string too...
      public void init()
        setBackground(Color.pink);
        setSize(600, 460);
        setLayout(null);
        //dialogString = "Hi";
        //Mydialog1.mehod(dialogString);
        title=new Label("The Almeida Theater booking system");
        title.setBounds(100,0,400,30);
        title.setFont(new Font("Verdana", Font.PLAIN,24));
        add(title);
        seat=new Label("Please choose a seating location:");
        seat.setBounds(300,40,190,20);
        seat.setFont(new Font("Verdana", Font.BOLD,12));
        add(seat);
        payable=new Label("Total Payable:�");
        payable.setBounds(300,390,100,20);
        payable.setFont(new Font("Verdana", Font.BOLD,12));
        add(payable);
        need=new Label("Please enter the number of seats needed:");
        need.setBounds(300,180,245,20);
        need.setFont(new Font("Verdana", Font.BOLD,12));
        add(need);
        checkGroup = new CheckboxGroup(); // instantiate the global CheckboxGroup
        Checkbox Stalls = new Checkbox("Stalls", true, checkGroup); // add to the CheckboxGroup
        Stalls.setBounds(490,40,60,25);
        add(Stalls);
        Stalls.addItemListener(this);
        Checkbox Balcony = new Checkbox("Balcony", false, checkGroup);
        Balcony.setBounds(490,65,65,25);
        add(Balcony);
        Balcony.addItemListener(this);
        Checkbox Concessions = new Checkbox("Concessions", false, checkGroup);
        Concessions.setBounds(490,90,94,25);
        add(Concessions);
        Concessions.addItemListener(this);
        Button b1=new Button("Quote");
        b1.setBounds(20,395,80,30);
        add(b1);
        b1.addActionListener( this );
        Button b2=new Button("Confirm booking");
        b2.setBounds(110,395,100,30);
        add(b2);
        b2.addActionListener( this );
        Button b3=new Button("Clear");
        b3.setBounds(480,410,100,30);
        add(b3);
        b3.addActionListener( this );
        tt1=new TextField(60);
        tt1.setBounds(300,250,270,20);
        add(tt1);
        tt1.setEditable(false);
        tt1.addActionListener(this);
        tt2=new TextField(60);
        tt2.setBounds(300,300,150,20);
        add(tt2);
        tt2.setEditable(false);
        tt2.addActionListener(this);
        tn=new TextField(3);
        tn.setBounds(545,180,30,20);
        add(tn);
        tn.addActionListener(this);
        total=new TextField(5);
        total.setBounds(400,390,45,20);
        add(total);
        total.setEditable(false);
        total.addActionListener(this);
        xpos = getSize().width/-1400;
        ypos = getSize().height/12;
        layout1 = getImage(getDocumentBase(),"layout1.gif");
        repaint();
      public void itemStateChanged(ItemEvent e) {
        String c1 = (String) e.getItem();
        if (c1 == "Stalls") {
          value = 20;
        else if (c1 == "Balcony") {
          value = 15;
        else {
          value = 10;
        tt1.setText("You have chosen to sit in the " + c1 + " area");
        tt2.setText("Each seat will cost: �" + value);
        repaint();
      public void clearValue() {
        //cb.setSelectiob
        total.setText("");
        tt1.setText("");
        tt2.setText("");
        tn.setText("");
      public void actionPerformed( ActionEvent e ) {
        if( e.getActionCommand() == "Quote" ) {
          int nr_seats = Integer.parseInt(tn.getText());
          total.setText("" +nr_seats*value);
        else if( e.getActionCommand() == "Confirm booking") {
          int nr_seats = Integer.parseInt(tn.getText());
          int ctot = Integer.parseInt(total.getText());
          total.setText("" +nr_seats*value);
          d = new Mydialog1();
          d.set_text(nr_seats);
          d.set_texts(ctot);
          // You can do your checkbox selection data transfer here like this...
          // I used d.SetTextField because you had that defined in the Mydialog1 class.
          Checkbox chkBx = checkGroup.getSelectedCheckbox();
          d.SetTextField(chkBx.getLabel());
        else if ( e.getActionCommand() == "Clear") {
          clearValue();
        ticketnum = Integer.parseInt(tn.getText());
        repaint();
      public void paint(Graphics g)
        g.setColor(Color.black);
        g.drawString("You have chosen:" + ticketnum +" seats", 300, 365);
        g.drawImage(layout1,xpos,ypos,null);
    }

  • How to insert records with LONG RAW columns from one table to another

    Does anybody know how to use subquery to insert records with columns of LONG RAW datatype from one table to another? Can I add a WHERE clause in the subquery statement? Thanks.

    Insert into ... Select statements are not supported for long or long raw. You will have to either use PL/SQL or convert your long raw to blobs.

  • 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

  • Need help in passing data from one page to other page in oaf

    Dear All,
    I have a requirement as below.
    I am doing some selection in one page and populating the data in another page table region, next time when i am selecting another row and pressing the button i need to display the previous row as well as new row, how can i achieve this, currently i am able to see only the first row what i selected first.
    Ex: 1 st scenario: after passing the selected data from one page to base page the data looks like below in base page.
    1 test desc
    2nd scenarios: when i am again selcting data and passing to the base page it should be like that
    1 test desc
    2 test desc
    but currently it is showing
    1 test desc only for the 2nd case, can any one please help me on thsi , its little bit urgent
    Thnaks

    How are you passing the values to the base page? Are you using setting the retainAM parameter to true while doing a forward.

  • Move workflow status column from one library to another in Sharepoint 2010

    Good morning,
     I have two libraries in the same site, LibraryA and LibraryB.
     On LibraryA, users upload documents upon which they start a collect signatures workflow. The view on LibraryA contains a column with the signatures workflow name showing status: ‘Compete’, ‘In progress’.
     Now on LibraryA I have created a workflow to move any document one month after creation to LibraryB (using retention schedule) irrespective of signature workflow status.
     Now what I would like is to have the signature workflow status shown in LibraryB as well. From what I understand you can add the workflow status column only on the library with which the workflow is associated. I also tried, on LibraryB, to create a new
    column which Lookups in {Signature Approval History – Outcome} but this did not do the trick either.
     Any workarounds?
     Many Thanks

    Hi,
    According to your description, my understanding is that you want to move the workflow status column to another library in SharePoint 2010.
    I recommend to use another column to get the value of the workflow status column and then move this column to another library.
    We can use workflow to update the column with the value of workflow status column.
    However, the workflow status column stores the value with numbers which represent different status, so we need to update the column with corresponding status based on the numbers in the workflow.
    http://chanakyajayabalan.wordpress.com/2010/03/08/sharepoint-workflow-status-codes/
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Possible to add bookmarks from one computer to another?

    Hi all. I posted this in the Safari Forum but no one has replied, so I thought I'd try here. I have one PowerBook at home and another at work. I use Safari on both. Over time, they have developed different sets of bookmarks, but I would like them to be the same on both computers. Is there a way to Import/Export from one machine to the other without either erasing bookmarks they don't have in common or duplicating the ones that they do?
    (I'm now using Camino on one of the machines, and have imported the Safari bookmarks to it, but my question is still the same: Can I add the bookmarks from one computer to the other without erasing or duplicating bookmarks in the target software.)
    Thanks for any light you can shed.

    I copied my Bookmarks.plist file to a memory stick and brought it to work today. But when I went to copy it into the Safari folder it said "A file called Bookmarks.plist already exists in that location. Do you want to replace it?" But of course I don't want to replace it, I just want to add to it. So unless someone knows of some obscure "Merge" command somewhere in OS X, I guess I'll just have to try Bookit. Cheers, all. GB

  • NEED HELP ASAP-populate contents from 5 tables into one master table

    Scenario:
    Assign a new_customer_id to each existing customer of our three business. A master lookup table (M) was given to me with pre-populated (SEQ_NOs), (NEW_CUSTIDs), and NULL in (OLD_CUSTIDS). My duty is to
    (1) Fill the M.OLD_CUSTID column with existing customer ids from T1, T2, T3 (uniquely).
    (2) Once the master lookup table is filled, add (SEQ_NO), and (NEW_CUSTID) column to the 3 existing customer tables to hold the new information.
    (3) At the end of the project, remove the existing customer ids from the T1, T2, T3.
    My problem is that there are no associations between the master table and existing customer tables (no keys). The code would be:
    update M
    set OLD_CUSTID= (select OLD_CUSTID from T1 where M.??=T1.??)
    Since the M.OLD_CUSTID and T1.NEW_CUSTID are NULL at this stage, and there are no keys to tie them together. I don't know how to fill both tables. Can someone help me ASAP? Thanks in Advance.
    -ORACLE Newbi

    I am building a "MASTER LOOKUP TABLE" to map the NEW_CUSTID and the OLD_CUSTID. The columns in this M table are:
    CREATE TABLE MKT.M
         "LOOKUP_SEQ" INTEGER, <=== from sequence
         "NEW_CUSTID" CHAR(6), <=== populated with strings given by biz analyst
         "OLD_CUSTID" INTEGER, <=== need to dump all existing custid (unique)
         PRIMARY KEY ("NEW_CUSTID") RELY NOVALIDATE
         ORGANIZATION INDEX TABLESPACE "MKT"
    Table T1/T2/T3 are slightly different but they all contain:
    CUST_ID INTEGER
    CUST_NAME CHAR(50)
    CUST_SINCE DATE
    CUST_ADDR1 CHAR(30)
    CUST_ADDR2 CHAR(30)
    DITY CHAR(30)
    STATE CHAR(2), etc.
    Since M is the lookup table for old-to-new customer ID mapping. There are no need to associat other than just enter the old IDs into the M table.
    Thanks for helping me. Any suggestion?

Maybe you are looking for

  • Regarding back ground job scheduling

    Hi,     one of our program was sheduled for back ground job, by another user, so just i need to knwo when this job is sheduled and it is executing daily, so, i need to knwo whether he has created a background job through , sm36, or through a program,

  • Unserialized delta

    Hi all I read a weblog of Mr robero regarding the delta types. In V3 unserialized delta. What does document sequence means. In that its given that V3 unserialized delta doesnt consider sequence and for Inventory sequence is not important. Can anyone

  • Invalid numbers in a date spinner

    If an invalid number is entered into a numeric part of a date in a JSpinner, the control adjusts other parts to accomodate it. For example, if a day number is given as 40, one gets a day in the next month. This appears to be because the value in the

  • Two questions about smart cards

    Hi there, I've got some problems with my smart card. It's greater than my skills. Here's what I would like to ask you: - I'm using GPShell to list all applications. Here's output: mode_201 enable_trace establish_context card_connect -readerNumber 2 *

  • Need to make Partner maintanance mandatory in installed base.

    Dear CRM Folks, My requirement is..I need to make partner data mandatory at installed base if not maintained system should give error. Currently we can save installed base without Partner data maintained. I have checked all the BADI's given in IMG bu