Oracle table merge - JOIN help needed

Can someone help me with this results we want:
F_FCN_DT F_FCN_NUM F F_APPLD_DT F_APPLD_AMT F_R C_TCN_NUM
2007-08-16 54 1 2008-02-08 4.06 131 40617700776019668
2007-08-16 54 1 2008-02-08 4.06 135 40623900776014856
2007-08-16 54 1 2007-11-02 1022.08 135 60630500002011374
2007-08-16 54 1 2008-02-08 1022.08 135 30632600004003338
Below listed are the two tables and data combinations, which need to be linked in this process.
SQL> desc test11
Name Null? Type
F_FCN_DT NOT NULL CHAR(10)
F_FCN_NUM NOT NULL NUMBER(5)
F_FCN_MED_CD NOT NULL CHAR(1)
F_APPLD_DT NOT NULL CHAR(10)
F_APPLD_AMT NOT NULL NUMBER(13,2)
F_RSN_CD NOT NULL CHAR(3)
SQL> select * from test11;
F_FCN_DT F_FCN_NUM F F_APPLD_DT F_APPLD_AMT F_R
2007-08-16 54 1 2008-02-08 4.06 131
2007-08-16 54 1 2008-02-08 4.06 135
2007-08-16 54 1 2007-11-02 1022.08 135
2007-08-16 54 1 2008-02-08 1022.08 135
SQL> desc test12
Name Null? Type
F_FCN_DT NOT NULL CHAR(10)
F_FCN_NUM NOT NULL NUMBER(9)
F_FCN_MED_CD NOT NULL CHAR(1)
F_APPLD_AMT NOT NULL NUMBER(23,6)
C_TCN_NUM NOT NULL CHAR(17)
SQL> select * from test12;
F_FCN_DT F_FCN_NUM F F_APPLD_AMT C_TCN_NUM
2007-08-16 54 1 4.06 40617700776019668
2007-08-16 54 1 4.06 40623900776014856
2007-08-16 54 1 1022.08 60630500002011374
2007-08-16 54 1 1022.08 30632600004003338

Hi,
If you don't care which row from test11 gets paired with which row from test12 (as long as they're in the same group), then use the analytic ROW_NUMBER function to assign arbitrary ids to each row within each group, and add that id to the join condition, like this:
WITH    test11_plus  AS
     SELECT  f_fcn_dt, f_fcn_num, f, f_appld_dt, f_appld_amt, f_r               -- or whatever you need
     ,     ROW_NUMBER () OVER ( PARTITION BY  f_fcn_dt, f_fcn_num, f, f_appld_amt     -- common columns only
                               ORDER BY      NULL
                       )                    AS r_num
     FROM    test11
,     test12_plus  AS
     SELECT  f_fcn_dt, f_fcn_num, f, f_appld_amt, c_tcn_num                    -- or whatever you need
     ,     ROW_NUMBER () OVER ( PARTITION BY  f_fcn_dt, f_fcn_num, f, f_appld_amt     -- common columns only
                               ORDER BY      NULL
                       )                    AS r_num
     FROM    test11
SELECT     p11.*               -- Or list everything except r_num
,     p12.c_tcn_num
FROM     test11_plus     p11
JOIN     test12_plus     p12     ON     p11.f_fcn_dt     = p12.f_fcn_dt
                    AND     p11.f_fcn_num     = p12.f_fcn_num
                    AND     p11.f          = p12.f
                    AND     p11.f_appld_amt     = p12.f_appld_amt
                    AND     p11.r_num     = p12.r_num
;If the number of rows in the two tables may be different, then you may need an outer join.

