Need to fix SQL Join so that charges null return 0
I'm a newbie and have created a large query that grouped returns counts of maintenance records grouped by each paragraph order special maintnance counties apply to. The great qoeks of motion, but the only problem is when maintenance is done for a particular paragraph, paragraph appears at all in the query results. I need to get him back all the paragraph numbers and a zero next to the paragraphs which had no record of maintenance associated with them.Here's my query SQL with SQL to create all the tables and fill the sample data so you can see the application in action.
You'll see when you run the query that paragraphs 161, 161D, 161I and 161J do not appear in the query results, there is no record of maintenance for them, but they are listed in the
pm_requirements_table. All paragraphs should appear in the results, if they have maintenance records, and if no records, they must have a zero next to them.
As always, any help is appreciated.
-- Query
SELECT lpm_paragraph_mapping_table.publication_paragraph, pm_requirements_table.description, pm_requirements_table.frequency, lpm.equipment_ident, count(lpm_paragraph_mapping_table.publication_paragraph) AS activities_performed
FROM lpm
JOIN fsep ON fsep.fac_id = lpm.fac_ident AND fsep.facility = lpm.fac_type
JOIN lpm_paragraph_mapping_table ON trim(lpm.publication_paragraph) = lpm_paragraph_mapping_table.paragraph_alias_mapping
JOIN pm_requirements_table ON pm_requirements_table.publication_order = lpm_paragraph_mapping_table.publication_order AND pm_requirements_table.publication_paragraph_number = lpm_paragraph_mapping_table.publication_paragraph
WHERE trim(lpm.publication_order) = '6310.19A'
AND TRUNC(lpm.start_date,'YEAR') = TO_DATE('01/01/2010','MM/DD/YYYY')
AND fac_ident = 'EWR'
GROUP BY lpm_paragraph_mapping_table.publication_paragraph, pm_requirements_table.description, pm_requirements_table.frequency, lpm.equipment_ident
ORDER BY lpm_paragraph_mapping_table.publication_paragraph ASC;
CREATE TABLE "LPM"
(
"LOG_ID" NUMBER(22,0) NOT NULL ENABLE,
"FAC_IDENT" VARCHAR2(5 BYTE),
"FAC_TYPE" VARCHAR2(5 BYTE),
"CODE_CATEGORY" NUMBER(22,0) NOT NULL ENABLE,
"SUPPLEMENTAL_CODE" VARCHAR2(1 BYTE),
"MAINT_ACTION_CODE" VARCHAR2(1 BYTE),
"INTERRUPT_CONDITION" VARCHAR2(22 BYTE),
"ATOW_CODE" VARCHAR2(22 BYTE),
"SECTOR_CODE" VARCHAR2(5 BYTE),
"LOG_STATUS" VARCHAR2(3 BYTE) NOT NULL ENABLE,
"START_DATE" DATE,
"START_DATETIME" VARCHAR2(22 BYTE),
"END_DATE" DATE,
"END_DATETIME" VARCHAR2(22 BYTE),
"MODIFIED_DATETIME" VARCHAR2(22 BYTE),
"WR_AREA" VARCHAR2(6 BYTE),
"SHORT_NAME" VARCHAR2(15 BYTE),
"EQUIPMENT_IDENT" VARCHAR2(15 BYTE),
"INTERVAL_CODE" VARCHAR2(255 BYTE),
"EARLIEST_DATE" VARCHAR2(4000 BYTE),
"EARLIEST_DATETIME" VARCHAR2(255 BYTE),
"SCHEDULED_DATE" DATE,
"SCHEDULED_DATETIME" VARCHAR2(22 BYTE),
"LATEST_DATE" DATE,
"LATEST_DATETIME" VARCHAR2(22 BYTE),
"WR_CREW_UNIT" VARCHAR2(10 BYTE),
"WR_WATCH" VARCHAR2(1 BYTE),
"PUBLICATION_ORDER" VARCHAR2(30 BYTE),
"PUBLICATION_ORDER_ORIGINAL" VARCHAR2(30 BYTE),
"PUBLICATION_PARAGRAPH" VARCHAR2(30 BYTE),
"PUBLICATION_PARAGRAPH_ORIGINAL" VARCHAR2(30 BYTE),
"NUMBER_OF_TASKS" VARCHAR2(25 BYTE),
"LOG_SUMMARY" VARCHAR2(255 BYTE),
"COMMENTS" CLOB,
"RELATED_LOGS" CLOB,
"LPMANTAC_ID" NUMBER
);
CREATE TABLE "FSEP"
(
"FAC_ID" VARCHAR2(10 BYTE),
"FACILITY" VARCHAR2(5 BYTE),
"FAC_LOCATION" VARCHAR2(13 BYTE),
"FAC_STATE" VARCHAR2(2 BYTE),
"REGION" VARCHAR2(2 BYTE),
"COST_CENTER" VARCHAR2(8 BYTE) NOT NULL ENABLE,
"ATOW_ORG" VARCHAR2(150 BYTE),
"ATOW_ORG_DESCRIPTION" VARCHAR2(150 BYTE),
"SVC_AREA" VARCHAR2(5 BYTE),
"SECTOR_CODE" VARCHAR2(5 BYTE),
"FAC_CODE" VARCHAR2(20 BYTE),
"FAC_STATUS" CHAR(1 BYTE) NOT NULL ENABLE,
"RESTORATION_CODE" VARCHAR2(2 BYTE),
"RESPONSIBILITY_CODE" CHAR(1 BYTE),
"POWER_CODE" CHAR(1 BYTE),
"FAC_STATUS_DATE" DATE,
"FAC_SWAP_DATE" DATE,
"CHANGE_DATE" VARCHAR2(22 BYTE),
"GSA_ADDRESS" VARCHAR2(15 BYTE),
"INV" VARCHAR2(2 BYTE),
"SDP_TYPE" VARCHAR2(5 BYTE),
"SDP_IDENT" VARCHAR2(4 BYTE),
"CONTROL_IDENT" VARCHAR2(10 BYTE),
"REMOTE_IDENT" VARCHAR2(10 BYTE),
"MONITOR_IDENT" VARCHAR2(4 BYTE),
"RUNWAY" VARCHAR2(3 BYTE),
"ASSOC_AIRPORT" VARCHAR2(4 BYTE),
"FAC_MPS_SITE" CHAR(4 BYTE),
"FREQS_IN_PLACE" NUMBER(22,0),
"CONGRESSIONAL_DIS" VARCHAR2(2 BYTE),
"CONTRACT_MAINT_PER" NUMBER(22,0),
"AIR_COND" CHAR(1 BYTE),
"FAC_UNITS" NUMBER(22,0),
"ET_PRIMARY_IDENT" VARCHAR2(4 BYTE),
"ET_PRIMARY_TYPE" VARCHAR2(5 BYTE),
"ENV_PRIMARY_IDENT" VARCHAR2(4 BYTE),
"ENV_PRIMARY_TYPE" VARCHAR2(5 BYTE),
"FAC_CODE_DESC" VARCHAR2(100 BYTE),
"STATUS_DESC" VARCHAR2(50 BYTE),
"RESTORATION_DESC" VARCHAR2(32 BYTE),
"POWER_DESC" VARCHAR2(500 BYTE),
"LATITUDE" VARCHAR2(150 BYTE),
"LONGITUDE" VARCHAR2(150 BYTE),
"ELEVATION" VARCHAR2(22 BYTE),
"MOD_COUNT" VARCHAR2(22 BYTE),
"HYPERLINK" VARCHAR2(255 BYTE),
"FSEPANTAC_ID" NUMBER
);
CREATE TABLE "LPM_PARAGRAPH_MAPPING_TABLE"
(
"PUBLICATION_ORDER" VARCHAR2(30 BYTE),
"PUBLICATION_PARAGRAPH" VARCHAR2(30 BYTE),
"PARAGRAPH_ALIAS_MAPPING" VARCHAR2(30 BYTE),
"LPMTANTAC_ID" NUMBER
);
CREATE TABLE "PM_REQUIREMENTS_TABLE"
(
"PUBLICATION_ORDER" VARCHAR2(30 BYTE),
"PUBLICATION_PARAGRAPH_NUMBER" VARCHAR2(30 BYTE),
"DESCRIPTION" VARCHAR2(4000 BYTE),
"FREQUENCY" VARCHAR2(30 BYTE),
"CHECK_OR_MAINTENANCE" VARCHAR2(22 BYTE),
"PRTANTAC_ID" NUMBER
);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (127227902,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 1:41',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 2:57','06/07/2010 5:51','RADAR','SYS','IEWR','W','06/07/2010','06/07/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',null,null,'6310.19A','6310.19A','161K','161K','1',null, EMPTY_CLOB(), EMPTY_CLOB(),26648);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (127228002,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 1:41',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 2:57','06/07/2010 5:51','RADAR','SYS','IEWR','W','06/07/2010','06/07/2010 0:00',to_date('10-JUN-10','DD-MON-RR'),'06/10/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',null,null,'6310.19A','6310.19A','161F-J','161F-J','8',null, EMPTY_CLOB(), EMPTY_CLOB(),26649);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (127228102,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 1:41',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 2:57','06/07/2010 5:51','RADAR','SYS','IEWR','W','06/07/2010','06/07/2010 0:00',to_date('10-JUN-10','DD-MON-RR'),'06/10/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',null,null,'6310.19A','6310.19A','161E/H','161E/H','5',null, EMPTY_CLOB(), EMPTY_CLOB(),26650);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (127228202,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 1:41',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 2:57','06/07/2010 5:51','RADAR','SYS','IEWR','W','06/07/2010','06/07/2010 0:00',to_date('10-JUN-10','DD-MON-RR'),'06/10/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',null,null,'6310.25','6310.25','161CD','161CD','14',null, EMPTY_CLOB(), EMPTY_CLOB(),26651);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (127228302,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 1:41',to_date('07-JUN-10','DD-MON-RR'),'06/07/2010 2:57','06/07/2010 5:51','RADAR','SYS','IEWR','W','06/07/2010','06/07/2010 0:00',to_date('10-JUN-10','DD-MON-RR'),'06/10/2010 0:00',to_date('13-JUN-10','DD-MON-RR'),'6/13/2010 0:00',null,null,'6310.19A','6310.19A','161AB','161AB','4',null, EMPTY_CLOB(), EMPTY_CLOB(),26652);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (123480402,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:00',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:55','06/02/2010 4:41','RADAR','SYS','IEWR','W','5/31/2010','5/31/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',null,null,'6310.19A','6310.19A','161K','161K','1',null, EMPTY_CLOB(), EMPTY_CLOB(),26657);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (123480502,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:00',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:55','06/02/2010 4:41','RADAR','SYS','IEWR','W','5/31/2010','5/31/2010 0:00',to_date('03-JUN-10','DD-MON-RR'),'06/03/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',null,null,'6310.19A','6310.19A','161F-J','161F-J','8',null, EMPTY_CLOB(), EMPTY_CLOB(),26658);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (123480602,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:00',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:55','06/02/2010 4:41','RADAR','SYS','IEWR','W','5/31/2010','5/31/2010 0:00',to_date('03-JUN-10','DD-MON-RR'),'06/03/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',null,null,'6310.19A','6310.19A','161E/H','161E/H','5',null, EMPTY_CLOB(), EMPTY_CLOB(),26659);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (123480702,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:00',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:55','06/02/2010 4:41','RADAR','SYS','IEWR','W','5/31/2010','5/31/2010 0:00',to_date('03-JUN-10','DD-MON-RR'),'06/03/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',null,null,'6310.25','6310.25','161CD','161CD','14',null, EMPTY_CLOB(), EMPTY_CLOB(),26660);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (123480802,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:00',to_date('02-JUN-10','DD-MON-RR'),'06/02/2010 3:55','06/02/2010 4:41','RADAR','SYS','IEWR','W','5/31/2010','5/31/2010 0:00',to_date('03-JUN-10','DD-MON-RR'),'06/03/2010 0:00',to_date('06-JUN-10','DD-MON-RR'),'06/06/2010 0:00',null,null,'6310.19A','6310.19A','161AB','161AB','4',null, EMPTY_CLOB(), EMPTY_CLOB(),26661);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (120312402,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('27-MAY-10','DD-MON-RR'),'5/27/2010 1:15',to_date('27-MAY-10','DD-MON-RR'),'5/27/2010 2:15','5/27/2010 3:40','RADAR','SYS','IEWR','W','5/24/2010','5/24/2010 0:00',to_date('30-MAY-10','DD-MON-RR'),'5/30/2010 0:00',to_date('30-MAY-10','DD-MON-RR'),'5/30/2010 0:00',null,null,'6310.19A','6310.19A','161K','161K','1',null, EMPTY_CLOB(), EMPTY_CLOB(),26669);
Insert into LPM (LOG_ID,FAC_IDENT,FAC_TYPE,CODE_CATEGORY,SUPPLEMENTAL_CODE,MAINT_ACTION_CODE,INTERRUPT_CONDITION,ATOW_CODE,SECTOR_CODE,LOG_STATUS,START_DATE,START_DATETIME,END_DATE,END_DATETIME,MODIFIED_DATETIME,WR_AREA,SHORT_NAME,EQUIPMENT_IDENT,INTERVAL_CODE,EARLIEST_DATE,EARLIEST_DATETIME,SCHEDULED_DATE,SCHEDULED_DATETIME,LATEST_DATE,LATEST_DATETIME,WR_CREW_UNIT,WR_WATCH,PUBLICATION_ORDER,PUBLICATION_ORDER_ORIGINAL,PUBLICATION_PARAGRAPH,PUBLICATION_PARAGRAPH_ORIGINAL,NUMBER_OF_TASKS,LOG_SUMMARY,COMMENTS,RELATED_LOGS,LPMANTAC_ID) values (120312502,'EWR','ASR',50,'0','P',null,'WEW1D','EA1FH','C',to_date('27-MAY-10','DD-MON-RR'),'5/27/2010 1:15',to_date('27-MAY-10','DD-MON-RR'),'5/27/2010 2:15','5/27/2010 3:40','RADAR','SYS','IEWR','W','5/24/2010','5/24/2010 0:00',to_date('27-MAY-10','DD-MON-RR'),'5/27/2010 0:00',to_date('30-MAY-10','DD-MON-RR'),'5/30/2010 0:00',null,null,'6310.19A','6310.19A','161F-J','161F-J','8',null, EMPTY_CLOB(), EMPTY_CLOB(),26670);
Insert into FSEP (FAC_ID,FACILITY,FAC_LOCATION,FAC_STATE,REGION,COST_CENTER,ATOW_ORG,ATOW_ORG_DESCRIPTION,SVC_AREA,SECTOR_CODE,FAC_CODE,FAC_STATUS,RESTORATION_CODE,RESPONSIBILITY_CODE,POWER_CODE,FAC_STATUS_DATE,FAC_SWAP_DATE,CHANGE_DATE,GSA_ADDRESS,INV,SDP_TYPE,SDP_IDENT,CONTROL_IDENT,REMOTE_IDENT,MONITOR_IDENT,RUNWAY,ASSOC_AIRPORT,FAC_MPS_SITE,FREQS_IN_PLACE,CONGRESSIONAL_DIS,CONTRACT_MAINT_PER,AIR_COND,FAC_UNITS,ET_PRIMARY_IDENT,ET_PRIMARY_TYPE,ENV_PRIMARY_IDENT,ENV_PRIMARY_TYPE,FAC_CODE_DESC,STATUS_DESC,RESTORATION_DESC,POWER_DESC,LATITUDE,LONGITUDE,ELEVATION,MOD_COUNT,HYPERLINK,FSEPANTAC_ID) values ('EWR','ASR','NEWARK','NJ','EA','081FH','WEW1D','Newark Radar/Env SSC','ESA','EA1FH','453ACA','D','4','A','A',to_date('01-AUG-53','DD-MON-RR'),to_date('01-APR-98','DD-MON-RR'),'10/13/2010 9:22','2K50','R1','TRACO','N90','QHM','EWR','QHM',null,'EWR','ZNY ',0,'10',0,'A',1,null,null,null,null,'ASR-9 STANDARD FACILITY','Commissioned/Full Service','Up to 4 Hours','Denotes a commercial power source a standby engine generator and an Uninterruptible Power Supply (UPS). This configuration shall provide uninterruptible conditioned power with AC voltage in and AC voltage out.','40.69033','-74.16278','5','2','http://technet.faa.gov/fsep/fsepDetail.asp?recordno=ASREWR',38191);
Insert into FSEP (FAC_ID,FACILITY,FAC_LOCATION,FAC_STATE,REGION,COST_CENTER,ATOW_ORG,ATOW_ORG_DESCRIPTION,SVC_AREA,SECTOR_CODE,FAC_CODE,FAC_STATUS,RESTORATION_CODE,RESPONSIBILITY_CODE,POWER_CODE,FAC_STATUS_DATE,FAC_SWAP_DATE,CHANGE_DATE,GSA_ADDRESS,INV,SDP_TYPE,SDP_IDENT,CONTROL_IDENT,REMOTE_IDENT,MONITOR_IDENT,RUNWAY,ASSOC_AIRPORT,FAC_MPS_SITE,FREQS_IN_PLACE,CONGRESSIONAL_DIS,CONTRACT_MAINT_PER,AIR_COND,FAC_UNITS,ET_PRIMARY_IDENT,ET_PRIMARY_TYPE,ENV_PRIMARY_IDENT,ENV_PRIMARY_TYPE,FAC_CODE_DESC,STATUS_DESC,RESTORATION_DESC,POWER_DESC,LATITUDE,LONGITUDE,ELEVATION,MOD_COUNT,HYPERLINK,FSEPANTAC_ID) values ('EWR','GS','NEWARK','NJ','EA','081FJ','WEW1C','Newark Nav/Comm SSC','ESA','EA1FJ','314AWA','D','24','A','D',to_date('01-DEC-52','DD-MON-RR'),to_date('01-APR-94','DD-MON-RR'),'9/24/2009 9:51','2K51','6','ATCT','EWR','EWR',null,'QHM','04L','EWR','ZNY ',0,'10',0,'A',1,null,null,null,null,'MARK 1F (SIDEBAND REFERENCE) SINGLE EQUIPMENT CAT I FAC','Commissioned/Full Service','Up to 24 Hours','Denotes a commercial power source and a battery standby power system. A UPS is not included in this category.','40.68395','-74.17291','11','2','http://technet.faa.gov/fsep/fsepDetail.asp?recordno=GSEWR',38212);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161A','161',1708);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161A','161AB',1709);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161B','161',1736);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161B','161AB',1737);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161',1765);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-->J)',1766);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-->K)',1769);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-D)',1770);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-G)',1771);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-J)',1772);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A--J)',1773);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161(A-K)',1774);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161C','161.(A-C).',1775);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(1)','161',1793);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(1)','161(A-->J)',1794);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(1)','161(A-->K)',1797);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(1)','161(A-D)',1798);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(2)','161',1821);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(2)','161(A-->J)',1822);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161D(2)','161(A-->K)',1825);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161E','161E/H',1826);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161F','161E/H',1827);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161G','161E/H',1828);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161H','161E/H',1829);
Insert into LPM_PARAGRAPH_MAPPING_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH,PARAGRAPH_ALIAS_MAPPING,LPMTANTAC_ID) values ('6310.19A','161K','161K',1830);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161A','Check transmitter average rf power output','WEEKLY',null,3);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161B','Check transmitter VSWR','WEEKLY',null,4);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161C','Check RMS transmitter pulse width','WEEKLY',null,5);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(1)','Check filament current','WEEKLY',null,6);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(2)','Check focus coil current','WEEKLY',null,7);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(3)','Check Klystron voltage','WEEKLY',null,8);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(4)','Check Klystron current','WEEKLY',null,9);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(5)','Check PFN voltage','WEEKLY',null,10);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161D(6)','Check vacuum pump current','WEEKLY',null,11);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161E','Check target receiver MDS','WEEKLY',null,12);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161F','Check target receiver NF','WEEKLY',null,13);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161G','Check target receiver recovery','WEEKLY',null,14);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161H','Check weather receiver MDS','WEEKLY',null,15);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161I','Check weather receiver NF','WEEKLY',null,16);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161J','Check weather receiver recovery','WEEKLY',null,17);
Insert into PM_REQUIREMENTS_TABLE (PUBLICATION_ORDER,PUBLICATION_PARAGRAPH_NUMBER,DESCRIPTION,FREQUENCY,CHECK_OR_MAINTENANCE,PRTANTAC_ID) values ('6310.19A','161K','Check spare modem operation','WEEKLY',null,18);
Published by: George Heller on July 13, 2011 10:34
Hello
George Heller wrote:
... The exact results I wanted to obtain data on the forum is below...'PUBLICATION_PARAGRAPH', 'DESCRIPTION', 'FREQUENCY', 'EQUIPMENT_IDENT', 'ACTIVITIES_PERFORMED '.
161 'a', "Transmitter Check average rf power output", "WEEKLY", "IEWR", 2
'161 b', "Transmitter Check ROS", "WEEKLY", "IEWR", 2
"161", "check RMS transmitter pulse width", "WEEKLY", "IEWR", 2
"" 161 D (1) ","Check filament current","WEEKLY"," ' ", 0
"" 161 D (2) ","Check focus coil current","WEEKLY"," ' ", 0
"" 161 D (3) ","Klystron check tension","WEEKLY"," ' ", 0
"" 161 D (4) ","Check Klystron current","WEEKLY"," ' ", 0
"" 161 D (5) ","Check Tension of NFP","WEEKLY"," ' ", 0
"" 161 D (6) ","Check current vacuum pump","WEEKLY"," ' ", 0
"161F', 'Receiver target check MDS', 'WEEKLY', 'IEWR', 2
"161F", "Check receiving target NF", "WEEKLY", "IEWR", 2
'161G', ' Check target receiver recovery ","WEEKLY","IEWR", 2
'161H', 'Receiver weather check MDS', 'WEEKLY', 'IEWR', 2
"161I","Check weather receiver NF ', 'WEEKLY',' ', 0 '.
'161J', 'The weather receiver Check recovery',' ', 0 '.
"161K',' operation spare modem check", "WEEKLY", "IEWR", 3
Please put in the form results. Who do you think is easier to read and understand: the results you've posted higher, or these?
` EQUI ACTIV
PUBLICAT PMEN ITIES
ION_PARA T_ID _PERF
GRAPH DESCRIPTION FREQUENCY ENT ORMED
-------- ----------------------------------------- --------- ----- -----
161A Check transmitter average rf power output WEEKLY IEWR 2
161B Check transmitter VSWR WEEKLY IEWR 2
161C Check RMS transmitter pulse width WEEKLY 0
161D(1) Check filament current WEEKLY 0
161D(2) Check focus coil current WEEKLY 0
161D(3) Check Klystron voltage WEEKLY 0
161D(4) Check Klystron current WEEKLY 0
161D(5) Check PFN voltage WEEKLY 0
161D(6) Check vacuum pump current WEEKLY 0
161E Check target receiver MDS WEEKLY IEWR 2
161F Check target receiver NF WEEKLY IEWR 2
161G Check target receiver recovery WEEKLY IEWR 2
161H Check weather receiver MDS WEEKLY IEWR 2
161I Check weather receiver NF WEEKLY 0
161J Check weather receiver recovery WEEKLY 0
161K Check spare modem operation WEEKLY IEWR 3
Who do you think will encourage people to answer your question? Who do you think is more likely to lead to accurate solutions?
The following query is pretty close to what you asked:
SELECT req.publication_paragraph_number AS publication_paragraph
, req.description
, req.frequency
, MAX (lpm.equipment_ident) AS equipment_ident
, COUNT (fsep.fac_id) AS activities_performed
FROM pm_requirements_table req
LEFT OUTER JOIN lpm_paragraph_mapping_table pmap ON req.publication_order = pmap.publication_order
AND req.publication_paragraph_number = pmap.publication_paragraph
LEFT OUTER JOIN lpm ON TRIM (lpm.publication_paragraph) = pmap.paragraph_alias_mapping
AND TRIM (lpm.publication_order) = '6310.19A'
AND TRUNC(lpm.start_date, 'YEAR') = TO_DATE ('01/01/2010', 'MM/DD/YYYY')
AND lpm.fac_ident = 'EWR'
LEFT OUTER JOIN fsep ON fsep.fac_id = lpm.fac_ident
AND fsep.facility = lpm.fac_type
GROUP BY req.publication_paragraph_number
, req.description
, req.frequency
ORDER BY req.publication_paragraph_number
;
"As you can see, the last two columns, equipment_ident and actiovities_performed, are not what you asked for publication_paragraph ' 161 C". I guess just what you want in these columns. Guess, this isn't a very effective way to solve problems. "Explain what you want in these columns, and how derive you these values in the case of publication_paragraph ' 161 C".
Tags: Database
Similar Questions
-
My computer cannot join a homegroup. What do I need to fix this?
my computer cannot join a homegroup, what do I need to fix this?
Windows 7 is installed? This is the only version of windows that supports the homegroup
-
Need to call the Shell script that uses SQL loader in APex4.1 / 11g
Hello!
I have a requirement in which I need to call a shell script that connects to an external server, FTP to a file and then use sqlloader to load data into our table. We have now the ftp script that accomplishes this task to another program, but is a scheduled task. I wanted to call the script ftp in the APEX. Any suggestions on how this can be done, what is the logic of PL/SQL can we use? I saw online some people using DBMS Scheduler for this?
Thank you
SunHello
Create some sh script on your computer host oracle where you can join in the external server and run the process.
something like:run_external_sh.sh
#!/bin/sh ssh ext_user@ext_host ./sqlloader/import/import.sh
Then create an external TASK to call it via ORACLE (PL/SQL)
-Shell Script call.
BEGIN DBMS_SCHEDULER.create_program ( program_name => 'external_call_sh', program_type => 'EXECUTABLE', program_action => '/local_host/call_external/sh/run_external_sh.sh', number_of_arguments => 0, enabled => TRUE, comments => 'Call external SH script'); END; /
You can now create a regular / or unplanned WORK
-Job defined by the calendar and an existing program.BEGIN DBMS_SCHEDULER.create_job ( job_name => 'jb_external_call_sh', program_name => 'external_call_sh', schedule_name => 'external_call_scheduler', -- created scheduler enabled => TRUE, comments => 'Job defined by an existing external_call_sh program and schedule.'); END; /
You can now call the WORK in the APEX in the process of PL/SQL.
BEGIN -- Run job synchronously. DBMS_SCHEDULER.run_job (job_name => 'jb_external_call_sh'); END;
Concerning
J :D -
I can't attach pdf files in Outlook. It all started yesterday. I need a fix that I use a lot.
I was about to reload firefox and decided to reboot once more. And now without any particular reason it works normally again. Thanks for your efforts.
-
I use Windows Vista and that you need to download SQL Server 2005 Express Service Pack 4. I get an error code 64 C help, please.
Hello
I suggest you to try the steps below and check if it helps.
Method 1: Try to reset components to update Windows from the following link, which would help you to install the updates of windows. http://support.Microsoft.com/kb/971058
Method 2: If the problem persists, then try to set up your computer in a clean boot state, and check to see if the same problem happens.
By setting your boot system minimum state helps determine if third-party applications or startup items are causing the problem.
How to troubleshoot a problem by performing a clean boot in Windows Vista or Windows 7:
http://support.Microsoft.com/kb/929135Note: After the boot minimum troubleshooting step, follow step 7 in the link provided to return the computer to a Normal startup mode.
Method 3: Also try to install the updates manually from the link below.
http://www.Microsoft.com/download/en/details.aspx?displaylang=en&ID=184
You can also consult the following link for more information:
Troubleshoot problems with installing updates.
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-with-installing-updates
Hope this information is useful.
-
Hi, I'm Barbara, I downloaded Photoshop CC with bridge. When I started the implementation of bridge, I noticed that the name of the creator in IPTC Core indicates as BarBa; Barbara G Reed - it is not correct and I need to fix this model to show the right information that help is appreciated
Hi bgrphoto,
Please follow the link below and look for "edit metadata in the metadata Panel.
Bridge help | Use metadata in Adobe Bridge
It will be useful.
Kind regards
~ Mohit
-
Need advice on SQL report base to APEX or jasper
Hi all
I need some advice on how to approach the question under the requirement of report. It was me mad for almost 2 weeks now, and my time is running out.
Here is a simplified version of the database
Four paintings: event, Service, commitment, defendant.
A defendant may have more than 1 commitment, but they only open at a time commitment.
For each commitment, they will have services and events.
These events may be just general events or related to the service.
Here's the script for tables and sample data
****CREATE TABLE "DEFENDANT" ("DEF_ID" NUMBER, "FIRST_NAME" VARCHAR2(50 BYTE), "LAST_NAME" VARCHAR2(50 BYTE), "ACTIVE" NUMBER DEFAULT 1 ) ; Insert into DEFENDANT (DEF_ID,FIRST_NAME,LAST_NAME,ACTIVE) values (1,'Joe','Bloggs',1); Insert into DEFENDANT (DEF_ID,FIRST_NAME,LAST_NAME,ACTIVE) values (2,'John','Doe',1); -------------------- CREATE TABLE "ENGAGEMENT" ("ENG_ID" NUMBER, "DEF_ID" NUMBER, "COURT_NAME" VARCHAR2(20 BYTE), "DATE_JOINED" DATE, "DATE_TERMINATED" DATE, "ETHNICITY" VARCHAR2(50 BYTE), "ACTIVE" VARCHAR2(20 BYTE) ) ; / Insert into ENGAGEMENT (ENG_ID,DEF_ID,COURT_NAME,DATE_JOINED,DATE_TERMINATED,ETHNICITY,ACTIVE) values (1,1,'AAA',to_date('01/09/12','DD/MM/RR'),to_date('20/09/12','DD/MM/RR'),'European','1'); Insert into ENGAGEMENT (ENG_ID,DEF_ID,COURT_NAME,DATE_JOINED,DATE_TERMINATED,ETHNICITY,ACTIVE) values (2,2,'BBB',to_date('01/10/12','DD/MM/RR'),null,'Asian','1'); Insert into ENGAGEMENT (ENG_ID,DEF_ID,COURT_NAME,DATE_JOINED,DATE_TERMINATED,ETHNICITY,ACTIVE) values (3,1,'AAA',to_date('22/09/12','DD/MM/RR'),null,'European','1'); -------------------------------------------------------- CREATE TABLE "EVENT" ("EVENT_ID" NUMBER, "ENG_ID" NUMBER, "NOTES" VARCHAR2(20 BYTE), "RELATED_SERVICE_ID" NUMBER, "START_DATE" DATE, "END_DATE" DATE, "ACTIVE" NUMBER DEFAULT 1 ) ; / -------------------------------------------------------- Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (1,1,null,1,to_date('01/09/12','DD/MM/RR'),to_date('02/09/12','DD/MM/RR'),1); Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (2,1,null,1,to_date('23/09/12','DD/MM/RR'),null,1); Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (3,1,null,2,to_date('15/10/12','DD/MM/RR'),to_date('16/10/12','DD/MM/RR'),1); Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (4,2,null,null,to_date('02/10/12','DD/MM/RR'),null,1); Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (5,2,null,2,to_date('03/10/12','DD/MM/RR'),null,1); Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (6,3,null,null,to_date('22/09/12','DD/MM/RR'),to_date('23/09/12','DD/MM/RR'),1); Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (7,3,null,4,to_date('23/09/12','DD/MM/RR'),null,1); Insert into EVENT (EVENT_ID,ENG_ID,NOTES,RELATED_SERVICE_ID,START_DATE,END_DATE,ACTIVE) values (8,2,null,null,to_date('12/10/12','DD/MM/RR'),null,1); -------------------------------------------------------- CREATE TABLE "SERVICE" ( "SERVICE_ID" NUMBER, "ENG_ID" NUMBER, "DESCRIPTION" VARCHAR2(200 BYTE), "DATE_STARTED" DATE, "DATE_TERMINATED" DATE, "ACTIVE" NUMBER DEFAULT 1 ); / Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (1,1,'Counselling',to_date('15/09/12','DD/MM/RR'),to_date('18/09/12','DD/MM/RR'),1); Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (2,1,'Housing',to_date('20/09/12','DD/MM/RR'),null,1); Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (3,2,'Treatment',to_date('01/10/12','DD/MM/RR'),to_date('15/10/12','DD/MM/RR'),1); Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (4,3,'Housing',null,null,1); Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (5,1,'Other',to_date('05/10/12','DD/MM/RR'),null,0); Insert into SERVICE (SERVICE_ID,ENG_ID,DESCRIPTION,DATE_STARTED,DATE_TERMINATED,ACTIVE) values (6,2,'Treatment',to_date('16/10/12','DD/MM/RR'),null,1);
And that's the perspective I think to use as a basis for the report
****CREATE OR REPLACE FORCE VIEW "BASE_VW" AS SELECT Def.Def_Id, Def.First_Name, Def.Last_Name, Eng.Eng_Id, Eng.Court_Name, Eng.Date_Joined, Eng.Date_Terminated, Eng.Ethnicity, Ser.Service_Id, Ser.Description, Ser.Date_Started AS Service_Start_Date, Ser.Date_Terminated AS Service_Date_Terminated, Ser.Active AS Service_Active, Ev.Event_Id, Ev.Related_Service_Id, Ev.Start_Date, Ev.End_Date, Ev.Notes, ev.active AS event_active FROM Defendant Def LEFT OUTER JOIN Engagement Eng ON Def.Def_Id = Eng.Def_Id LEFT OUTER JOIN Service Ser ON Eng.Eng_Id = Ser.Eng_Id LEFT OUTER JOIN Event Ev ON Ev.Eng_Id = Eng.Eng_Id;
Requirement:
Report parameter: Start Date, end Date, Court_name
Of selected Court_name, list of defendants who are currently participating in the Court.
For each display of the defendant
Section 1: Identification of the details: first name, surname, ethnicity, Date of arrival in the Court
Section 2: All currently active Services that the defendant attend
Section 3: All the events related to the service attending the defendant
Section 4: All other events (don't have IDS Service related)
The user must be able to download the full report in the spreadsheet or in PDF format.
I tried to create a set of Union chooses (but the format is not that good, when no data return show nothing, I would like to show rather some messages as "There is no associated event, rather than nothing")
and he produced a report for 1 defendant at the same time.
We use Oracle APEX, so only select statement or statement select return PL/SQL Code is valid for the report source.
At our place, we use Jasper adjacent report at the APEX, but I have very little experience with report of Jasper.
The developer who knows a lot about the report of jasper is too busy to help me.
Currently I use the union chooses as below:
and the result is a bit what I try to achieve (except that I need to work on the screen a message "No data found" rather than anything), but it seems that my code works for one respondent.With Current_Engagement As ( Select Eng_Id From Engagement Where Def_Id =2 And Date_Joined Is Not Null And ( Date_Terminated Is Null Or Date_Terminated > Sysdate) And Rownum =1 ) Select '1.Defendant ID' as col1, 'First Name' as col2, 'Last Name' as col3, 'Court Name' as col4, 'Ethnicity' as col5, 'Date Joined' as col6, 'Date Terminated' as col7 From Dual Union All Select Distinct to_char(Def_Id), First_Name, Last_Name, Court_Name, Ethnicity, to_char(Date_Joined), to_char(Date_Terminated) From Base_Vw Inner Join Current_Engagement Ce On Base_Vw.Eng_Id = Ce.Eng_Id Union All select '2.Service ID', 'Service Description', 'Start Date', 'End Date', Null, Null, Null from dual Union All Select distinct to_char(service_id), description, to_char(service_start_date), to_char(service_date_terminated), null, null, null From Base_Vw Inner Join Current_Engagement Ce On Base_Vw.Eng_Id = Ce.Eng_Id where service_active =1 Union All Select '3.Event ID', 'Related Service ID', 'Start Date', 'End date', 'Notes', null, null From Dual Union All Select distinct to_char(event_id), to_char(related_service_id), to_char(start_date), to_char(end_date), notes, null, null from Base_Vw Inner Join Current_Engagement Ce On Base_Vw.Eng_Id = Ce.Eng_Id Where Event_Active = 1 and related_service_id is not null Union All Select '4.Event ID', 'Start Date', 'End date', 'Notes', null, null, null From Dual Union All Select distinct to_char(event_id), to_char(start_date), to_char(end_date), notes, null, null, null From Base_Vw Inner Join Current_Engagement Ce On Base_Vw.Eng_Id = Ce.Eng_Id Where Event_Active = 1 and related_service_id is null
However, I struggle to find a way to apply this to more than 1 defendant and always keep the format.COL1 COL2 COL3 COL4 COL5 COL6 COL7 ------------------------------ ------------------------------ ------------------------------ -------------------- -------------------- ----------- --------------- 1.Defendant ID First Name Last Name Court Name Ethnicity Date Joined Date Terminated 2 John Doe BBB Asian 01/10/12 2.Service ID Service Description Start Date End Date 3 Treatment 01/10/12 15/10/12 6 Treatment 16/10/12 3.Event ID Related Service ID Start Date End date Notes 5 2 03/10/12 4.Event ID Start Date End date Notes 4 02/10/12 8 12/10/12 10 rows selected
Is it possible to view a report as above using only the SQL script?Defendant 1 All details related to defendant 1 Defendant 2 All details relayed to defendant 2 ... Defendant n All details relayed to defendant n
Thank you very much in advance. I'm ready to financially compensate someone who can give me a solution.
Edited by: Ann586341. Base_vw SQL view script is fixed.Hi, Ann.
The query I posted earlier can be simplified a bit. You need not partitioned outer joins, which means that you don't need d_num.
WITH current_engagement AS ( SELECT Def.Def_Id , Def.First_Name , Def.Last_Name , Eng.Eng_Id , Eng.Court_Name , Eng.Date_Joined , Eng.Date_Terminated , Eng.Ethnicity , ROW_NUMBER () OVER ( PARTITION BY def.def_id ORDER BY eng.date_joined , eng.eng_id ) AS e_num FROM Defendant Def JOIN Engagement Eng ON Def.Def_Id = Eng.Def_Id WHERE ( Eng.Date_Terminated IS NULL OR Eng.Date_Terminated >= TO_DATE (:p_start_date, 'DD/MM/YYYY') ) AND Eng.Date_Joined <= TO_DATE (:p_end_date, 'DD/MM/YYYY') AND Eng.court_name = :p_court_name ) , event_types AS ( SELECT 3.2 AS event_type FROM dual UNION ALL SELECT 4.2 FROM dual ) , union_results AS ( -- Section 1 Header: 1 row per defendant SELECT '1.Defendant ID' AS col1 , 'First Name' AS col2 , 'Last Name' AS col3 , 'Court Name' AS col4 -- , 'Ethnicity' AS col5 ... , def_id , 1.1 AS section_num , 0 AS r_num FROM current_engagement WHERE e_num = 1 UNION ALL -- Section 1 Data: 1 row per defendant SELECT TO_CHAR (def_id) AS col1 , first_name AS col2 , last_name AS col3 , court_name AS col4 , def_id , 1.2 AS section_num , 1 AS r_num FROM current_engagement WHERE e_num = 1 UNION ALL -- Section 2 Header: 1 row per defendant SELECT '2.Service ID' AS col1 , 'Service Description' AS col2 , 'Start Date' AS col3 , 'End Date' AS col4 , def_id , 2.1 AS section_num , 0 AS r_num FROM current_engagement UNION ALL -- Section 2 Data: 1 row per service (at least 1 per defendant) SELECT DISTINCT NVL ( TO_CHAR (s.service_id), 'No Data') AS col1 , NVL (s.description, 'No Data') AS col2 , NVL ( TO_CHAR (s.date_started, 'DD/MM/YYYY') , 'No Data') AS col3 , NVL ( TO_CHAR (s.date_terminated, 'DD/MM/YYYY') , 'No Data') AS col4 , ce2.def_id , 2.2 AS section_num , s.service_id AS r_num FROM current_engagement ce2 LEFT OUTER JOIN service s ON s.eng_id = ce2.eng_id AND s.active = 1 UNION ALL -- Section 3 Header: 1 row per defendant SELECT '3.Event ID' AS col1 , 'Related Service ID' AS col2 , 'Start Date' AS col3 , 'End date' AS col4 , def_id , 3.1 AS section_num , 0 AS r_num FROM current_engagement UNION ALL -- Section 4 Header: 1 row per defendant SELECT '4.Event ID' AS col1 , 'Start Date' AS col2 , 'End date' AS col3 , 'Notes' AS col4 , def_id , 4.1 AS section_num , 0 AS r_num FROM current_engagement UNION ALL -- Section 3+4 Data: 1 row per event (at least 2 per defendant) SELECT DISTINCT NVL ( TO_CHAR (e.event_id), 'No Data') AS col1 , NVL ( CASE et.event_type WHEN 3.2 THEN TO_CHAR (e.related_service_id) ELSE TO_CHAR (e.start_date, 'DD/MM/YYYY') END , 'No Data') AS col2 , NVL ( CASE et.event_type WHEN 3.2 THEN TO_CHAR (e.start_date, 'DD/MM/YYYY') ELSE TO_CHAR (e.end_date, 'DD/MM/YYYY') END , 'No Data') AS col3 , NVL ( CASE et.event_type WHEN 3.2 THEN TO_CHAR (e.end_date , 'DD/MM/YYYY') ELSE e.notes END , 'No Data') AS col4 , ce34.def_id , et.event_type AS section_num , e.event_id AS r_num FROM current_engagement ce34 CROSS JOIN event_types et LEFT OUTER JOIN event e ON e.eng_id = ce34.eng_id AND e.active = 1 AND NVL2 ( e.related_service_id , 3.2 , 4.2 ) = et.event_type ) SELECT col1, col2, col3, col4 FROM union_results ORDER BY def_id , section_num , r_num ;
-
Why my Apple TV so slow is download from iTunes when other sites such as HBOGo or Netflix or showtime begin playing immediately. Apple needs to fix this!
These services adapt to the connection that iTunes is set the highest rate and quality it will load a front part of reading people.
You need the problems
What is your current connection via speedtest
Make sure that DNS is set to automatic (network - general - settings)
If during testing of wifi Ethernet
Test on another network
-
This is a limitation of the software that HP needs to fix. I bought this machine multifunction largely for two features, ePrint, and two bins to paper. I had released two paper because I often need to print on paper thick and does not want to manually load the cards into the printer whenever I don't want to print on thicker paper. Unfortunately tray 2 is not compatible with card stock so I keep copy regular paper in tray 2 (tray 2 is defined as the default tray) and I keep card stock in Tray 1, which is compatible with cards. The problem and the limitation is when I am traveling and want to use ePrint. Even if my default tray on the printer is 2, which is where the paper is, if I use ePrint to print, HP ePrint by default tray 1, which means that I print on thick paper. This isn't only a problem when you travel. One of the advantages of the ePrint, in theory, is I can print on my desktop at home via ePrint printer when connected to my VPN employers. I've had this machine for two years. It seems that HP would have an update now to solve this problem. So far, nothing. Frustrating!
Hello @HudsonOH,
Thanks for posting in the forums of HP and welcome.
I understand that you are not able to choose your paper tray of your HP Officejet Pro 8600 Premium e-all-in-one using ePrint. I would like to help with this, as much as I can.
Unfortunately, when you simply send an e-mail to the printer, you cannot change the print settings, because it uses the default settings on the ePrint server.
However, if you have an Android or iOS device, you can download the HP ePrint app. This allows you to add the printer by ePrint e-mail address and send print jobs when you are not with the computer (need you an active wifi or data connection, however). The application also allows to select print settings if you can ensure that you don't waste card stock paper you loaded in the machine.
To download the app on iOS, simply open the app store and type 'HP ePrint' in the search bar.
To download the app on Android, you can open the store game (or game of Google) and search for "HP ePrint.
Once you have installed the application, you can add your printer via his email ePrint:
1. open the ePrint application and select OK on the demo screens.
2. Once you reach the home screen, it will show your printer name, or not find printers (depending on whether you are at home with your printer, or on the go). Select this check box.
3. you will see a tab at the top that says all, select it.
4. press on the + symbol to add a printer.
5. Enter your ePrint e-mail address and select Add.
To print using the application, return to the home screen and select an item to print one of the options listed. Note: If you are on iOS, you can even add your e-mail information in the application so that you can print emails.
In addition, you can sign up here for updates on the new firmware and software for your printer, in which case no alternative workaround should arise: stay connected with updates from HP
I hope this helps!
-
How can I set up a website that charges a small fee when landed on?
Original title: Mother Mary
How can I set up a website that charges a small fee when landed on? I have something to show to the world & I, that the award is not unreasonable
[Moved from the community centre of Participation]
First of all, this is not the arena for that. Do some research on Google and Bing.
Then, if someone has to pay a fee, it should be their choice, whether they pay or not. It'snot automatic. You will need to research the acceptance of credit card, merchant gateways, set bit. And it won't be cheap.
-
I need to fix my computer, I got the blue screen of death with the following error message. Registry cannot load the file \systemRoot\system32\config\SOFTWARE "HIVE".
I read all the forums on how to solve this problem. I tried all the means which have been enumerated. None have worked so far because I can't get my CD player to load to run my Windows XP Pro disc to start the repair.
Is there a way to fix this without the disc. I can't the computer after Windows XP display until he went blue. It's a computer original systemax, but I have since rebuilt it me with the new motherboard, hard disk, cdrom, dvdrom, ram, fans, cpu, etc... I just got a new monitor and hung up and blue screen of death appeared after that I turned the computer back on. I tried to fix this for 4 days now. Someone please HELP me.
I got it fixed. THANK YOU SO MUCH for all your help!
-
Hello
I have a requirement in which I need to get data from a third table where a date of the third table is higher than a date in the second array.
Ex:
SELECT t1.column1, t3.column2 FROM t1, t2, t3 WHERE t1.id = t2.foreign_id AND t1.id ( + ) = t3.foreign_id AND t3.some_date_column > t2.another_date_column
However, using the query above returns no results if the date condition is not met. I still need to show t1.column1 and a null t3.column2.
How should I do this?
Thank you
Allen
Edit: Added information about the requirement.
Hi Allen
- SELECT t1.column1, t3.column2
- T1, t2, t3
- WHERE t1.id = t2.foreign_id
- AND t1.id = t3.foreign_id (+)
- AND t3.some_date_column (+) > t2.another_date_column
I guess that this t1.column1 must not be null. Or am I wrong? The + sign must be placed on the side where draws are accepted. You must repeat it for each condition on the table.
Alternativlely you can use the LEFT OUT JOIN syntax. If the two columns are allowed null you need a FULL OUTER JOIN.
BTW: The join to t2 is not required if a refefernce constraint forced.
-
What is the new method of SQL joins
Dear all,
What is the new method of SQL joins
1
SELECT <fields> FROM TableA a INNER JOIN TableB b ON a.key = b.key
2
SELECT <fields> FROM TableA a, TableB b WHERE a.key = b.key
Above the two queries work very well in PL/SQL, but request that no 1 does not work in Oracle Forms 10 g
Kind regards
Zafar Iqbal
Hello
Zafar Iqbal wrote:
Dear all,
What is the new method of SQL joins
1
- SELECT
- TableA, TableB INNER JOIN a and b WE a.key, b.key =
2
- SELECT
- FROM TableA, TableB b
- WHERE a.key, b.key =
Above the two queries work very well in PL/SQL, but request that no 1 does not work in Oracle Forms 10 g
Kind regards
Zafar Iqbal
What, exactly, is your question?
Literally ask you which of these 2 methods is new? As mentioned above, none is really new. Both participated in Oracle at least 13 years.
Query 1, above, ANSI join syntax uses, which is more recent. As mentioned above, Oracle has started to support that the syntax in version 9.1 (2001) previous versions only supported syntax used in query 2.
Did you mean to ask something else? Maybe "How can I use a query as a query 1 forms?" or "are there other places where a method works, but the other is not?
- SELECT
-
4.0 need a fix for Black or 4page behind background jpg
Web design with full history jpg but 2 pages have a weird need a fix of a black behind the jpg and the other has 4 pg background. Frustrated customer he wanted 5 days ago. Help, please. Mac, Dreamweaver 4.0Thanks to everyone who tried to help me! I finally solved the problem by opening a new page in the site and copy the page, naming a new and throw the old one. It happened because I moved the site on the desktop file and then returned to the dreamweaver program that created more than one folder. The dark behind the bottom left.
Ann -
need to customize SQL query verification
Friends,
I need to create a custom sql query. Please see the following scenarios:
I want to audit all users who are successfully and unsuccessfully to logon to my oracle database. Tahts why I enbale 2 following options:
SQL > session audit every time that successful;
Verification succeeded.
SQL > noaudit session each time it fails.
Verification succeeded.
And I found all the users using the following sql query:
"Select username, to_char (timestamp," MM/DD/YY HH24 ' ") Timestamp, obj_name, returncode, action_name of."
"dba_audit_trail where action_name in ('LOGIN', 'LOGOUT') order by timestamp desc '.
USERNAME TIMESTAMP OBJ_NAME RETURN_CODE ACTION_NAME
-------- --------- -------- ------------- -----------
RIPON 14-12-08 11:51 0 LOGON
SHIPON 14-12-08 11:50 1017 LOGON
RIPON 14-12-08 11:50 1017 LOGON
Here, return_code = 1017 means the user cannot successfully loged on
and, return_code = 0 the average user can successfully connected
Now, I want to custom to the query that is readable to others easily. As
I want to add a column, which meets the follwing If condition.
Return_code = 0, then the column is 'USER CORRECTLY CONNECTED ON' and
If return_code = 1017, then the column displays "USER NOT CORRECTLY CONNECTED ON".
can someone please help with this?
Edited by: shipon_97 14 December 2008 13:28A CASE statement is probably the easiest option
select username, to_char(timestamp,'MM/DD/YY HH24:MI') Timestamp, obj_name, returncode, action_name, (CASE WHEN return_code = 0 THEN 'User logged in successfully' WHEN return_code = 1017 THEN 'User specified an invalid password' ELSE 'User failed to log in for some other reason' END) reason_desc from dba_audit_trail where action_name in ('LOGON','LOGOFF') order by timestamp desc
Note that any nonzero return code indicates a failed to connect. ORA-01017 indicates an invalid user name or password, which is probably the most common error.
Justin
Maybe you are looking for
-
Is it possible to move saved AOL emails to iCloud?
I was not able to get AOL emails for a week now. It seems that the server is down, so I thought. I have an iCloud email address that I just used successfully. My thought is that I should start using iCloud email address all the time. I had my AOL acc
-
Compatibility of Selfie Stick with 6 s iPhone?
What sticks selfie are best for the iPhone 6 s?
-
I can't find a video or graphics driver for a pc laptop hp pavilion dv8315nr the product and model number is EZ580UA #ABA the version of windows in my computer is windows 7, my computer has finished all its important updates of Windows. I've updated
-
Vista can run on the XP machine with win7 drivers?
HP Compaq dx2000 MT business desktop, came with XP Pro, owner wants to run Vista, looking online I see windows7 drivers for this device here on the site of HP: http://h20564.www2.HP.com/hpsc/SWD/public/readIndex?sp4ts.Oid=401821&swLangOid=8&swEnvOid=
-
my Acer Switch 10 will not be on!
just bought my ACER SWITCH 10 a couple of months. Sometimes it freezes, but I don't worry about this. But the worst now, this morning, I can't turn it on... What can I do with it, or how can I make the "ignition" manually? No idea... Thank you