Type 1 and Type 2 dimension in the same table
Assuming a table with both Type 1 and Type 2 dimensions how do you engineer an ETL load?
Please correct my options below if I am wrong
Option 1: Inside a Slowly changing dimension set all 3, fixed attributes, Historical attributes and changing attributes. Since historical attributes is Type 2 and changing attributes is Type 1. We get what we want, Correct?
Option 2: writing a merge statement, but not sure how exactly i would be code that.
Please suggest a way if you think both the options are wrong. Thanks in advance.
svk
Hi, Please refer to the
msdn blog.
Hope this helps..............
Ione
Similar Messages
-
Nsert/Update and Add Column at the same Table and at the "same" Time
Hello,
I want Insert/Update and Add Column at the same Table and at the "same" Time but in different sessions.
Example:
At first the "insert/update" statement:
Insert into TestTable (Testid,Value) values (1,5105);
After that the "add" statement:
Alter table TestTable add TestColumn number;
- sadly now I get the message: ORA-00054: resource busy and acquire with NOWAIT specified
"insert/update" statement:
Insert into TestTable (Testid,Value) values (2,1135);
After that the execute commit.
I don't know when the first session set the commit statement so I want that the DB the "Alter Table..." statement execute if it's possible.
If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.
Thanks for ideasWell I want to walk in the rain without and umbrella and still stay dry, but it ain't gonna happen.
You can't run a DDL statement against a table with transactions pending. Session 2 has to wait until session commits or rollbacks (or until the session is killed). That's just the way it is.
This makes sense if you think about it. The data dictionary has to be consistent across all sessions. If session 2 was allowed to change the table structure whilst session 1 has a pending transaction then the database is in an inconsistent state. This is easier to see if you consider the reverse situation - the ALTER TABLE statement run by session 2 does a DROP COLUMN TESTID rather than adding a column: now what should happen to session 1's INSERT statement? You have retrospectively invalidated a statement that was perfectly legal when it was executed.
If it's possible I want to save a repeat loop with the "Alter Table..." statemtent.Fnord.
Cheers, APC -
File name and Measuremen​t in the same table?
Hi,
I have written the following VI that opens up each image file from a folder and measures a certain dimension on the image. It then puts the result of the measurement in a table.
The table has one column and N rows since I have N images in my folder. How can I modify this VI so that it puts the filename in the same table as well as the measurement?
I want the table to look like:
filename1 measurement1
filename2 measurement2
and so on.
Currently, it just shows
measurement1
measurement2
and so on.
Here is the VI:
Solved!
Go to Solution.
Attachments:
measurement.vi 68 KBYou can't use the Express Table. As the properties page says, it is for numeric data. You will have to use a little bit of actual LabVIEW to create the table. A table is just a 2D string array. So, convert the numeric to a string, build a 1D string array from the file name and numberic, and use a shift register to build a 2D array. Something like the code below.
Message Edited by Dennis Knutson on 05-07-2009 01:43 PM
Attachments:
Build Table.PNG 9 KB -
Historical and transaction data in the same tables creates perf problems
Our Oracle based application is slow partly due to the fact that historical data are kept in the same table as transactional data. For example records about deceased patients, patients treated 5 years ago...etc, are kept in the one and only one patient table, which is needed to run the daily process of the hospital. So gradually all our major tables PATIENTS, CHARTS, NAMES, APPOINTMENTS have grown very large and since most of our SQL join all these tables at the same time, then all screens and reports run very slowly. I have introduced the idea that we should split all these tables in two: historical PATIENTS data, and CURRENT PATIENTS data...the same with all the others. A nice system would first search in the smaller transactional tables, which would run faster being smaller, and if no data found, then fallback to the historical tables. But this would require programming. From what I have read mateialized view could solve part of our problem. We could have views containing for example only one year worth of the data, and I guess any changes could be later replicated in the base table. What I dont know is what to do if we cannot find the patient in the matealized views ? Do I need to fallback to another SQL which will search in the initial base tables ? Anyway we can implement this without programming ? Tx.
Appointment table: 207,470
Visit table: 5,890,920
Patient table: 2,993,129
Chart table: 2,864,069
Patient names table: 3,938,118
SELECT
APPOI_OR_VISIT,
VISIT_SEQ,
PAT_SEQ,
INST_CODE,
INST_CODE_DISPL,
INST_DESC,
CLINIC_CODE,
CLINIC_CODE_DISPL,
CLINIC_DESC,
SPEC_CODE,
SPEC_CODE_DISPL,
SPEC_DESC,
VISIT_DATE,
VISIT_TIME,
VISIT_TIME_ARRIVAL,
APPTYPE_CODE,
SESSION_DOM_MODE,
PRESTYPE_CODE,
PRESTYPE_DOM_TYPE,
DIA_CODE,
VISIT_TIME_START_RESP,
VISIT_TIME_DISCHARGE,
APPOI_NB_DURATION,
VISIT_TX_REASON,
VISIT_TX_COMMENT,
EXTDOC_CODE,
VISIT_PN_REFPHYS_NAME,
PATYPE_CODE,
PAYRESP_CODE,
VISIT_IND_GROUP,
VISIT_PCODE,
VISIT_IND_COMPLETE,
VISIT_IND_ADMISSION,
VISIT_IND_CONFIDENTIALITY,
VISIT_DATE_ACCIDENT,
APPOI_SEQ,
BILLING_CODE,
VISIT_TX_DIAGNOSIS,
CST_CODE_1,
CST_CODE_2,
CST_CODE_3,
APPOI_DH_CRE,
APPOI_CODE_CRE_USER,
APPOI_DH_MOD,
APPOI_CODE_MOD_USER,
VISIT_CODE_CRE_USER,
VISIT_DH_CRE,
VISIT_UPDATED_COUNT,
VISIT_CODE_MOD_USER,
VISIT_DH_MOD,
APPOI_PAYRESP_CODE,
APPOI_DT_ACCIDENT,
PATIENT_LAST_NAME,
PATIENT_FIRST_NAME,
PATIENT_CONFIDENTIALITY,
PATIENT_CHART_EXT,
TO_NUMBER(SUBSTR(PATIENT_CHART_EXT, 1, INSTR(PATIENT_CHART_EXT, '|')-1)) AS PATIENT_CHART_NO,
PAT_IND_SPECIAL_RISK
FROM
SELECT
'VISIT' AS APPOI_OR_VISIT,
VISIT.VISIT_SEQ,
VISIT.PAT_SEQ,
INSTITUTION.INST_CODE,
INSTITUTION.INST_CODE_DISPL,
INSTITUTION.INST_DESC,
CLINIC.CLINIC_CODE,
CLINIC.CLINIC_CODE_DISPL,
CLINIC.CLINIC_DESC,
SPECIALTY.SPEC_CODE,
SPECIALTY.SPEC_CODE_DISPL,
SPECIALTY.SPEC_DESC,
VISIT.VISIT_DATE,
VISIT.VISIT_TIME,
VISIT.VISIT_TIME_ARRIVAL,
VISIT.APPTYPE_CODE,
VISIT.SESSION_DOM_MODE,
VISIT.PRESTYPE_CODE,
VISIT.PRESTYPE_DOM_TYPE,
VISIT.DIA_CODE,
VISIT.VISIT_TIME_START_RESP,
VISIT.VISIT_TIME_DISCHARGE,
VISIT.APPOI_NB_DURATION,
VISIT.VISIT_TX_REASON,
VISIT.VISIT_TX_COMMENT,
VISIT.EXTDOC_CODE,
VISIT.VISIT_PN_REFPHYS_NAME,
VISIT.PATYPE_CODE,
VISIT.PAYRESP_CODE,
VISIT.VISIT_IND_GROUP,
VISIT.VISIT_PCODE,
VISIT.VISIT_IND_COMPLETE,
VISIT.VISIT_IND_ADMISSION,
VISIT.VISIT_IND_CONFIDENTIALITY,
VISIT.VISIT_DATE_ACCIDENT,
VISIT.APPOI_SEQ,
VISIT.BILLING_CODE,
VISIT.VISIT_TX_DIAGNOSIS,
VISIT.CST_CODE_1,
VISIT.CST_CODE_2,
VISIT.CST_CODE_3,
VISIT.APPOI_DH_CRE,
VISIT.APPOI_CODE_CRE_USER,
VISIT.APPOI_DH_MOD,
VISIT.APPOI_CODE_MOD_USER,
VISIT.VISIT_CODE_CRE_USER,
VISIT.VISIT_DH_CRE,
VISIT.VISIT_UPDATED_COUNT,
VISIT.VISIT_CODE_MOD_USER,
VISIT.VISIT_DH_MOD,
NULL AS APPOI_PAYRESP_CODE,
TO_DATE(NULL) AS APPOI_DT_ACCIDENT,
NAME.NAM_PN_NAM AS PATIENT_LAST_NAME,
NAME.NAM_PN_FNAM AS PATIENT_FIRST_NAME,
CONFIDENTIALITY.CONF_DESC AS PATIENT_CONFIDENTIALITY,
PI_SECURITY.F_GET_CHART_NUMBER_SCAN_CODE(VISIT.PAT_SEQ, 103 /*:pChartInstitutionID*/, 0) AS PATIENT_CHART_EXT,
PATIENT.PAT_IND_SPECIAL_RISK
FROM
AS_T_VISITS VISIT,
CT_R_INSTITUTIONS INSTITUTION,
AS_T_CLINICS CLINIC,
CT_R_SPECIALITIES SPECIALTY,
PI_T_NAMES NAME,
PI_T_PATIENTS PATIENT,
PI_R_CONF_LEVELS CONFIDENTIALITY
WHERE
VISIT_DATE >= TO_DATE('2004-04-01', 'YYYY-MM-DD') /*:P_VISIT_DATE_FROM*/ AND
VISIT_DATE <= TO_DATE('2004-04-02', 'YYYY-MM-DD') /*::P_VISIT_DATE_TO*/ AND
CLINIC.CLINIC_CODE = VISIT.CLINIC_CODE AND
SPECIALTY.SPEC_CODE = CLINIC.SPEC_CODE AND
INSTITUTION.INST_CODE(+) = VISIT.INST_CODE AND
NAME.PAT_SEQ = VISIT.PAT_SEQ AND
NAME.NAMTYP_CODE = 1 AND
PATIENT.PAT_SEQ = VISIT.PAT_SEQ AND
CONFIDENTIALITY.CONF_CODE (+) = PATIENT.CONF_CODE
UNION
SELECT
'APPOI' AS APPOI_OR_VISIT,
0 AS VISIT_SEQ,
NVL(APPOINTMENT_GROUP.PAT_SEQ, APPOINTMENT.PAT_SEQ) AS PAT_SEQ,
INSTITUTION.INST_CODE,
INSTITUTION.INST_CODE_DISPL,
INSTITUTION.INST_DESC,
CLINIC.CLINIC_CODE,
CLINIC.CLINIC_CODE_DISPL,
CLINIC.CLINIC_DESC,
SPECIALTY.SPEC_CODE,
SPECIALTY.SPEC_CODE_DISPL,
SPECIALTY.SPEC_DESC,
APPOINTMENT.SESSION_DATE AS VISIT_DATE,
APPOINTMENT.APPOI_TIME AS VISIT_TIME,
'' AS VISIT_TIME_ARRIVAL,
APPOINTMENT.APPTYPE_CODE,
APPOINTMENT.SESSION_DOM_MODE,
0 AS PRESTYPE_CODE,
'' AS PRESTYPE_DOM_TYPE,
0 AS DIA_CODE,
'' AS VISIT_TIME_START_RESP,
'' AS VISIT_TIME_DISCHARGE,
APPOINTMENT.APPOI_NB_DURATION,
APPOINTMENT.APPOI_TX_REASON AS VISIT_TX_REASON,
APPOINTMENT.APPOI_TX_COMMENT AS VISIT_TX_COMMENT,
APPOINTMENT.EXTDOC_CODE,
APPOINTMENT.APPOI_PN_REFPHYS_NAME AS VISIT_PN_REFPHYS_NAME,
APPOINTMENT_TYPE.PATYPE_CODE AS PATYPE_CODE,
0 AS PAYRESP_CODE,
DECODE(APPOINTMENT_GROUP.PAT_SEQ,NULL,0,1) AS VISIT_IND_GROUP,
'' AS VISIT_PCODE,
0 AS VISIT_IND_COMPLETE,
0 AS VISIT_IND_ADMISSION,
APPOINTMENT.APPOI_IND_CONFIDENTIALITY AS VISIT_IND_CONFIDENTIALITY,
TO_DATE(NULL) AS VISIT_DATE_ACCIDENT,
APPOINTMENT.APPOI_SEQ,
0 AS BILLING_CODE,
'' AS VISIT_TX_DIAGNOSIS,
0 AS CST_CODE_1,
0 AS CST_CODE_2,
0 AS CST_CODE_3,
APPOINTMENT.APPOI_DH_CRE AS APPOI_DH_CRE,
APPOINTMENT.APPOI_CODE_CRE_USER AS APPOI_CODE_CRE_USER,
APPOINTMENT.APPOI_DH_MOD AS APPOI_DH_MOD,
APPOINTMENT.APPOI_CODE_MOD_USER AS APPOI_CODE_MOD_USER,
'' AS VISIT_CODE_CRE_USER,
SYSDATE AS VISIT_DH_CRE,
0 AS VISIT_UPDATED_COUNT,
'' AS VISIT_CODE_MOD_USER,
SYSDATE AS VISIT_DH_MOD,
PAYRESP_CODE AS APPOI_PAYRESP_CODE,
APPOI_DT_ACCIDENT,
NAME.NAM_PN_NAM AS PATIENT_LAST_NAME,
NAME.NAM_PN_FNAM AS PATIENT_FIRST_NAME,
CONFIDENTIALITY.CONF_DESC AS PATIENT_CONFIDENTIALITY,
PI_SECURITY.F_GET_CHART_NUMBER_SCAN_CODE(APPOINTMENT.PAT_SEQ, 103 /*:pChartInstitutionID*/, 0) AS PATIENT_CHART_EXT,
PATIENT.PAT_IND_SPECIAL_RISK
FROM
AS_T_APPOINTMENTS APPOINTMENT,
AS_R_APPOINTMENT_TYPES APPOINTMENT_TYPE,
AS_T_CLINICS CLINIC,
CT_R_SPECIALITIES SPECIALTY,
CT_R_INSTITUTIONS INSTITUTION,
AS_T_APPOINTMENT_GROUPS APPOINTMENT_GROUP,
PI_T_PATIENTS PATIENT,
PI_R_CONF_LEVELS CONFIDENTIALITY,
PI_T_NAMES NAME,
AS_T_APPOINTMENT_SEQ_MAPPING SEQMAP
WHERE
SESSION_DATE >= TO_DATE('2004-04-01', 'YYYY-MM-DD') /*:P_VISIT_DATE_FROM*/ AND
SESSION_DATE <= TO_DATE('2004-04-02', 'YYYY-MM-DD') /*::P_VISIT_DATE_TO*/ AND
APPOINTMENT.APPOI_DOM_TYPE IN('A','AR') AND
CLINIC.CLINIC_CODE = APPOINTMENT.CLINIC_CODE AND
SPECIALTY.SPEC_CODE = CLINIC.SPEC_CODE AND
INSTITUTION.INST_CODE(+) = APPOINTMENT.INST_CODE AND
APPOINTMENT_GROUP.APPOI_SEQ (+) = APPOINTMENT.APPOI_SEQ AND
APPOINTMENT_TYPE.APPTYPE_CODE (+) = APPOINTMENT.APPTYPE_CODE AND
NAME.PAT_SEQ = NVL(APPOINTMENT.PAT_SEQ, APPOINTMENT_GROUP.PAT_SEQ) AND
NAME.NAMTYP_CODE = 1 AND
PATIENT.PAT_SEQ = NVL(APPOINTMENT.PAT_SEQ, APPOINTMENT_GROUP.PAT_SEQ) AND
CONFIDENTIALITY.CONF_CODE (+) = PATIENT.CONF_CODE AND
SEQMAP.APPOI_SEQ (+) = APPOINTMENT.APPOI_SEQ AND
SEQMAP.APPOI_SEQ IS NULL
ORDER BY
VISIT_DATE, VISIT_TIME, PATIENT_CHART_NO -
Master and Detail records in the same table
Hi Steve,
I have master and detail address records in the same table (self-reference). The master addresses are used as templates for detail addresses. Master addresses do not have any masters. Detail addresses have three masters: a master address, a calendar reference and a department. Addresses change from time to time and every department has its own email-account, but they refer to the same master to pre-fill some common values.
Now I need to edit the master and detail address records on the same web page simultaneously.
My question is: Can I implement a Master-View and Detail-View which refer to the same Entity-Object? Or should I implement a second Entity-Object? Or can it be done in a single Master-Detail-View?
Thanks a lot.
Kai.At a high level, wouldn't this be similar to an Emp entity based on the familiar EMP table that has an association from Emp to itself for the Emp.Mgr attribute?
You can definitely build a view object that references two entity usages of the same entity like this to show, say, an employee's ENAME and at the same time their manager's ENAME.
If there are multiple details for a given master, you can also do that with separate VO's both based on the same entity, sure. Again, just like a VO that shows a manager, and a view-linked VO of all the employees that report to him/her. -
OBI 10g merge 2 time dimensions on the same table/graph in analysis
Hi,
My problem is: I have 2 different analyses (working fine) (using OBI 10g), they both use a different time dimension:
time_dim_1 | fact1
time_dim_2 | fact2
I want to merge them to have something like the following:
time_dim | fact1 | fact2
What I managed to get so far is something like this:
time_dim1 | time_dim2 | fact1 | fact2 (with, if we suppose there are 12 rows in time_dim1 and time_dim2, 12*12 = 144 rows instead of just 12)
Here is some more explanations about how I set my repository:
My fact table "issues" is made of the following columns:
issue_id, issue_type, issue_create_date, issue_end_date
I also have a table "calendar" with year, quarter, month and full_gregorian_date.
In the physical layer I created 2 aliases for the "calendar" table to join with the fact table using "issue_create_date" and "issue_end_date".
In the business model I created the 2 related time dimensions.
Everything is working fine so far, I was able to get 2 different analyses :
- time dimension (joined with "issue_CREATE_date") | count of issues (with aggregation rule "count" on issue_id)
to see how many new issues are CREATED through time (are there more issues created or less)
- time dimension (joined with "issue_END_date") | count of issues (with aggregation rule "count" on issue_id)
to see how many new issues are ENDED through time (when are more issues ended)
What I want is a third analysis like this:
- time dimension | count of created issues | count for ended issues
Thanks for your help.
Florencedid you set the content level as well?
-
How can I duplicate the same table in 3 pages?
hi everybody!
i have a form with a master page (containing the invoice fields) and 3 body pages that reference the master page.
in each one of these 3 pages there is a table with one header row, 7 body rows and a footer row.
the table was copied and pasted from page 1 to page 2 and page 3.
between the body rows there are two rows that are bound with table data, one for invoice details and one for tax details.
my problem is that in the 2nd and 3rd page in pdf output invoice and tax details are empty, while the other lines are present.
it seems like there is a table index that loops once in the first page until it reaches the end of the table, so for page 2 and 3 it is already at the end...
my question is: how can i get the same complete table in three form pages?
thanks in advanceNot sure I follow .....are you asking for Page 2 and 3 to have the same table and values in the table as on Page1 or does each page have unique data?
Where is the data coming from? Is the user typing it in or is there a separate data source somewhere?
Paul -
Two diffferent type of joins on the same table
I have a query that, it seems, requires me to two two different types of joins to the same table.
from table t1
LEFT OUTER JOIN table2 t2
ON t1.col1= t2.col1
and t1.col2 = t2.col2
and t1.col5 = t2.col5
LEFT OUTER JOIN table2 t3
ON t1.col1= t3.col1
and t1.col2 = t3.col2
and t1.col4 = t3.col4
would I run into a problem if I just did:
LEFT OUTER JOIN table2 t2
ON t1.col1= t2.col1
and t1.col2 = t2.col2
and t1.col3 = t2.col3
and t1.col4 = t2.col4
and t1.col5 = t2.col5
And if I go with option 1 and I also create two different types of indexes to accommodate each join, will 10g know which ones to use?
Message was edited by:
user623359
Message was edited by:
user623359No version number and no statement of what it is you are trying to do ... but one solutions is to use the traditional Oracle syntax and the first part, then wraps it in parentheses turning it into an inline view, and then join that to the next part.
-
"Batch NO SALEAB. and valuation type 1ST CHOICE are not the same"
Hi MM guru,
Please help me with the error message - "Batch NO SALEAB. and valuation type 1ST CHOICE are not the same" encountered during MB1b transaction.
Thanks in advance,
IramHello Amuthan,
I'm using mov type 311 and the material is not batch managed. I've entered the supplying & receiving batch and then error "Batch NO SALEAB. and valuation type 1ST CHOICE are not the same" was encountered, I found out that in table MCHA that the batch & valuation type for this material is not the same thats why its showing the error. Can you please guide me on how to maintain the data in table MCHA? What configuration we need to set?
Thanks in advance,
Iram -
firefox plays video, but no sound. when I type about:plugins in location bar, it shows the firefox default plugin is not enabled. When I look at my plugins, it says it is enabled. I have uninstalled 3.6 and re-installed with the same result. Why do I have no sound. Computer plays I-tunes and all other sounds, just no web browser sounds.
Glad you seem to have sorted things out.
The warning about the warranty is light hearted, I think at one stage it warned "here be dragons" but also intended to make us think as it warns that making changes may produce problems. -
my apple tv and my macbook share the same e-mail address type login. I have been into itunes and set to allow home sharing. my devices do not see each other. Any ideas?
Have you enabled home-sharing on the ATV?
See if this helps
http://support.apple.com/kb/TS2972?viewlocale=en_US&locale=en_US -
How to change material type and industrial sector of the exsisting material
Hi,
There is an issue where user wants to change material type and industrial sector of the exsisting material .Is it posible to do so??
IF not ,how can we delete that material from material master so that another material with same number and required material type and industrial sector can be created.
Points will be definitely rewarded.
Thanks
RohitHi Rohit,
You can change the material type in MMAM trxn code if the material dosenot conatain any open purchase requisitions, open reservations & open purchase orders. Also material stock should be zero.
Remember the new material type should have same attributes same as old material type.
OLD Material New Material
1) Standard Price 1) Standard Price
2) Manufacture part 2) Manufacture part
profile actvated profile actvated
3) Quantity & Value 3) Quantity & Value
Updation in all areas Updation in all areas
4) should have same GL 4) Should have same GL acs
acs
It is not possible to change Industry sector once created.
If you want to delete the Material, you can flag it in MM06 trxn code.
Reg,
Ashok
Dont forget to Assign points if useful. -
How do you apply 2 different types of page numbers in the same document?
How do one apply 2 different types of page numbers in the same document??? I do not want a number on the first page!
Click in the second section text:
Inspector > Layout > Section > Configuration > uncheck Use previous headers and footers
Then go back and simply delete what's in the header/footer of the first section.
Peter -
Using a button and a textfield in the same cell of a table
I have been struggling with this problem for ages, please someone help...
I am trying to implement a table similar to NetBeans property sheet editor where you have a textfield and a button with "..." in the same table cell. The button is used to invoke a custom editor.
I have most things working, custom renderers, custom editors and such.
However, the focus interactions on the table seem completely screwed. Clicking in the editor causes the cell to switch to editing mode as expected. Pressing cursor down or tab, which should close the editor and move focus to the next cell down does not work - the editor closes but the focus disappears to a completely different component elsewhere on my GUI.
My textfield and button are on a JPanel, and I return that JPanel when getTableCellEditorComponent is called.
If I switch out the JPanel and instead return the textfield, the focus works as normal.
I've even looked at the NetBeans source but I can't work out what their trick is.
Any tips would be gratefully received.
TIA.Thanks for your time, Jeanette...
Here is a bare-bones example of the problem I'm having. I'm running on JDK1.4 and JDK1.3.1_02.
I've tried some tricks (hacks) with getNextFocusableComponent and requestDefautFocus and such but with no success.
import java.awt.*;
import javax.swing.*;
import javax.swing.table.*;
* This example shows a keyboard/focus navigation problem when using a JPanel
* as a table cell editor. The JPanel contains a textfield and a button.
* Click in the editor to invoke it, and tab-off (or press cursor down). The
* edit ends, but the focus disappears rather than moving to the next cell in
* the table.
* Change the line that returns the panel to return a text field instead, and
* all is well.
public class Test
public static void main( String[] args )
new Test();
public Test()
JFrame f = new JFrame();
f.setContentPane( new TablePanel() );
f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
f.setSize( 800, 600 );
f.setVisible( true );
class TablePanel extends JPanel
TablePanel()
setLayout( new BorderLayout() );
JTable table = new JTable();
table.setDefaultEditor( Object.class, new MyEditor() );
table.setModel(
new DefaultTableModel(
new Object[][]
{null, null},
{null, null},
{null, null},
{null, null}
new String[] { "A", "B" } ) );
add( table, BorderLayout.CENTER );
class MyEditor extends AbstractCellEditor implements TableCellEditor
private JComponent myEditorPanel;
private JTextField myTextField;
MyEditor()
myEditorPanel = new MyEditorPanel();
myTextField = new JTextField();
public Object getCellEditorValue()
return null;
public Component getTableCellEditorComponent( JTable table, Object value,
boolean isSelected,
int row, int column )
return myEditorPanel; // Problems...
// return myTextField; // Keyboard and focus as expected
class MyEditorPanel extends JPanel
JTextField tf;
MyEditorPanel()
setLayout( new BorderLayout() );
tf = new JTextField();
add( tf, BorderLayout.CENTER );
add( new JButton( "edit" ), BorderLayout.EAST ); -
Multiple and conditions in the same table
Ok I am going to kick myself for this, but I can't figure it out. I am trying to figure out how to find employees which match multiple criteria in the same table.
create table emp
(empno number,
name varchar2(10))
create table skills
(skill_id number,
skill_code varchar2(20))
create table emp_skills
(empno number,
skill_id number,
rating number)
insert into emp values(1, 'SMITH');
insert into emp values(2, 'JONES');
insert into skills values (1, 'SQL');
insert into skills values (2, 'PLSQL');
insert into skills values (3, 'JAVA');
insert into emp_skills values(1,1, 8);
insert into emp_skills values(1,2, 9);
insert into emp_skills values(1,3, 10);
insert into emp_skills values(2,1,9);
insert into emp_skills values(2,2,2);
insert into emp_skills values(2,3,7);Now I need to come up with a query finding all employees who match all 3 of the following criteria:
1) Have at least a 5 rating in SQL
2) Have at least a 6 rating in PLSQL
3) Have at least a 7 rating in JAVA
So using this I would expect to return only SMITH since his/her skills meet all 3 criteria. I dont want to use OR in my query since I want all 3 to match not just one of them.
I have a feeling I will need to self join the table - but this is going to be part of a dynamic query for APEX where the users can choose the skills and ratings they want employees to adhere to, so I dont know the number of criteria or the exact criteria in advance. But I figure if I can get a proof of concept SQL I can make it work dynamically.
Any ideas are appreciated - sorry for the long post but I figure more detail is betterwith es1 as(
select s.skill_code, es.empno, es.rating
from skills s, emp_skills es
where s.skill_id = es.skill_id
/* main */
select e.*
from emp e
where
exists
(select 'x' from es1
where es1.rating >= 5
and es1.skill_code = 'SQL'
and es1.empno = e.empno)
and
exists
(select 'x' from es1
where es1.rating >= 6
and es1.skill_code = 'PLSQL'
and es1.empno = e.empno)
and
exists
(select 'x' from es1
where es1.rating >= 7
and es1.skill_code = 'JAVA'
and es1.empno = e.empno)
-- Addition (Another example)
with es1 as(
select s.skill_code, es.empno, es.rating
from skills s, emp_skills es
where s.skill_id = es.skill_id
/* main */
select e.*
from emp e
where
(select count(distinct es1.skill_code) from es1
where
((es1.rating >= 5 and es1.skill_code = 'SQL')
or
(es1.rating >= 6 and es1.skill_code = 'PLSQL')
or
(es1.rating >= 7 and es1.skill_code = 'JAVA')
and es1.empno = e.empno)
=3;
Maybe you are looking for
-
I recently got the Error 43 on my .mov files on the computer and Error 1856 on the online files in Apple's movie trailer. The only other thread on the issue of Error 43 (http://discussions.apple.com/thread.jspa?threadID=769732&tstart=15) thinks that
-
Write a SQL statement that will obtain a date in Oracle in its raw form. And display the 4-digit year.
-
Graphics and images look wrong in Safari 4.0.3
Hello Since upgrading to Safari 4.0.3 graphics and images in websites look low quality. As if they are being rendered with 256 colours or they are heavily compressed. The strange thing is that about a week ago the problem disappeared and everything l
-
Is Adobe Form Central compatible with WIX?
Is Adobe Form Central compatible with WIX.com?
-
HP Photosmart 3180 shared from an Intel iMac
I connected my all in one to my bee-u-tee-full new iMac last week, and flipped on the sharing; piece of cake, right? Done it 100 times, right? My wife gets home from her business trip, and her Macbook tells her the printer doesn't exist. I'm hard lin