Similar Messages

  • New to Oracle .... help needed

    Hi,
    New to Oracle, more familiar with SQL Server.
    I have installed Oracle 12c  Release 12.1.0.2.0 and access EM via https://localhost:5500/em.
    I login as SYS but I cannot see how to create a database table.
    I have created a PDB but I do not see any options to create tables or table spaces.
    can anyone help me and tell me how to create a table and enter numeric data?
    I want to be able to set up a table. Add data to it and then connect via ODBC to view the data in a third party application.
    Configuring an ODBC connection what is my TNS service name?
    Thanks

    You need to create a column in the detail table which willl hold the Master (or Parent) Primary key. From what I could understand from your posting, this column should be OR_SEQ and it does not seem to exist in the detail table.
    You can create a table in oracle like this:
    Create table <table_name) (<column_name> <DataType> [Constraints] [,....)
    For example the table OR_Record can be created as
    CREATE TABLE OR_REC
    OR_SEQ NUMBER NOT NULL
    , MRN VARCHAR2(10)
    .... and so on
    Better you download the latest SQLDEVELOPER from [OTN |http://www.oracle.com/technology/software/products/sql/index.html]. You can right click on the tables and merely enter the Table name, column names, not null and relationships. SQLDeveloper will create the SQL and create the table you want.
    There are plenty of walkthroughs and examples at this [site:|http://www.oracle.com/technology/products/database/sql_developer/index.html]
    HTH
    -- rsrini

  • Altering table degrade performance - Help needed?

    Hi,
    I have a table called test_case which has 60 million records.
    I got a requirement to add new column with not null constraint and default value as 0.
    When I try to add new column with the above said constraints the schema modification taking 40 minutes.
    Alter table test_case add tax number(5) not null default 0
    Is there any workaround to modiy the schema with less minutes?
    I would appreciate if anybody help on this.
    Regards
    SP

    You wanted a faster approach that’s why I suggested this approach.  To my understanding there isn't any other method faster than CTAS method.
    Something like this you need to do  ( If you are in a position to apply the changes ) –
    1.     Create a Tables using CTAS method I mentioned
    CREATE TABLE New_Table ( col1,
                                            Col2,
                                             tax number(5)  Not Null
    As Select col1
                    ,col2
                    ,0
    From  Original_Table;
    2.     Disable the constraints ( Original Table )
    3.     Rename the Original_Table to Original_Table_Bak
    4.     Rename the  New_Table  to the Original_Table
    5.     Enable back the constraints
    6.     Drop the Original_Table_Bak

  • Full Outer Join Help Needed

    Hi All,
    I am new to crystal and my sql.
    l have 2 command objects in that i have a common column pos_no.Now i need to apply Fullouterjoin between pos_no,but in crystal we don,t have that option.
    So i saw some threads that we need to apply leftouterjoin union rightouterjoin to get FOJ in db level ,i tried ,but i don't have much knowledge in my sql.So can any one please apply FOJ between Pos_no of these two queries.
    Please help me i strucked here
    1st Query:
    select
    MIN(till_close.start_transaction_id) AS start_trans_id,
    MAX(till_close.end_transaction_id) AS end_trans_id,
    pos_config.pos_no,
    pos_config.name AS pos_name,
    SUM(transaction_tender.amount) AS EodDeposit
    FROM
    till_close
    LEFT OUTER JOIN employee ON (till_close.employee_id = employee.employee_id)
    INNER JOIN pos_config ON (till_close.pos_config_id = pos_config.pos_config_id)
    INNER JOIN transaction_tender ON (till_close.end_transaction_id = transaction_tender.transaction_id)
    INNER JOIN media_type ON (transaction_tender.media_type_id = media_type.media_type_id)
    WHERE
      DATE_FORMAT(till_close.transaction_date,'%d/%m/%Y') = DATE_FORMAT(STR_TO_DATE(?,'%d/%m/%Y'),'%d/%m/%Y')
    AND transaction_tender.media_type_id NOT IN (10000)
    GROUP BY
    pos_config.pos_no
    ORDER BY
    pos_config.pos_no
    2nd Query:
    select
    pos_config.pos_no,
    pos_config.name AS pos_name,
    SUM(CASE WHEN transaction.transaction_type_id=7 AND ((SELECT COUNT(transaction_id) FROM transaction_tender WHERE transaction_id = transaction.transaction_id  AND media_type_id IN (SELECT media_type_id FROM media_type WHERE tender_type_id=12) AND amount < 0 )>0) THEN 0
      WHEN  transaction_tender.balance < 0
      THEN transaction_tender.amount
      ELSE (transaction_tender.amount - transaction_tender.balance)
      END) AS net
    FROM
    TRANSACTION
    INNER JOIN transaction_tender ON (transaction.transaction_id = transaction_tender.transaction_id)
    INNER JOIN media_type ON (transaction_tender.media_type_id = media_type.media_type_id)
    INNER JOIN pos_config ON (transaction.pos_config_id = pos_config.pos_config_id)
    WHERE
    transaction.transaction_date = DATE_FORMAT(STR_TO_DATE(?, '%d/%m/%Y'), '%Y-%m-%d')
    AND transaction.transaction_type_id IN (1,5,7)
    AND transaction.transaction_status_id = 3
    AND transaction.is_training_mode = 0
    GROUP BY
    pos_config.pos_no

    hi Divya,
    i would definitely take the advice from the folks here on a rewrite of your commands into one command.
    since you've got 2 commands that are bringing back different results you may wish to consider bringing back the results from the 2nd command via a sub-query.
    the general idea of the query is below, but you'll need to consult your online help for your database and or your dba for the correct syntax for your situation.
    notes:
    1) the subselect is in the bold font and is defined as a result set in the join...again, please consult your database help or the appropriated forum for your database as your syntax may vary
    2) the fields in the subquery are then referenced in the select clause using the TT alias assigned to the result set in the join
    3) the full outer join i guessed that you wanted on the two pos_no fields
    4) if you do try to do this method and are looking on your database forum, do a search on "subquery multiple columns"
    cheers,
    jamie
    select
    MIN(till_close.start_transaction_id) AS start_trans_id,
    MAX(till_close.end_transaction_id) AS end_trans_id,
    pos_config.pos_no AS PC_pos_no,
    pos_config.name AS pos_name AS PC_pos_name,
    SUM(transaction_tender.amount) AS EodDeposit,
    TT.pos_no AS TT_pos_no,
    TT.pos_name AS TT_pos_name,
    TT.net
    FROM
    till_close
    LEFT OUTER JOIN employee ON (till_close.employee_id = employee.employee_id)
    INNER JOIN pos_config ON (till_close.pos_config_id = pos_config.pos_config_id)
    INNER JOIN transaction_tender ON (till_close.end_transaction_id = transaction_tender.transaction_id)
    INNER JOIN media_type ON (transaction_tender.media_type_id = media_type.media_type_id)
    FULL OUTER JOIN
    (select
    pos_config.pos_no,
    pos_config.pos_name,
    SUM(CASE WHEN transaction.transaction_type_id=7 AND ((SELECT COUNT(transaction_id) FROM transaction_tender WHERE transaction_id = transaction.transaction_id  AND media_type_id IN (SELECT media_type_id FROM media_type WHERE tender_type_id=12) AND amount < 0 )>0) THEN 0
      WHEN  transaction_tender.balance < 0
      THEN transaction_tender.amount
      ELSE (transaction_tender.amount - transaction_tender.balance)
      END) AS net
    FROM
    TRANSACTION
    INNER JOIN transaction_tender ON (transaction.transaction_id = transaction_tender.transaction_id)
    INNER JOIN media_type ON (transaction_tender.media_type_id = media_type.media_type_id)
    INNER JOIN pos_config ON (transaction.pos_config_id = pos_config.pos_config_id)
    WHERE
    transaction.transaction_date = DATE_FORMAT(STR_TO_DATE(?, '%d/%m/%Y'), '%Y-%m-%d')
    AND transaction.transaction_type_id IN (1,5,7)
    AND transaction.transaction_status_id = 3
    AND transaction.is_training_mode = 0
    GROUP BY
    pos_config.pos_no) AS TT
    ON TT.pos_no =  pos_config.pos_no
    WHERE
      DATE_FORMAT(till_close.transaction_date,'%d/%m/%Y') = DATE_FORMAT(STR_TO_DATE(?,'%d/%m/%Y'),'%d/%m/%Y')
    AND transaction_tender.media_type_id NOT IN (10000)
    GROUP BY
    pos_config.pos_no
    ORDER BY
    pos_config.pos_no

  • Oracle forms installation - some help need

    I am trying to install Oracle forms - but get the follwing message:
    Checking swap space: 576 MB available, 1535 MB required. Failed <<<<
    Some requirement checks failed. You must fulfill these requirements before
    continuing with the installation,at which time they will be rechecked.
    Continue? (y/n) [n]
    actually - I have no choice to choose y and try what's going on - so - is this means that I shoul add some 1.5 GB of RAM to my computer? (I have already 700MB, only 300 of them are used)? I am using WinXP, free HD is above 3.5 GB, 2.4GHz processor.
    Can I try to find some workaround - e.g. simply try to copy jar's from 'stage' (direcotry in installation disk) in Oracle application server's lib directory (where it is in Oracle_Home directory?)?
    Any experience with installing Oracle forms?
    This was trying to run setup.exe, but when I am trying to run wsf.exe - I get:
    SEVERE: Unable to locate the MDAC Update Status registry key value, probably because the installation was aborted.
    MDAC possibly stands for Microsoft Data Access Components? If so - where is problem - I can run a lot of DB servers, including Oracle server itself normally?
    BTW - is there any free service available for Oracle Forms skills development (e.g. as for Oracle SQL the Intel test drive is available?)
    user454720

    OK - now I increased the max limit of my page file and now I achieved this:
    Starting Oracle Universal Installer...
    Checking installer requirements...
    Checking operating system version: must be 5.0, 5.1 or 5.2 . Actual 5.1
    Passed
    Checking monitor: must be configured to display at least 256 colors . Actual
    4294967296 Passed
    Checking swap space: must be greater than 1535 MB . Actual 1600MB Passed
    Checking Temp space: must be greater than 150 MB . Actual 1942 MB Passed
    All installer requirements met.
    Preparing to launch Oracle Universal Installer from C:\DOCUME~1\ADMINI~1\LOCALS
    ~1\Temp\OraInstall2006-03-18_01-57-43PM. Please wait ...
    however - after this I receive the standard messgae:
    'setup.exe has encountered a problem and need to close. we are sorry for the inconvenience..... Please tell Microsoft about thsi problem'
    actually - I have little ideas what to do further - maybe I should look for other Oracle Installer version? I am using:
    Oracle Universal Installer version: 10.1.0.2.0
    and I am trying to install
    Oracle Deveoper Suite: 10.1.2.0.2 (so - a bit higher)
    I can run OUI without any problems, my Default JRE is 1.5_1 - so - all seems to be OK?
    Please - if any idea - help me :))
    Thanks in advance!

  • Oracle Business Events related help needed

    Hello All,
    Good Morning , wanted some help regards Oracle Business events be used for sending notifications.
    We are having a situation wherein we need to send notifications to the sales team whenever there are changes to the order line status..lets say the order line moves from Booked status to Awaiting Shipping status and further to Picked or Shipped status, we need to notify the sales team about this.
    If we are going to use Business Events concept for this we wanted to check on the below points -
    1.At the order line level what all seeded business events have been defined ( means if we could get the complete listing ) and whether any of these gets triggered when the order line status changes...we are on Oracle Release 12.0.6 version
    2.Also is there a way to know what all parameters are being passed for a given seeded event, so that we know which parameters we could retrieve within the subscription using wf_event_t.getvalueforparameter function.
    3.Regards setting up Subscriptions for this order line seeded business event : means we could see an option which says : "Send a Notification" when we are defining a Cstom Sbscription ( Now here it asks to give the Message Type ( This would be workflow item type where the message is defined in workflow ) and Message Name ) ..
    Now if in this NOTIFICATION MESSAGE we need to show details like order number , sales rep , order line status etc ( then where do we set these details in the Event and also how do we pass these details from subscription  so that it shows in the notification )
    Means where do we setup and define values for the notification message attributes and how do we pass these values from event to the subscription and finally to the notification..How do we achieve this because some of the message attributes for the notification are Document Type while some are text/number types.. These would be required to show in the notif message...
    4. Also once we send the notification lets say succesfully to person or a role using a subscription , how do we capture the response ...
    Could someone please help us with this as we are stuck with this at the moment.
    many thanks

    Hi,
    please reply the above questions.it  would be a great help for me.
    Thanks
    Sap Guru

  • Errors in impdp command on oracle 10g database-urget help needed

    Hi,
    could you plz help me to solve below errors which are coming while doing import with impdp command in oracle 10g 10.1.0.4.0 os: Red Hat Enterprise Linux ES release 4
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    Job "DCA"."SYS_IMPORT_SCHEMA_01" stopped due to fatal error at 15:31
    i tried to restart job but the following errors coming
    UDI-00008: operation generated ORACLE error 39078
    ORA-39078: unable to dequeue message for agent KUPC$A_1_20081111155728 from queue "KUPC$C_1_20081111155728"
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 2356
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 3261
    ORA-06512: at line 1
    thanks in advance

    Can you check Metalink Note 376022.1? Your STREAMS_POOL_SIZE parameter may be too small.
    If you don't have Metalink access, try this :
    sql> alter system set STREAMS_POOL_SIZE=100M scope=spfile;
    sql> shutdown immediate
    sql> startup
    Note : the Portal Applications forum may not be the appropriate forum for this datapump issue. Try one of the database forums as you'll have a wider audience there.

  • JRadioButton grouped in a table cell. Help Needed.

    Hello...
    I am looking for code samples or exaples of how to implement a group of 3 radio buttons in a column of each row i create. I have not been able to find anything and I would appreciate any leads or code samples.
    basically i have 4 or 5 columns and one of the colums will take 3 radio buttons but only 1 of the 3 can be selected at a time.
    this is kind of what my table looks like.
    ListTable.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
                    {"000000000061", "05/05/2005", "this is where the 3 radio buttons will be grouped","05/05/2004"},
                    {null, null, null, null}
                new String [] {
                    "List ID", "Expiration Date", "Status", "Date Created"
                Class[] types = new Class [] {
                    java.lang.Object.class, java.lang.Object.class, java.lang.Boolean.class, java.lang.Object.class
                boolean[] canEdit = new boolean [] {
                    false, false, true, false
                public Class getColumnClass(int columnIndex) {
                    return types [columnIndex];
                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return canEdit [columnIndex];
            jPanel2.add(ListTable, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 44, 440, 130));Thanks very much.
    S

    Hope this helps :import javax.swing.*;
    import javax.swing.table.*;
    import java.util.Date;
    import java.util.Vector;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    public class TableTestPanel extends JPanel {
         private static final String[] COLUMN_NAMES = {"List ID", "Expiration Date", "Status", "Date Created"};
         private static final DateFormat DATE_FORMAT = new SimpleDateFormat("dd/MM/yyyy");
         private static class StatusPanel extends JPanel {
              private JRadioButton theSingleOption;
              private JRadioButton theMarriedOption;
              private JRadioButton theDivorcedOption;
              public StatusPanel() {
                   super(new GridLayout(3, 1));
                   setOpaque(true);
                   ButtonGroup buttonGroup = new ButtonGroup();
                   theSingleOption = new JRadioButton("Single");
                   theSingleOption.setOpaque(false);
                   add(theSingleOption);
                   buttonGroup.add(theSingleOption);
                   theMarriedOption = new JRadioButton("Married");
                   theMarriedOption.setOpaque(false);
                   add(theMarriedOption);
                   buttonGroup.add(theMarriedOption);
                   theDivorcedOption = new JRadioButton("Divorced");
                   theDivorcedOption.setOpaque(false);
                   add(theDivorcedOption);
                   buttonGroup.add(theDivorcedOption);
              public Status getStatus() {
                   if (theMarriedOption.isSelected()) {
                        return Status.MARRIED;
                   } else if (theDivorcedOption.isSelected()) {
                        return Status.DIVORCED;
                   } else {
                        return Status.SINGLE;
              public void setStatus(Status status) {
                   if (status == Status.MARRIED) {
                        theMarriedOption.setSelected(true);
                   } else if (status == Status.DIVORCED) {
                        theDivorcedOption.setSelected(true);
                   } else {
                        theSingleOption.setSelected(true);
         private static class Status {
              static final Status SINGLE = new Status("Single");
              static final Status MARRIED = new Status("Married");
              static final Status DIVORCED = new Status("Divorced");
              private final String myName; // for debug only
              private Status(String name) {
                   myName = name;
              public String toString() {
                   return myName;
         private static class TableEntry {
              private static int instanceNumber;
              private Long theId;
              private Date theExpirationDate;
              private Status theStatus;
              private Date theCreationDate;
              public TableEntry() {
                   instanceNumber++;
                   theId = new Long(instanceNumber);
                   theExpirationDate = new Date();
                   theStatus = Status.SINGLE;
                   theCreationDate = new Date();
              public TableEntry(Long anId, Date anExpirationDate, Status aStatus, Date aCreationDate) {
                   theId = anId;
                   theExpirationDate = anExpirationDate;
                   theStatus = aStatus;
                   theCreationDate = aCreationDate;
              public Long getId() {
                   return theId;
              public Date getExpirationDate() {
                   return theExpirationDate;
              public Status getStatus() {
                   return theStatus;
              public Date getCreationDate() {
                   return theCreationDate;
              public void setId(Long anId) {
                   theId = anId;
              public void setExpirationDate(Date anExpirationDate) {
                   theExpirationDate = anExpirationDate;
              public void setStatus(Status aStatus) {
                   theStatus = aStatus;
              public void setCreationDate(Date aCreationDate) {
                   theCreationDate = aCreationDate;
         private static class MyTableModel extends AbstractTableModel {
              private Vector theEntries;
              public MyTableModel() {
                   theEntries = new Vector();
              public void add(TableEntry anEntry) {
                   int index = theEntries.size();
                   theEntries.add(anEntry);
                   fireTableRowsInserted(index, index);
              public void remove(int aRowIndex) {
                   if (aRowIndex < 0 || aRowIndex >= theEntries.size()) return;
                   theEntries.removeElementAt(aRowIndex);
                   fireTableRowsDeleted(aRowIndex, aRowIndex);
              public int getRowCount() {
                   return theEntries.size();
              public String getColumnName(int column) {
                   return COLUMN_NAMES[column];
              public Class getColumnClass(int columnIndex) {
                   switch (columnIndex) {
                        case 0:
                             return Long.class;
                        case 1:
                             return Date.class;
                        case 2:
                             return Status.class;
                        case 3:
                             return Date.class;
                   return Object.class;
              public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
                   TableEntry entry = (TableEntry) theEntries.elementAt(rowIndex);
                   switch (columnIndex) {
                        case 0:
                             try {
                                  entry.setId(new Long(Long.parseLong(aValue.toString())));
                             } catch (NumberFormatException nfe) {
                                  return;
                             break;
                        case 1:
                             entry.setExpirationDate((Date)aValue);
                             break;
                        case 2:
                             entry.setStatus((Status)aValue);
                             break;
                        case 3:
                             entry.setCreationDate((Date)aValue);
                             break;
                        default :
                             return;
                   fireTableCellUpdated(rowIndex, columnIndex);
              public boolean isCellEditable(int rowIndex, int columnIndex) {
                   return true;
              public int getColumnCount() {
                   return 4;
              public Object getValueAt(int rowIndex, int columnIndex) {
                   TableEntry entry = (TableEntry) theEntries.elementAt(rowIndex);
                   switch (columnIndex) {
                        case 0:
                             return entry.getId();
                        case 1:
                             return entry.getExpirationDate();
                        case 2:
                             return entry.getStatus();
                        case 3:
                             return entry.getCreationDate();
                   return null;
         private static class DateRenderer extends DefaultTableCellRenderer {
              public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                   super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
                   if (!(value instanceof Date)) return this;
                   setText(DATE_FORMAT.format((Date) value));
                   return this;
         private static class DateEditor extends AbstractCellEditor implements TableCellEditor {
              private JSpinner theSpinner;
              protected Object value;
              public DateEditor() {
                   theSpinner = new JSpinner(new SpinnerDateModel());
                   theSpinner.setOpaque(true);
                   theSpinner.setEditor(new JSpinner.DateEditor(theSpinner, "dd/MM/yyyy"));
              public Object getCellEditorValue() {
                   return theSpinner.getValue();
              public Component getTableCellEditorComponent(JTable table, Object value,
                                                                      boolean isSelected,
                                                                      int row, int column) {
                   theSpinner.setValue(value);
                   if (isSelected) {
                        theSpinner.setBackground(table.getSelectionBackground());
                   } else {
                        theSpinner.setBackground(table.getBackground());
                   return theSpinner;
         private static class StatusEditor extends AbstractCellEditor implements TableCellEditor {
              private StatusPanel theStatusPanel;
              public StatusEditor() {
                   theStatusPanel = new StatusPanel();
              public Object getCellEditorValue() {
                   return theStatusPanel.getStatus();
              public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
                   theStatusPanel.setStatus((Status)value);
                   if (isSelected) {
                        theStatusPanel.setBackground(table.getSelectionBackground());
                   } else {
                        theStatusPanel.setBackground(table.getBackground());
                   return theStatusPanel;
         private static class StatusRenderer extends StatusPanel implements TableCellRenderer {
              public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
                   setStatus((Status)value);
                   if (isSelected) {
                        setBackground(table.getSelectionBackground());
                   } else {
                        setBackground(table.getBackground());
                   return this;
         private MyTableModel theTableModel;
         private JTable theTable;
         public TableTestPanel() {
              super(new BorderLayout(0, 5));
              setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
              theTableModel = new MyTableModel();
              theTable = new JTable(theTableModel);
              theTable.setDefaultEditor(Date.class, new DateEditor());
              theTable.setDefaultRenderer(Date.class, new DateRenderer());
              theTable.setDefaultEditor(Status.class, new StatusEditor());
              theTable.setDefaultRenderer(Status.class, new StatusRenderer());
    // comment out the two preceding lines and uncomment the following one if you want a more standard editor
    //          theTable.setDefaultEditor(Status.class, new DefaultCellEditor(new JComboBox(new Status[]{Status.SINGLE, Status.MARRIED, Status.DIVORCED})));
              add(new JScrollPane(theTable), BorderLayout.CENTER);
              JToolBar toolBar = new JToolBar();
              toolBar.setFloatable(false);
              toolBar.add(new AbstractAction("Add new") {
                   public void actionPerformed(ActionEvent e) {
                        theTableModel.add(new TableEntry());
                        packTable();
              toolBar.add(new AbstractAction("Remove") {
                   public void actionPerformed(ActionEvent e) {
                        theTableModel.remove(theTable.getSelectedRow());
              add(toolBar, BorderLayout.NORTH);
         private void packTable() {
              TableColumnModel columnModel = theTable.getColumnModel();
              int columnCount = theTable.getColumnCount();
              int rowCount = theTable.getRowCount();
              int[][] preferredHeights = new int[columnCount][rowCount];
              TableCellRenderer renderer;
              Component comp;
              for (int col = 0; col < columnCount; col++) {
                   renderer = columnModel.getColumn(col).getCellRenderer();
                   if (renderer == null) {
                        renderer = theTable.getDefaultRenderer(theTableModel.getColumnClass(col));
                   for (int row = 0; row < rowCount; row++) {
                        comp = renderer.getTableCellRendererComponent(theTable, theTableModel.getValueAt(row, col), false, false, row, col);
                        preferredHeights[col][row] = (int) comp.getPreferredSize().getHeight();
              for (int row = 0; row < rowCount; row++) {
                   int pref = 0;
                   for (int col = 0; col < columnCount; col++) {
                        pref = Math.max(pref, preferredHeights[col][row]);
                   theTable.setRowHeight(row, pref);
         public static void main(String[] args) {
              final JFrame frame = new JFrame("TestRadioButtonRenderer");
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setContentPane(new TableTestPanel());
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        frame.setSize(400, 300);
                        frame.show();
    }

  • Iteration of rows in table region.. help needed urgent !!!!

    Hi ,
    In my OAF Page ,user selects an account and clicks serach button,based on the account number the records are listed in a table .these rows are editable and a new row can be added to this region.
    how can we iterate thru these rows and pass these values to the API which will store the values in to the database.
    please do help me in iteration of these rows....i cannot do a vo.getrowcount and row.getattribute as this will get the values from the database and not the values from the current page.
    I should iterate in the table region ... and it should also get the newly created row values when the user clicks the save button.
    thanks
    ramya
    Edited by: user5400563 on Feb 12, 2009 5:00 AM

    can you post the detailed error stack?
    --Prasanna                                                                                                                                                                                                           

  • Generic delta - custom table in r3- help needed

    hI ALL
    I am using a ztable in r3 as data source . i wish to extract data from this table
    to my bw ods as a daily delta . i have created a generic data src zds_ztable on the
    basis of this table and in the generic delta section selected ' new and changed records' and 'numeric pointer'
    options .
    however , on the bw side when i try to create an infopackage under the relevant infosrc , it does not give
    me an option for ' initialisation' or 'delta ' , i only have option for FULL loads , I know i can use a date
    field and do a pseudo delta using technical FULL load ...but i want to know why cant i do an init and then
    a delta the way we do for other data srcs....
    pls help

    Hi,
    You may go to RSA2 for your datasource in R/3 & check do the delta settings are correct ? or you might need to re-generate the datasource and replicate in BW.
    Eddo

  • Oracle Reports with Tomcat - Help needed

    How do you deploy oracle reports in Tomcat.
    ** Can we add the necessary Jar files and run the rdf files.? If so can someone please help with this.
    **What are the settings to be taken care of ?
    ** I deployed the web.war and added the jar files to the web-inf/lib .
    But when i call the report as
    hostname:port/reports/servlet/rwservlet?report=test.rdf&destype=cache
    It doesnt return anything .it gives 404 error The requested resource (/reports/servlet/rwservlet) is not available.Please help .
    Any help is appreciable ..
    Thanks again.
    JM

    Phani-
    I have developed reports that run other reports in 9i and10g. I would have a "main" report that I would call from Forms (or HTMLDB). This "main" report would run multiple other reports. I used the report built-in procedure SRW.RUN_REPORT("report=report2.rdf parameter=XX") in the After Parameter Form trigger of the main report to call the other reports.
    I hope this helps,
    Dan

  • Oracle table creation/script help

    Having a hard time running my script. Essentially I have to create a few table entries into the 3 tables shown in my E/R Diagram and create the "Personnel Emergency Vehicle Shelter" table using the primary keys from the other three tables as a foreign key.
    http://img7.imageshack.us/img7/6443/dynamicenies.png
    notepad+ doesn't have anything for Oracle only SQL.
    drop table emergency_vehicle;
    create table emergency_vehicle(
    e_veh_ID varchar2(8) primary key,
    e_veh_plate varchar2(8),
    e_veh_registered_owner varchar2(50),
    e_veh_make varchar2(50),
    e_veh_model varchar2(50)
    insert into emergency_vehicle values
    ('veh00001','ABA12345','General Hospital','FORD','E-350');
    insert into emergency_vehicle values
    ('veh00002','ANA56844','General Hospital','FORD','E-350');
    insert into emergency_vehicle values
    ('veh00003','TEST8408','City Fire Department','MACK','Model 95');
    insert into emergency_vehicle values
    ('veh00004','EMRGNCEE','City Police Department','Dodge','Charger');
    select * from emergency_vehicle;
    drop table shelter;
    create table shelter(
    shelter_ID varchar2(8) primary key,
    shelter_location varchar2(100),
    shelter_description varchar2(50),
    insert into shelter values
    ('she00001','1660 Main Street','This is the General hospital for the city');
    insert into shelter values
    ('she00002',’100 Wayne Drive’,’Red Cross location #808’);
    insert into shelter values
    ('she00003',’3000 Jefferson Place’,’Red Cross shelter #321’);
    select * from shelter;
    drop table first_responders;
    create table first_responders(
    first_responder_ID varchar2(8) primary key,
    first_responder_name varchar2(50),
    first_responder_function varchar2(50),
    insert into first_responders values
    ('FRP00001',’Jack Smith’,’EMT’);
    insert into first_responders values
    ('FRP00002',’Officer Kimble’,’Police Officer’);
    insert into first_responders values
    ('FRP00003',’John Matthews’,’Firemen’);
    select * from first_responder;

    Using this code
    drop table emergency_vehicle;
    create table emergency_vehicle(
    e_veh_ID varchar2(8) primary key,
    e_veh_plate varchar2(8),
    e_veh_registered_owner varchar2(50),
    e_veh_make varchar2(50),
    e_veh_model varchar2(50)
    insert into emergency_vehicle values
    ('veh00001','ABA12345','General Hospital','FORD','E-350');
    insert into emergency_vehicle values
    ('veh00002','ANA56844','General Hospital','FORD','E-350');
    insert into emergency_vehicle values
    ('veh00003','TEST8408','City Fire Department','MACK','Model 95');
    insert into emergency_vehicle values
    ('veh00004','EMRGNCEE','City Police Department','Dodge','Charger');
    select * from emergency_vehicle;
    drop table shelter;
    create table shelter(
    shelter_ID varchar2(8) primary key,
    shelter_location varchar2(100),
    shelter_description varchar2(50)
    insert into shelter values('she00001','1660 Main Street','This is the General hospital for the city');
    insert into shelter values('she00002',’100 Wayne Drive’,’Red Cross location #808’);
    insert into shelter values('she00003',’3000 Jefferson Place’,’Red Cross shelter #321’);
    select * from shelter;
    drop table first_responders;
    create table first_responders(
    first_responder_ID varchar2(8) primary key,
    first_responder_name varchar2(50),
    first_responder_function varchar2(50)
    insert into first_responders values('FRP00001',’Jack Smith’,’EMT’);
    insert into first_responders values('FRP00002',’Officer Kimble’,’Police Officer’);
    insert into first_responders values('FRP00003',’John Matthews’,’Firemen’);
    select * from first_responder;
    generates these results
    Table dropped.
    Table created.
    1 row created.
    1 row created.
    1 row created.
    1 row created.
    E_VEH_ID     E_VEH_PLATE     E_VEH_REGISTERED_OWNER     E_VEH_MAKE     E_VEH_MODEL
    veh00001     ABA12345     General Hospital     FORD     E-350
    veh00002     ANA56844     General Hospital     FORD     E-350
    veh00003     TEST8408     City Fire Department     MACK     Model 95
    veh00004     EMRGNCEE     City Police Department     Dodge     Charger
    Table dropped.
    Table created.
    1 row created.
    insert into shelter values('she00002',’100 Wayne Drive’,’Red Cross location #808’)
    ERROR at line 1:
    ORA-00911: invalid character
    insert into shelter values('she00003',’3000 Jefferson Place’,’Red Cross shelter #321’)
    ERROR at line 1:
    ORA-00911: invalid character
    SHELTER_ID     SHELTER_LOCATION     SHELTER_DESCRIPTION
    she00001     1660 Main Street     This is the General hospital for the city
    drop table first_responders
    ERROR at line 1:
    ORA-00942: table or view does not exist
    Table created.
    ('FRP00001',’Jack Smith’,’EMT’)
    ERROR at line 2:
    ORA-00911: invalid character
    ('FRP00002',’Officer Kimble’,’Police Officer’)
    ERROR at line 2:
    ORA-00911: invalid character
    ('FRP00003',’John Matthews’,’Firemen’)
    ERROR at line 2:
    ORA-00911: invalid character
    no rows selected
    Now I don't even see anything for the 2nd or 3rd entry on first table, and nothing for 3rd Table
    Edited by: 875149 on Jul 26, 2011 2:48 PM

  • Left or Right join help needed

    I know this has been discussed all over the place, but I cannot make the connection from the examples to my brain.
    I have a many-to-many relationship set up with venues and addresses (because one venue may have multiple addresses, and one address may belong to multiple venues)
    venues: venue_ID, venue_name
    ven_add: va_id, va_venue_ID, va_address_ID
    addresses: address_ID,add_line1,add_cty_ID
    cities: cty_id,cityname
    I want to see a list of: venuename, address, cityname
    I want to include all venues, even if they do not (yet) have an associated address.
    I want a venue included only once, even if it has multiple addresses.
    How do I know what's the inner and what's the outer????
    this code is good in that I get all 3 of my venues listed, even though one of them does not have an associated address.
    However, I am getting one venue twice, since it has 2 addresses. Do I leave that alone, and then add in some sort of constraint?
    And, once I resolve the join, I'm not sure where I factor in the other related tables, but I'll cross that bridge when I get there.
    Thanks
    Marion in NY
    SELECT
    v.VENUE_ID "VENUE_ID",
    v.VENUE_NAME "VENUE_NAME",
    va.ven_add_id "VA_venadd_id",
    va.va_venue_id "VA_venue_ID",
    va.va_adr_id "VA_adr_ID"
    FROM
    ven_add va
    right outer join
    venues v
    ON
    v.venue_ID = va.va_venue_ID

    Hi Marion,
    You haven't provided us with any test data so I've made some up.
    Generally, people tend to stick with LEFT OUTER JOINS and just work from the left to the right rather than confusing matters with RIGHT OUTER JOINS (which is just a LEFT OUTER JOIN expressed the other way around).
    So, here's the first part, taking the venues, addresses and cities, joining through the venue-address linking table (which is good for a many to many relationship)...
    SQL> ed
    Wrote file afiedt.buf
      1  with venues as (select 1 as venue_id, 'The Star' as venue_name from dual union all
      2                  select 2, 'The Jug and Mallet' from dual union all
      3                  select 3, 'The Pig and Truffle' from dual union all
      4                  select 4, 'The Nonexistent Traveller' from dual)
      5      ,addresses as (select 1 as address_id, 'The High Street' as add_line1, 1 as add_cty_id from dual union all
      6                     select 2, 'The Warfe', 2 from dual union all
      7                     select 3, 'Side Road', 3 from dual union all
      8                     select 4, 'West Street', 3 from dual union all
      9                     select 5, 'Walsall Road', 2 from dual)
    10      ,cities as (select 1 as cty_id, 'London' as cityname from dual union all
    11                  select 2, 'Birmingham' from dual union all
    12                  select 3, 'Leicester' from dual)
    13      ,ven_add as (select 1 as va_id, 1 as va_venue_id, 5 as va_address_id from dual union all
    14                   select 2, 1, 4 from dual union all
    15                   select 3, 2, 3 from dual union all
    16                   select 4, 3, 3 from dual union all
    17                   select 5, 3, 1 from dual)
    18  -- END OF TEST DATA
    19  select v.venue_name, a.add_line1, c.cityname
    20  from   venues v left outer join ven_add va on (va.va_venue_id = v.venue_id)
    21                  left outer join addresses a on (a.address_id = va.va_address_id)
    22*                 left outer join cities c on (c.cty_id = a.add_cty_id)
    SQL> /
    VENUE_NAME                ADD_LINE1       CITYNAME
    The Pig and Truffle       The High Street London
    The Star                  Walsall Road    Birmingham
    The Star                  West Street     Leicester
    The Jug and Mallet        Side Road       Leicester
    The Pig and Truffle       Side Road       Leicester
    The Nonexistent Traveller
    6 rows selected.... and that gives us all the venues, regardless of whether they have an address or not, but like you said, you don't want more than one address per venue.
    So, you have to decide what business rule determines the address you want if a venue has more than one.
    Let's say that we want to take the address for a venue with the city ID creating the priority, so city ID of 1 is preferable over city ID of 2 etc.
    We can do that using an analytical function to assign a "row number" to each of the rows within a particular venue group...
    SQL> ed
    Wrote file afiedt.buf
      1  with venues as (select 1 as venue_id, 'The Star' as venue_name from dual union all
      2                  select 2, 'The Jug and Mallet' from dual union all
      3                  select 3, 'The Pig and Truffle' from dual union all
      4                  select 4, 'The Nonexistent Traveller' from dual)
      5      ,addresses as (select 1 as address_id, 'The High Street' as add_line1, 1 as add_cty_id from dual union all
      6                     select 2, 'The Warfe', 2 from dual union all
      7                     select 3, 'Side Road', 3 from dual union all
      8                     select 4, 'West Street', 3 from dual union all
      9                     select 5, 'Walsall Road', 2 from dual)
    10      ,cities as (select 1 as cty_id, 'London' as cityname from dual union all
    11                  select 2, 'Birmingham' from dual union all
    12                  select 3, 'Leicester' from dual)
    13      ,ven_add as (select 1 as va_id, 1 as va_venue_id, 5 as va_address_id from dual union all
    14                   select 2, 1, 4 from dual union all
    15                   select 3, 2, 3 from dual union all
    16                   select 4, 3, 3 from dual union all
    17                   select 5, 3, 1 from dual)
    18  -- END OF TEST DATA
    19  select v.venue_name, a.add_line1, c.cityname
    20        ,row_number() over (partition by v.venue_name order by c.cty_id) as rn
    21  from   venues v left outer join ven_add va on (va.va_venue_id = v.venue_id)
    22                  left outer join addresses a on (a.address_id = va.va_address_id)
    23*                 left outer join cities c on (c.cty_id = a.add_cty_id)
    SQL> /
    VENUE_NAME                ADD_LINE1       CITYNAME           RN
    The Jug and Mallet        Side Road       Leicester           1
    The Nonexistent Traveller                                     1
    The Pig and Truffle       The High Street London              1
    The Pig and Truffle       Side Road       Leicester           2
    The Star                  Walsall Road    Birmingham          1
    The Star                  West Street     Leicester           2
    6 rows selected.... so now we have assigned a row number "RN" to each row returned, where London takes priority over Leicester for The Pig and Truffle, and Birmingham takes priority over Leicester for The Star.
    Now, if we wrap that query in another query and just select the rows with a RN = 1, we just get one row per venue...
    SQL> ed
    Wrote file afiedt.buf
      1  with venues as (select 1 as venue_id, 'The Star' as venue_name from dual union all
      2                  select 2, 'The Jug and Mallet' from dual union all
      3                  select 3, 'The Pig and Truffle' from dual union all
      4                  select 4, 'The Nonexistent Traveller' from dual)
      5      ,addresses as (select 1 as address_id, 'The High Street' as add_line1, 1 as add_cty_id from dual union all
      6                     select 2, 'The Warfe', 2 from dual union all
      7                     select 3, 'Side Road', 3 from dual union all
      8                     select 4, 'West Street', 3 from dual union all
      9                     select 5, 'Walsall Road', 2 from dual)
    10      ,cities as (select 1 as cty_id, 'London' as cityname from dual union all
    11                  select 2, 'Birmingham' from dual union all
    12                  select 3, 'Leicester' from dual)
    13      ,ven_add as (select 1 as va_id, 1 as va_venue_id, 5 as va_address_id from dual union all
    14                   select 2, 1, 4 from dual union all
    15                   select 3, 2, 3 from dual union all
    16                   select 4, 3, 3 from dual union all
    17                   select 5, 3, 1 from dual)
    18  -- END OF TEST DATA
    19  select venue_name, add_line1, cityname
    20  from (
    21        select v.venue_name, a.add_line1, c.cityname
    22              ,row_number() over (partition by v.venue_name order by c.cty_id) as rn
    23        from   venues v left outer join ven_add va on (va.va_venue_id = v.venue_id)
    24                        left outer join addresses a on (a.address_id = va.va_address_id)
    25                        left outer join cities c on (c.cty_id = a.add_cty_id)
    26       )
    27* where rn = 1
    SQL> /
    VENUE_NAME                ADD_LINE1       CITYNAME
    The Jug and Mallet        Side Road       Leicester
    The Nonexistent Traveller
    The Pig and Truffle       The High Street London
    The Star                  Walsall Road    Birmingham
    SQL>So, the key is to define your business requirement/rules as to which address you want for a venue when it has multiple addresses. Once you know that you can alter the analytical function to order by the correct element.
    ;)

  • OTM 6.3 Instalation On Oracle Linux 6.5 - Help Needed

    HI All,
    I am trying to install OTM 6.3, including FTI
    I have 3 servers
    VSS-DB-SERVER ==> Oracle 11.2.0 DB (Transaction Type)
    VSS-OTM-SERVER ==> JRocket, Weblogic Server, OHS, OTM 6.3
    VSS-BI-DB-SERVER ==> Oracle 11.2.0 DB (Data Warehouse Type), OBI, ODI
    I have OTM installation guide E38416-04 but I am little confused with it as it gives a different combination example. But it talks about about installing everything in the same instance on VM and many things differ. And also it doesnt talk about FTI.
    OTM 6.3 Linux OEL RHEL CentOS Test Environment Installation Guide - OTM Wiki
    Thanks,
    Vishwamber Shetty

    Hi Vishwamber,
    Have you verified login (http)port  ? It should be same.  was install.sh completed with out any issues?
    <otm_home>/apache/conf/httpd.conf
    <otm_home>/weblogic/weblogic.conf
    <otm_home>/tomcat/bin/tomcat.conf
    <otm_home>/gc3/tomcat/conf/server.xml
    Thanks,
    Moshe.

  • Dynamic Table with NavBar Help Needed

    If I use this query:
    SELECT cemeteries.lname, cemeteries.fname, cemeteries.born,
    cemeteries.died, cemeteries.buried
    FROM cemeteries
    WHERE (cemeteries.lname LIKE varLname%)
    the NavBar works perfectly and I can page through the record
    set
    but when change to a more complex WHERE statement:
    SELECT cemeteries.lname, cemeteries.fname, cemeteries.born,
    cemeteries.died, cemeteries.buried
    FROM cemeteries
    WHERE (cemeteries.lname LIKE varLname% AND cemeteries.fname
    LIKE varFname%)
    I get the first page of results, but when I click next, I get
    nothing and if I try to go back, I get the default query.
    What am I doing wrong?

    solved the problem, instead on change event put script on exit event.
    and the following line does the trick:
    xfa.resolveNode("THatchPatterns.Section[" + this.parent.index + "]").CCode.rawValue = this.rawValue

Maybe you are looking for

  • Hello I have a few questions and I need some help with my iTunes and  iPod

    Hello iTunes people. I have a little problem with my iTunes. I actually almost know nothing about iTunes really. But I have had a 80 gig ipod .. ummm I think it's a iPod classic maybe. A long time ago I just downloaded iTunes. I think one of my tech

  • Vendor's calendar

    Hello gurus, I want to assign a "factory" calendar to a vendor, so I know that way which are his holidays, working days, etc. This way I can have a better control of him. Can anyone explain me step by step how can I do that? 1. Create the new calenda

  • Showing error in concatenate

    class connection { public static void main (String[] args ) {   String a=   "jdbc:oracle:thin:@//erp.oracle.com:1521/orcl" + ","+ "apps" + "," + "apps";    System.out.println(a);    System.out.println(coninfo());   public String coninfo() {    String

  • Exported image size

    I shoot a canon 30D which produces RAW files about 7mb. When I export the versions as full size Jpegs, they get knocked to around 250kb! What is going on? That seems like an extreme amount of compression to me. Any ideas as to what I am doing wrong?

  • Relase of time sheets

    All, In Our organization the process for recoridng time has changed a bit.Earlier upon saving thetime sheet used to be released for aproval. Now the process has changed and the employee can now save the time sheet and at a later monent of time can re