BI Authorisations - before or after SQL
Just wanted to clarify for my own piece of mind
If you have a infobject that for example you specify as user input AND then have a authorisation object
Does (as I believe) the full result set gets selected from the database and then the OLAP processor throws away the non relevant records?
In addition if we use a auth variable - does this get around the full result set problem
Thanks
Very Interesting scenario .....
I guess when you apply Authorization variables - the filters are passed on to the SQl Query ( have not checked - should explore using RSRT ) and the other option is as you said - dependent on the OLAP cache....
One interesting way to find out is also to use RSRT where you can give "Variable Breakpoints " and some interesting breakpoints open up...
Similar Messages
-
How to covert before and after image details from logdump to SQL
Hi,
Through logdump,i am able to retrieve below before and after image details for an update statement.
Instead of below ascii format output, i need to know the complete sql statement before update and after update.
Is there any command to covert below output to readable SQL sentence?
2012/09/26 02:30:16.999.659 FieldComp Len 300 RBA 2528
Name: TEST.TESTTABLE
Before Image: Partition 4 GU m
5e50 86f5 af70 9660 b6fa 785c e34f 8881 0497 9507 | ^P...p.`..x\.O......
799f 2ee2 6399 d539 ea92 90de 828b 83d9 adc9 c8c4 | y...c..9............
ca87 9632 7136 a5fc 826f 8cc7 6ddd 7f8a e02e 816a | ...2q6...o..m......j
6ac4 739a 8011 5068 068a 4553 4937 93e7 cc5a d3d3 | j.s...Ph..ESI7...Z..
6a2b 2540 3be9 1df7 6d0c 0f17 d795 efd4 e0c5 dae9 | j+%@;...m...........
a488 a757 7c07 78a4 5f2a 1330 d2bb 5a05 7075 6b95 | ...W|.x._*.0..Z.puk.
529c f681 97d8 df6f 58d5 37dc e36d 8bc0 19d5 c7f0 | R......oX.7..m......
Bad compressed block, found length of 34549 (x86f5), RBA 2528
Logdump 2335 >n
Hdr-Ind : E (x45) Partition : . (x04)
UndoFlag : . (x00) BeforeAfter: A (x41)
RecLength : 300 (x012c) IO Time : 2012/09/26 02:30:16.999.659
IOType : 15 (x0f) OrigNode : 255 (xff)
TransInd : . (x01) FormatType : R (x52)
SyskeyLen : 0 (x00) Incomplete : . (x00)
AuditRBA : 24567 AuditPos : 4268948
Continued : N (x00) RecCount : 1 (x01)
2012/09/26 02:30:16.999.659 FieldComp Len 300 RBA 2947
Name: TEST.TESTTABLE
After Image: Partition 4 GU m
5e50 86f5 af70 9660 b6fa 785c e34f 8881 0497 9507 | ^P...p.`..x\.O......
799f 2ee2 6399 d539 ea92 90de 828b 83d9 adc9 c8c4 | y...c..9............
ca87 9632 7136 a5fc 826f 8cc7 6ddd 7f8a e02e 816a | ...2q6...o..m......j
6ac4 739a 8011 5068 068a 4553 4937 93e7 cc5a d3d3 | j.s...Ph..ESI7...Z..
6a2b 2540 3be9 1df7 6d0c 0f17 d795 efd4 e0c5 dae9 | j+%@;...m...........
a488 a757 7c07 78a4 5f2a 1330 d2bd 5a05 7075 6b95 | ...W|.x._*.0..Z.puk.
529c f681 97d8 df6f 58d5 37dc e36d e8b8 19d5 1af0 | R......oX.7..m......
Bad compressed block, found length of 34549 (x86f5), RBA 2947From the reference guide:
*FORMATSQL*
Valid for Extract
Use the FORMATSQLparameter to output data in external SQL format, instead of the default
Oracle GoldenGate canonical format. FORMATSQLgenerates SQLstatements (INSERT, UPDATE,
DELETE) that can be applied to both SQLand Enscribe tables by utilities other than Oracle
GoldenGate Replicat.
NOTE Do not use FORMATSQL if the data will be processed by the Replicat process.
Replicat expects the default canonical format. Do not use FORMATSQLif
FORMATASCIIor FORMATXMLis being used.
A FORMATSQL statement affects all extract files or trails defined after it.
Default output
Without options, FORMATSQLtransactions are output as follows, in comma-delimited format:
● The begin-transaction indicator, B.
● The timestamp at which the transaction was committed.
● The sequence number of the transaction log in which the commit was found.
● The relative byte address (RBA) of the commit record within the transaction log.
● The SQL statements.
● The commit indicator, C.
● A newline indicator.
Every record in a transaction is contained between the begin and commit indicators. Each
combination of commit timestamp and RBA isunique. You can customize the output
format with optional arguments.
Default See “Default output”
Syntax FORMATSQL [<option>] [, ...] -
How to get the query result of improvement (Before and After ) using sql de
how to get the query result of improvement (Before and After ) using sql developer.
Check
http://www.oracle.com/technetwork/articles/sql/exploring-sql-developer-1637307.html -
Printing count of records before and after a command in a PL/SQL
Hi: I have the following PL/SQL script
declare
l_sysdate date := sysdate;
begin
INSERT INTO a_mnsnotes SELECT * from mnsnotes where TKT_NBR in (
select TKT_NBR from mnsinterface where MNS_STATUS=5 and CLOSED_DATE < (((l_sysdate-30) - to_date('01-JAN-1970','DD-MON-YYYY')) * 86400));
delete from mnsnotes Where
TKT_NBR in (select TKT_NBR from mnsinterface where MNS_STATUS=5 and CLOSED_DATE < (((l_sysdate-30) - to_date('01-JAN-1970','DD-MON-YYYY')) * 86400));
commit;
end;
/I want to assign the number of records in the two table (a_mnsnotes and mnsnotes) to two variables so I can print in one line the numberof records for both tables before and after the procedure. How do I set the output of a sql command (select count(*) from mnsnotes) to a variable within the pl/sql?
Thanks
RaviAlso I'm guessing this:
(((l_sysdate-30) - to_date('01-JAN-1970','DD-MON-YYYY')) * 86400);
is because closed_date is stored as number of seconds since 01-JAN-1970, which should be turned into a date ASAP. Never store dates as anything other than DATE datatype (or maybe TIMESTAMP in more recent versions).
It's not right, as sysdate will have a time component so if this code is run at 8am it will give different results to if it is run at 9pm. And not all months have 30 days.
Have you considered TRUNC(add_months(sysdate,-1)) instead of l_sysdate-30 ? -
Updates on a specific COLUMN is not generating a BEFORE or AFTER value ...
I have a table SCHEMA_OWNER.RX_TX table that has 182 columns. Here is the extract param file. Also on this table i have enabled ALL COLUMNS to be supplimental logged via "alter table SCHEMA_OWNER.RX_TX add supplemental log data (all) columns". The table has a PK on the "ID" column. Please note that the POS_REFUND_DATE column in the table SCHEMA_OWNER.RX_TX is 178th column.
When i execute the following UPDATE followed by a COMMIT, when the current value of POS_REFUND_DATE=NULL, i do not see TRAIL records getting created in the trail file.
SQL>Update Eps2_Kp_900001058.Rx_Tx Set Pos_Refund_Date=Pos_Refund_Date Where Tx_Number=1014524 And Nhin_Store_Id=900001058 And Id=4575035;
SQL>COMMIT;
NOTE: If POS_REFUND_DATE is NOT NULL, before the above UPDATE is executed, then TRAIL RECORDS (i.e. before and after trail records) are successfully created.
Here is param file for the EXTRACT=EXTPROD
EXTRACT EXTPROD
SETENV (ORACLE_SID = "opepsd2")
SETENV (ORACLE_HOME = "/u01/app/oradev/product/11.2.0.3/db_1")
SETENV (NLS_LANG="AMERICAN_AMERICA.WE8MSWIN1252")
USERID ogguser, PASSWORD AACAAAAAAAAAAAKAJISJVHPCJAEJKJIHWHVCXHQIWIZEUCJF, ENCRYPTKEY DEFAULT
EXTTRAIL /u02/ggoppr/trail/SP
TRANLOGOPTIONS DBLOGREADER
CACHEMGR CACHEBUFFERSIZE 64KB, CACHESIZE 2GB, CACHEDIRECTORY ./dirtmp
GETUPDATEBEFORES
NOCOMPRESSDELETES
NOCOMPRESSUPDATES
STATOPTIONS RESETREPORTSTATS
REPORT AT 00:01
REPORTROLLOVER AT 00:01
REPORTCOUNT EVERY 60 SECONDS, RATE
WARNLONGTRANS 2 HOURS
TABLE EPS2_KP_900001058.RX_TX , COLS (ID,NHIN_STORE_ID,POS_SOLD_DATE,LAST_DML_BY_CONVERSION_DATE,RETURNED_DATE,POS_REFUND_DATE,UNSELL_DATE,ADMIN_REBILLED_DATE,PARTIAL_FILL_STATUS) , TOKENS ( NHIN_STORE_ID = "900001058" );
Here are some usefull output from GGSCI:
GGSCI (szabdb32) 4> dblogin userid ogguser , password ogguser123
Successfully logged into database.
GGSCI (szabdb32) 5> info all
Program Status Group Lag Time Since Chkpt
MANAGER RUNNING
EXTRACT RUNNING EXTDEV2 00:00:00 00:00:07
Description EPS Extract
EXTRACT RUNNING EXTPROD 00:00:00 00:00:04
EXTRACT RUNNING EXTSALE 00:00:00 00:00:04
EXTRACT RUNNING EXTTEST 00:00:00 00:00:04
EXTRACT RUNNING PMPDEV2 00:00:00 00:00:02
EXTRACT RUNNING PMPPROD 00:00:00 00:00:01
EXTRACT RUNNING PMPSALE 00:00:00 00:00:05
EXTRACT RUNNING PMPTEST 00:00:00 00:00:05
EXTRACT RUNNING RPMPDEV2 00:00:00 00:00:06
Here is the DDL structure of the table object "EPS2_KP_900001058.RX_TX" (vERY LONg)
CREATE TABLE "EPS2_KP_900001058"."RX_TX"
( "ID" NUMBER(38,0) NOT NULL ENABLE,
"NHIN_STORE_ID" NUMBER(10,0) NOT NULL ENABLE,
"DELETED" VARCHAR2(1 BYTE),
"BRAND_ACQUISITION_COST" NUMBER(13,2),
"AUTO_COUNTING_SYSTEM_PRIORITY" VARCHAR2(1 BYTE),
"CHARGE" VARCHAR2(1 BYTE),
"COMPOUND_FEE" NUMBER(13,2),
"BASE_COST" NUMBER(13,2),
"COUNSELING_CHOICE" VARCHAR2(1 BYTE),
"NCPDP_DAW" VARCHAR2(1 BYTE),
"FILL_QUANTITY" NUMBER(13,4),
"BRAND_DISCOUNT" NUMBER(13,2),
"DRUG_EXPIRATION_DATE" DATE,
"FILL_DATE" DATE,
"PICKED_UP" VARCHAR2(1 BYTE),
"HOST_RETRIEVAL_DATE" DATE,
"MANUFACTURER" VARCHAR2(10 BYTE),
"SAFETY_CAP_FLAG" VARCHAR2(1 BYTE),
"PAC_MED" VARCHAR2(1 BYTE),
"REFILL_NUMBER" NUMBER(5,0),
"REPORTABLE_SALES_DATE" DATE,
"FILL_STATUS" VARCHAR2(1 BYTE),
"TAX_AMOUNT" NUMBER(13,2),
"TP_BILL" VARCHAR2(1 BYTE),
"UC_PRICE" NUMBER(13,2),
"UP_CHARGE" NUMBER(13,2),
"USUAL" VARCHAR2(1 BYTE),
"DAYS_SUPPLY" NUMBER(10,0),
"DRUG_SCHEDULE" VARCHAR2(1 BYTE),
"DAYS_SUPPLY_BASIS" VARCHAR2(1 BYTE),
"FOLLOW_UP_DATE" DATE,
"GROUP_ON_RX" VARCHAR2(3 BYTE),
"ICD9" VARCHAR2(7 BYTE),
"ICD9_TYPE" VARCHAR2(1 BYTE),
"NUM_LABELS" NUMBER(3,0),
"OWED" NUMBER(13,4),
"PRESCRIBED_QUANTITY" NUMBER(13,4),
"STOP_DATE" DATE,
"WRITTEN_DATE" DATE,
"DISPENSED_DRUG_NDC" VARCHAR2(11 BYTE),
"LANG" VARCHAR2(2 BYTE) NOT NULL ENABLE,
"SIG_PER_DAY" NUMBER(13,4),
"SIG_PER_DOSE" NUMBER(13,4),
"SIG_TEXT" VARCHAR2(515 BYTE),
"REFILL_SOURCE" NUMBER(5,0),
"TX_DELETED" VARCHAR2(1 BYTE),
"TX_NUMBER" NUMBER(12,0),
"CENTRAL_FILL_CUTOFF_DATE" DATE,
"BRAND_PRICE" NUMBER(13,2),
"GENERIC_PRICE" NUMBER(13,2),
"DRUG_DISPENSED" VARCHAR2(1 BYTE),
"POS_STATUS" VARCHAR2(1 BYTE),
"POS_INVOICE_NUMBER" NUMBER(35,0),
"CASHIER_NAME" VARCHAR2(28 BYTE),
"REGISTER_NUM" VARCHAR2(20 BYTE),
"POS_OVERRIDDEN_NET_PAID" NUMBER(13,2),
"POS_REASON_FOR_VOID" VARCHAR2(120 BYTE),
"RX_STOLEN" VARCHAR2(1 BYTE),
"POS_BARCODE_NUM" NUMBER(20,0),
"RETURNED_DATE" DATE,
"RX_CREDIT_INITIATOR" VARCHAR2(1 BYTE),
"ORIGINAL_QTY" NUMBER(13,4),
"ORIGINAL_PRICE" NUMBER(13,2),
"OLD_RX_TX_ID" NUMBER(38,0),
"NEW_RX_TX_ID" NUMBER(38,0),
"PATIENT_DISEASE_ID" NUMBER(38,0),
"PRICE_CODE_ID" NUMBER(38,0),
"TAX_ID" NUMBER(38,0),
"COMPOUND_ID" NUMBER(38,0),
"DRUG_BRAND_ID" NUMBER(38,0),
"DRUG_GENERIC_ID" NUMBER(38,0),
"REFERENCE_BRAND_ID" NUMBER(38,0),
"KEEP_SAME_DRUG" VARCHAR2(1 BYTE),
"DIFFERENT_GENERIC" VARCHAR2(1 BYTE),
"RX_SUMMARY_ID" NUMBER(38,0),
"PRESCRIBER_CLINIC_LINK_ID" NUMBER(38,0),
"SUPV_PRESCRIBER_CLINIC_LINK_ID" NUMBER(38,0),
"DRUG_COST_TYPE_ID" NUMBER(38,0),
"BASECOST_ID" NUMBER(38,0),
"REQUESTED_PRICE_TO_QTY" NUMBER(13,2),
"OVERRIDDEN_PRICE_AMOUNT" NUMBER(13,2),
"PRICE_OVERRIDE_REASON" VARCHAR2(1 BYTE),
"PRICE_OVERRIDE_NOTE_ID" NUMBER(38,0),
"GENERIC_ACQUISITION_COST" NUMBER(13,2),
"GENERIC_DISCOUNT" NUMBER(13,2),
"PROFESSIONAL_FEE" NUMBER(13,2),
"NO_SALES_TAX" VARCHAR2(1 BYTE),
"COMPETITIVE_PRICED" VARCHAR2(1 BYTE),
"USING_PERCENT_OF_BRAND" VARCHAR2(1 BYTE),
"USING_COMPOUND_PLAN_PRICING" VARCHAR2(1 BYTE),
"ALLOW_PRICE_OVERRIDE" VARCHAR2(1 BYTE),
"POS_SOLD_DATE" DATE,
"FILL_LOCATION" VARCHAR2(1 BYTE),
"NOTES" VARCHAR2(2000 BYTE),
"DRUG_IMAGE_KEY" VARCHAR2(255 BYTE),
"BRAND_MANUALLY_SELECTED" VARCHAR2(1 BYTE),
"GENERIC_MANUALLY_SELECTED" VARCHAR2(1 BYTE),
"TX_STATUS" VARCHAR2(1 BYTE),
"RETURNED_USER_ID" NUMBER(38,0),
"DE_INITIALS" VARCHAR2(3 BYTE),
"DV_INITIALS" VARCHAR2(3 BYTE),
"PV_INITIALS" VARCHAR2(3 BYTE),
"OVERRIDE_USER_ID" NUMBER(38,0),
"PARTIAL_FILL_STATUS" VARCHAR2(1 BYTE),
"PARTIAL_FILL_BILLING_TYPE" VARCHAR2(1 BYTE),
"INTENDED_QUANTITY" NUMBER(13,4),
"PATIENT_REQUESTED_PRICE" VARCHAR2(1 BYTE),
"MISSING_DATE" DATE,
"REPLACE_DATE" DATE,
"RETURN_TO_STOCK_DATE" DATE,
"RX_COM_DOWN" VARCHAR2(1 BYTE),
"RPH_NAME_OF_RECORD" VARCHAR2(60 BYTE),
"CUSTOM_SIG" VARCHAR2(1 BYTE),
"DISCOUNT_ID" NUMBER(38,0),
"PATIENT_REQUEST_BRAND_GENERIC" VARCHAR2(1 BYTE),
"WILL_CALL_PICKED_UP_DATE" DATE,
"COMPLETION_RX_TX_ID" NUMBER(38,0),
"PARTIAL_RX_TX_ID" NUMBER(38,0),
"SENT_TO_EHR" VARCHAR2(1 BYTE) DEFAULT 'N',
"DRUG_IMAGE_START_DATE" DATE,
"ADMIN_REBILLED" VARCHAR2(1 BYTE),
"SIG_CODE" VARCHAR2(20 BYTE),
"SIG_TEXT_FOREIGN_LANGUAGE" VARCHAR2(515 BYTE),
"RTRN_PRESCRIBER_CLINIC_LINK_ID" NUMBER(38,0),
"OUTSOURCE_COMPOUND" VARCHAR2(1 BYTE),
"IMPRINT_TEXT" VARCHAR2(512 BYTE),
"IMPRINT_SOURCE" VARCHAR2(36 BYTE),
"DIB_PEM_IDENTIFIER" VARCHAR2(20 BYTE),
"DIB_DATABASE_VERSION" VARCHAR2(5 BYTE),
"DIB_ISSUE_DATE" DATE,
"COST_VERIFIED" VARCHAR2(1 BYTE),
"SEND_TO_PRESCRIBER_WILDCARD" VARCHAR2(1 BYTE),
"COUNSELING_RPH_INITIALS" VARCHAR2(3 BYTE),
"STATE_REPORT_STATUS" VARCHAR2(1 BYTE),
"REQUIRE_RELATION_TO_PATIENT" VARCHAR2(1 BYTE),
"PHOTO_ID_STATE" VARCHAR2(3 BYTE),
"PHOTO_ID_TYPE" VARCHAR2(2 BYTE),
"PHOTO_ID_NUMBER" VARCHAR2(20 BYTE),
"RELATIONSHIP_TO_PATIENT" VARCHAR2(2 BYTE),
"PICKUP_FIRST_NAME" VARCHAR2(50 BYTE),
"PICKUP_LAST_NAME" VARCHAR2(50 BYTE),
"REQUIRE_PICKUP_ID_TYPE" VARCHAR2(1 BYTE),
"REQUIRE_PICKUP_ID_STATE" VARCHAR2(1 BYTE),
"REQUIRE_PICKUP_ID_NAME" VARCHAR2(1 BYTE),
"REQUIRE_PICKUP_ID_NUMBER" VARCHAR2(1 BYTE),
"REQUIRE_PICKUP_ID_EXPIRATION" VARCHAR2(1 BYTE),
"PHOTO_ID_EXPIRE_DATE" DATE,
"PATIENT_DELIVERY_NOTES_ID" NUMBER(38,0),
"CANCEL_REASON" VARCHAR2(2 BYTE),
"COUNSELING_RPH_EMPLOYEE_NUM" VARCHAR2(255 BYTE),
"RPH_COUNSEL_NOTES_ID" NUMBER(38,0),
"MEMBERSHIP_INDICATOR" VARCHAR2(1 BYTE),
"COUNSEL_REASON" VARCHAR2(2 BYTE),
"POS_VOID_REASON_CODE" VARCHAR2(10 BYTE),
"AUTHORIZING_MANAGER_NAME" VARCHAR2(255 BYTE),
"FREQUENCY_RATE" NUMBER(13,4),
"INCREMENTAL_CONV_SENT_TO_EHR" VARCHAR2(1 BYTE),
"ENTERPRISE_RX_FILL_COUNT" NUMBER(5,0),
"INTENDED_DAYS_SUPPLY" NUMBER(10,0),
"DDID_USED_BY_DRUG_SELECTION" NUMBER(10,0),
"GPI_USED_BY_DRUG_SELECTION" VARCHAR2(24 BYTE),
"NEW_DDID_AUTHORIZED_BY_EMP_NUM" VARCHAR2(255 BYTE),
"TIME_FRAME" NUMBER(2,0),
"TIME_FRAME_TYPE" NUMBER(2,0),
"LAST_DML_BY_CONVERSION_DATE" TIMESTAMP (6),
"END_OF_THERAPY_DATE" TIMESTAMP (6),
"UNSELL_DATE" TIMESTAMP (6),
"UNSELL_QUALIFIER" VARCHAR2(2 BYTE),
"ADMIN_REBILLED_DATE" TIMESTAMP (6),
"LAST_UPDATE_DATE" TIMESTAMP (6),
"TP_LAST_UPDATE_DATE" TIMESTAMP (6),
"ADMIN_REBILL_QUALIFIER" VARCHAR2(3 BYTE),
"PRIOR_RETURN_REASON_CODE" VARCHAR2(2 BYTE),
"POS_PRICE_ADJUSTMENT_CODE" VARCHAR2(2 BYTE),
"TX_SOLD_QUALIFIER" VARCHAR2(3 BYTE),
"MEDICARE_NOTICE" VARCHAR2(1 BYTE),
"POS_REFUND_REASON_CODE" VARCHAR2(10 BYTE),
"POS_REASON_FOR_REFUND" VARCHAR2(120 BYTE),
"POS_REFUND_DATE" TIMESTAMP (6),
"MEDGUIDE_TO_PRINT" VARCHAR2(1 BYTE),
"PATIENT_EDUCATION_TO_PRINT" VARCHAR2(1 BYTE),
"EXCLUDED_OTC" VARCHAR2(1 BYTE),
CONSTRAINT "RX_TX_PK" PRIMARY KEY ("ID")
USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ENABLE,
SUPPLEMENTAL LOG DATA (ALL) COLUMNS,
SUPPLEMENTAL LOG GROUP "GGS_RX_TX_78190" ("ID") ALWAYS,
CONSTRAINT "NOTES_FK1" FOREIGN KEY ("RPH_COUNSEL_NOTES_ID")
REFERENCES "EPS2_KP_900001058"."NOTES" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK1" FOREIGN KEY ("PRICE_OVERRIDE_NOTE_ID")
REFERENCES "EPS2_KP_900001058"."NOTES" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK10" FOREIGN KEY ("DISCOUNT_ID")
REFERENCES "EPS2_KP_900001058"."DISCOUNT" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK11" FOREIGN KEY ("SUPV_PRESCRIBER_CLINIC_LINK_ID")
REFERENCES "EPS2_KP_900001058"."PRESCRIBER_CLINIC_LINK" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK12" FOREIGN KEY ("PATIENT_DISEASE_ID")
REFERENCES "EPS2_KP_900001058"."PATIENT_DISEASE" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK13" FOREIGN KEY ("PRESCRIBER_CLINIC_LINK_ID")
REFERENCES "EPS2_KP_900001058"."PRESCRIBER_CLINIC_LINK" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK14" FOREIGN KEY ("RX_SUMMARY_ID")
REFERENCES "EPS2_KP_900001058"."RX_SUMMARY" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK15" FOREIGN KEY ("DRUG_GENERIC_ID")
REFERENCES "EPS2_KP_900001058"."DRUG" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK16" FOREIGN KEY ("DRUG_BRAND_ID")
REFERENCES "EPS2_KP_900001058"."DRUG" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK17" FOREIGN KEY ("COMPOUND_ID")
REFERENCES "EPS2_KP_900001058"."COMPOUND" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK18" FOREIGN KEY ("RETURNED_USER_ID")
REFERENCES "EPS2_KP_900001058"."USERS" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK2" FOREIGN KEY ("TAX_ID")
REFERENCES "EPS2_KP_900001058"."TAX" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK20" FOREIGN KEY ("DRUG_COST_TYPE_ID")
REFERENCES "EPS2_KP_900001058"."DRUG_COST_TYPE" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK21" FOREIGN KEY ("BASECOST_ID")
REFERENCES "EPS2_KP_900001058"."BASECOST" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK22" FOREIGN KEY ("COMPLETION_RX_TX_ID")
REFERENCES "EPS2_KP_900001058"."RX_TX" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK23" FOREIGN KEY ("PARTIAL_RX_TX_ID")
REFERENCES "EPS2_KP_900001058"."RX_TX" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK24" FOREIGN KEY ("RTRN_PRESCRIBER_CLINIC_LINK_ID")
REFERENCES "EPS2_KP_900001058"."PRESCRIBER_CLINIC_LINK" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK25" FOREIGN KEY ("PATIENT_DELIVERY_NOTES_ID")
REFERENCES "EPS2_KP_900001058"."NOTES" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK4" FOREIGN KEY ("PRICE_CODE_ID")
REFERENCES "EPS2_KP_900001058"."PRICE_CODE" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK5" FOREIGN KEY ("REFERENCE_BRAND_ID")
REFERENCES "EPS2_KP_900001058"."DRUG" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK6" FOREIGN KEY ("OLD_RX_TX_ID")
REFERENCES "EPS2_KP_900001058"."RX_TX" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK7" FOREIGN KEY ("NEW_RX_TX_ID")
REFERENCES "EPS2_KP_900001058"."RX_TX" ("ID") ENABLE NOVALIDATE,
CONSTRAINT "RX_TX_FK9" FOREIGN KEY ("OVERRIDE_USER_ID")
REFERENCES "EPS2_KP_900001058"."USERS" ("ID") ENABLE NOVALIDATE
) SEGMENT CREATION IMMEDIATE
PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255
NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_DATA" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX1" ON "EPS2_KP_900001058"."RX_TX" ("DISCOUNT_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX10" ON "EPS2_KP_900001058"."RX_TX" ("PRICE_OVERRIDE_NOTE_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX11" ON "EPS2_KP_900001058"."RX_TX" ("BASECOST_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX12" ON "EPS2_KP_900001058"."RX_TX" ("REFERENCE_BRAND_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX13" ON "EPS2_KP_900001058"."RX_TX" ("RX_SUMMARY_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX15" ON "EPS2_KP_900001058"."RX_TX" ("SUPV_PRESCRIBER_CLINIC_LINK_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX16" ON "EPS2_KP_900001058"."RX_TX" ("TAX_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX17" ON "EPS2_KP_900001058"."RX_TX" ("TX_NUMBER")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX18" ON "EPS2_KP_900001058"."RX_TX" ("DISPENSED_DRUG_NDC")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX19" ON "EPS2_KP_900001058"."RX_TX" ("DRUG_COST_TYPE_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX2" ON "EPS2_KP_900001058"."RX_TX" ("COMPOUND_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX20" ON "EPS2_KP_900001058"."RX_TX" ("OVERRIDE_USER_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX21" ON "EPS2_KP_900001058"."RX_TX" ("RETURNED_USER_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE UNIQUE INDEX "EPS2_KP_900001058"."RX_TX_IX22" ON "EPS2_KP_900001058"."RX_TX" (CASE "NHIN_STORE_ID" WHEN 900001058 THEN "TX_NUMBER" ELSE NULL END )
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX23" ON "EPS2_KP_900001058"."RX_TX" ("COMPLETION_RX_TX_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX24" ON "EPS2_KP_900001058"."RX_TX" ("PARTIAL_RX_TX_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX28" ON "EPS2_KP_900001058"."RX_TX" (TRUNC("REPORTABLE_SALES_DATE"))
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX29" ON "EPS2_KP_900001058"."RX_TX" ("PATIENT_DELIVERY_NOTES_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX3" ON "EPS2_KP_900001058"."RX_TX" ("DRUG_BRAND_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX30" ON "EPS2_KP_900001058"."RX_TX" ("FILL_LOCATION")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX31" ON "EPS2_KP_900001058"."RX_TX" ("FILL_DATE")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX4" ON "EPS2_KP_900001058"."RX_TX" ("DRUG_GENERIC_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX5" ON "EPS2_KP_900001058"."RX_TX" ("NEW_RX_TX_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX6" ON "EPS2_KP_900001058"."RX_TX" ("OLD_RX_TX_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX7" ON "EPS2_KP_900001058"."RX_TX" ("PATIENT_DISEASE_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX8" ON "EPS2_KP_900001058"."RX_TX" ("PRESCRIBER_CLINIC_LINK_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
CREATE INDEX "EPS2_KP_900001058"."RX_TX_IX9" ON "EPS2_KP_900001058"."RX_TX" ("PRICE_CODE_ID")
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT)
TABLESPACE "EPS2_KP_900001058_INDEX" ;
Hope to get a solution to the above issue. Why no TRAIL records are being created for this 178th column in question. If i do for example the following SQL for a different column say "RETURNED_DATE", when the value of the RETURNED_DATE=NULL before the UPDATE is fired, the TRAIL records are being generated.
SQL>Update Eps2_Kp_900001058.Rx_Tx Set RETURNED_DATE=RETURNED_DATE Where Tx_Number=1014524 And Nhin_Store_Id=900001058 And Id=4575035;
SQL>COMMIT;This looks like a trailing null issue. Sometimes Oracle decides not to write columns to the redo logs if they are null and they are the last column in the record. What version of Oracle is this? I can ask QA to look into this and see what can be done.
Thanks for the reply, but
1) The UPDATE done to a column i.e.POS_REFUND_DATE is NOT THE LAST column of the table=eps2_kp_900001058. Please see the DDL that is in this mail chain. So your observation is not right.
2) Also the TRAIL records does get generated if the following UPDATE is executed and the value of this column is NOT NULL prior to the firing of this UPDATE
Update Eps2_Kp_900001058.Rx_Tx Set Pos_Refund_Date=Pos_Refund_Date Where Tx_Number=1014524 And Nhin_Store_Id=900001058 And Id=4575035;
3) The TRAIL records does not get generted if the following UPDATE is done and the value of the column POS_REFUND_DATE is NULL before the UPDATE is fired.
Update Eps2_Kp_900001058.Rx_Tx Set Pos_Refund_Date=Pos_Refund_Date Where Tx_Number=1014524 And Nhin_Store_Id=900001058 And Id=4575035;
Very strange. Hope you can get me an answer.
Also opened an SR for this issue, the SR details are:
SR 3-7288541301 : TRAIL records are not getting generated for SELECTED UPDATE SQL statements - DB supplimental logging
4) Also the DB version is 11gR2, 11.2.0.3, 64 bit enterprise edition on AIX -
Hi,
I have a doubt on functioning of Before or After Triggers.
Here is an example of it:
I created a trigger on EMP table
create or replace trigger tri11 before insert or update or delete on emp for each row
begin
if to_char(sysdate,'dy')='fri' then
raise_application_error(-20101,'No Transactions should be happend on Friday');
end if;
end;
According to the trigger created it has to fire before any event is happening and it should not allow any insertions or updates or deletion on FRIDAY.
And that is working fine.
I changed the trigger to fire on After Insert or update or delete....
create or replace trigger tri11 after insert or update or delete on emp for each row
begin
if to_char(sysdate,'dy')='fri' then
raise_application_error(-20101,'No Transactions should be happend on Friday');
end if;
end;
Here according to this trigger it has to fire after any event is happening .....but still it is not allowing me to perform any insertions or updates or deletion on FRIDAY.
And showing me the error message as below:
SQL> update emp set sal = 11000;
update emp set sal = 11000
ERROR at line 1:
ORA-20101: No Transactions should be happend on Friday
ORA-06512: at "SCOTT.TRI11", line 3
ORA-04088: error during execution of trigger 'SCOTT.TRI11'
Can anyone please explain me the difference.
Thanks.All triggers must be fired synchronously with the triggering statement. The statement and all triggers that are fired as the result of the statement must be atomic-- they must all succeed or all fail. It doesn't matter whether it is a before or after statement trigger that throws the exception-- in either case, the entire statement will fail and thus be rolled back.
Justin -
Date - before and after precision?
Hi all,
I have two date objects and I am using the before and after methods for a decision process. I would like to know the precision of the above methods. Is the prevision at the seconds, milliseconds, or nanoseconds level?
Any help is appreciated.
Thanks
SaravananWhat does this have to do with JDBC?
java.util.Date uses milliseconds.
java.sql.Data uses nanoseconds (which isn't going to matter unless something actually sets those.) -
Oracle Alert: Access before and after update values of a table column
We have a requirement where a notification needs to be sent when 'END_DATE' attribute (column in a table X) is set, in an Oracle Applications form.
I have defined an Event based Oracle Alert which fires 'On Update' of the table X.
Could anyone please let me know as how to access the value of 'END_DATE' before and after update (i.e :new.END_DATE and :old.END_DATE) in the sql query of the alert.
The need to use the before update and after update values of the attribute 'END_DATE' is that if we add the condition END_DATE is not null, the alert is sent even if any other attrbutes are updated in the Oracle form which is not the intended behavior.
Appreciate any help.
ThanksHi
use selectionlistener for your first table then add clientlistener and serverlistener so that you will get the rows on click in back bean.
then get second table vo and and create and add row for that view object. add partial target to refresh your second table from back bean.
on click of save call commit operation. -
Theme looking different before and after previewing an advanced style
Hello,
i have a problem with a theme looking different before and after previewing an advanced style in mapbuilder Ver11_1_1_5_B110527
My style xml looks like this:
<?xml version="1.0" ?>
<AdvancedStyle>
<CollectionStyle>
<style name="color_style" shape="polygon"/>
<style name="line_style"/>
</CollectionStyle>
</AdvancedStyle>It is a combination of a color style and a line style styles:
<?xml version="1.0" standalone="yes"?>
<svg width="1in" height="1in">
<desc/>
<g class="color" style="fill:#B6D1CA">
<rect width="50" height="50"/>
</g>
</svg>
<?xml version="1.0" standalone="yes"?>
<svg width="1in" height="1in">
<desc/>
<g class="line" style="fill:#969696;stroke-width:2;stroke-linecap:BUTT">
<line class="base"/>
</g>
</svg>The styles and theme are created using insert statements, and not the mapbuilder.
When i take a look at the theme preview in mapbuilder, it will look like this: http://dl.dropbox.com/u/22117905/before_preview.PNG
Now i open up the advanced style and hit the preview button.
If i take another look at the theme preview, it will now look like this (and this is the desired output btw.): http://dl.dropbox.com/u/22117905/after_preview.PNG
Now my question is, why does the same theme look different, after previewing the advanced style?
I tried clearing the cached geometries and metadata cache of mapviewer, but that didn't help.
Apart from previewing every style, what can i do to make sure that the themes are styled correctly?
Thanks for help in advance,
DirkHello Joao,
i just found the error. It is in my pl/sql package where i create the styles.
Mapbuilder showed the staly as in my first post, but that i created looks like this
<?xml version="1.0" ?>
<AdvancedStyle>
<CollectionStyle>
<style name="color_style" shape="polygon"/>
<style name="line_style" shape="all"/>
</CollectionStyle>
</AdvancedStyle>Notice the "shape=all" attribute in line_style. Apperently Mapbuilder doesn't like it, if i set this in the style. After previewing or saving the style in mapbuilder, the sttribute is removed and the style is correct.
I now edited my package and rerun it, and now the themes are displayed correctly.
Regards,
Dirk -
Counting values before and after an interval
I posted this awhile back but I'm back to trying to solve the problem (didn't solve it), so apologies if that is bad etiquette! This forum has been so helpful though I thought I would try again:
design/methodology question
The short of it is I have a table with calls that happened, all have a start and end time.
I want to take 1 min intervals over a given hour (say, 12-1pm) and (the part I need help with) count all calls that happened before and after that interval.
That is to say, all calls that were 'active' during that interval (consider if I call started at 11:59 am and ended at 12:05) would need to be counted for the 12:00, 12:01, 12:02, 12:03, 12:04, and 12:05 intervals.
So what I'm trying to construct is an SQL query that uses a 'variable' in this case (I think).
That is, so I can saw 'where start_time < min_interval' and where 'end_time is > min_interval' and count those records to my total.
But I'm at a loss on how to pull this off!
Thoughts?If a call began at 15:01:01 and ended at 15:01:59, was it active at 15:01? Was it active at 15:02? Both? Neither?Is only active at 15:01.
Do you need 4 separate numbers, or do you need 1 number, which is the total of these 4?I need 1 number which is the math formula (using the number above)
1 + 2 - 3 + 4
Oracle version is 10.2.0.4.0
I will work on learning the CREATE TABLE and INSERT statements, as well as, the WITH one.
Is the point of submitting those to understand the data set being worked with?
Here is my attempt...
Consider the following:
WITH my_call AS
SELECT 1 AS call_id , to_date('10-may-2011 12:00:17'
, 'dd-mon-yyyy hh24:mi:ss'
) AS start_time , to_date('10-may-2011 12:01:23'
, 'dd-mon-yyyy hh24:mi:ss'
) AS end_time FROM dual UNION ALL
SELECT 2 , to_date('10-may-2011 12:00:45'
, 'dd-mon-yyyy hh24:mi:ss'
) , to_date('10-may-2011 12:03:55'
, 'dd-mon-yyyy hh24:mi:ss'
) FROM dual UNION ALL
SELECT 3 , to_date('10-may-2011 12:01:01'
, 'dd-mon-yyyy hh24:mi:ss'
) , to_date('10-may-2011 12:01:59'
, 'dd-mon-yyyy hh24:mi:ss'
) FROM dual UNION ALL
SELECT 4 , to_date('10-may-2011 12:01:45'
, 'dd-mon-yyyy hh24:mi:ss'
) , to_date('10-may-2011 12:04:43'
, 'dd-mon-yyyy hh24:mi:ss'
) FROM dual UNION ALL
SELECT 5 , to_date('10-may-2011 12:02:33'
, 'dd-mon-yyyy hh24:mi:ss'
) , to_date('10-may-2011 12:08:05'
, 'dd-mon-yyyy hh24:mi:ss'
) FROM dual UNION ALL
SELECT 6 , to_date('10-may-2011 12:02:35'
, 'dd-mon-yyyy hh24:mi:ss'
) , to_date('10-may-2011 12:04:56'
, 'dd-mon-yyyy hh24:mi:ss'
) FROM dual UNION ALL
SELECT 7 , to_date('10-may-2011 12:03:02'
, 'dd-mon-yyyy hh24:mi:ss'
) , to_date('10-may-2011 12:05:13'
, 'dd-mon-yyyy hh24:mi:ss'
) FROM dual UNION ALL
SELECT 8 , to_date('10-may-2011 12:03:41'
, 'dd-mon-yyyy hh24:mi:ss'
) , to_date('10-may-2011 12:04:37'
, 'dd-mon-yyyy hh24:mi:ss'
) FROM dual
)then, to solve #1 (calls that started in each minute):
select
to_char(new_time(trunc(start_time, 'hh24') + (trunc(to_char(start_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi') as "Start Time",
count(*) as "Start Time Count"
from
my_call
group by
to_char(new_time(trunc(start_time, 'hh24') + (trunc(to_char(start_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi')
order by
to_char(new_time(trunc(start_time, 'hh24') + (trunc(to_char(start_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi');would yield the following output (consider I am converting to GMT in this example):
07:00 2
07:01 2
07:02 2
07:03 2To solve 2, calls with end_time, I do the following:
select
to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi') as "End Time",
count(*) as "End Time Count"
from
my_call
GROUP BY to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi')
order by
to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi');which gives us:
07:01 2
07:03 1
07:04 3
07:05 1
07:08 1# 3 (calls that started and ended in the same minute) is:
select
to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi') as "End Time",
count(*) as "End Time Count"
from
my_call
where
to_char(new_time(trunc(start_time, 'hh24') + (trunc(to_char(start_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi') = to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi')
GROUP BY to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi')
order by
to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi');which gives us:
07:01 1Now, given the small data set (which, as a side note, I can see a little, now, why the WITH statement here is useful and important!) we know the final output should be
(EXPECTED RESULT WHEN WE ARE DONE):
07:00 2
07:01 4
07:02 4
07:03 6
07:04 5
07:05 2
07:06 1
07:07 1
07:08 1So what I am posting this forum is help in calculating #4 - calls that had a start time (trunc'd to the minute) before the minute interval and an end_time after.
Something like this:
select
to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi') as "End Time",
count(*) as "End Time Count"
from
my_call
where
to_char(new_time(trunc(start_time, 'hh24') + (trunc(to_char(start_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi') < minute_interval and
to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi') > minute_interval
GROUP BY to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi')
order by
to_char(new_time(trunc(end_time, 'hh24') + (trunc(to_char(end_time, 'mi')/1)*1)/24/60, 'GMT', 'CDT'), 'hh24:mi');where the expected output would be:
07:00 0
07:01 1
07:02 2
07:03 3
07:04 2
07:05 1
07:06 1
07:07 1
07:08 0thoughts on accomplishing this? -
How to get prepared string before sending to sql
Hi
I want the prepared string before sending to Sql (After substitution and setXXX), is it possible to do this? if yes, how ?
PreparedStatement ps = cn.prepareStatement("select * from table1 where name= ''?'' ");
ps.setString(1, "mytable")
<-- I want the prepared string before sending to Sql (After substitution and setXXX) -->
ResultSet rs = ps.executeQuery();
Thanks
AliAs I mentioned, I want Sql Text before execution
n (getting resultSet), and after whole of setXXXs,No way, I believe.
I have tried in many ways, let me put down my work.
String query = "'Select * from dept where deptno=?'";
System.out.println("Before : "+query);
PreparedStatement ps = con.prepareStatement("select "+query+",? from Dual");
ps.setInt(1,50);
ResultSet rs = ps.executeQuery();
if(rs.next()) {
System.out.println("After : "+rs.getString(1));
ps.close();
con.close();I have tried in these lines, to capture the sql query, but it is failing at execution and the exception is 'bind variable not found'. So, I think you need to implement your own class to construct this query. Getting the details from DatabaseMetadata to see how the driver's setter methods works and you can use the same logic in your custom class.
Good luck. -
Why there is implicit commit before and after executing DDL Statements
Hi Guys,
Please let me know why there is implicit commit before and after executing DDL Statements ?
Regards,
sushmitaHelyos wrote:
This is because Oracle has design it like this.Come on Helyos, that's a bit of a weak answer. :)
The reason is that it makes no sense to update the structure of the database whilst there is outstanding data updates that have not been committed.
Imagine having a column that is VARCHAR2(50) that currently only has data that is up to 20 characters in size.
Someone (person A) decides that it would make sense to alter the table and reduce the size of the column to varchar2(20) instead.
Before they do that, someone else (person B) has inserted data that is 30 characters in size, but not yet committed it.
As far as person B is concerned that insert statement has been successful as they received no error, and they are continuing on with their process until they reach a suitable point to commit.
Person A then attempts to alter the database to make it varchar2(20).
If the database allowed that to happen then the column would be varchar2(20) and the uncommitted data would no longer fit, even though the insert was successful. When is Person B going to find out about this? It would be wrong to tell them when they try and commit, because all their transactions were successful, so why should a commit fail.
In this case, because it's two different people, then the database will recognise there is uncommitted transactions on that table and not let person B alter it.
If it was just one person doing both things in the same session, then the data would be automatically committed, the alter statement executed and the person informed that they can't alter the database because there is (now) data exceeding the size they want to set it to.
It makes perfect sense to have the database in a data consistent state before any alterations are made to it, hence why a commit is issued beforehand.
Here's something I wrote the other day on the subject...
DDL's issue a commit before carrying out the actual action
As long as the DDL is syntactically ok (i.e. the parser is happy with it) then the commit is issued, even if the actual DDL cannot be executed for another reason.
Example...
We have a table with some data in it...
SQL> create table xtest as select rownum rn from dual;
Table created.
SQL> select * from xtest;
RN
1We then delete the data but don't commit (demonstrated by the fact we can roll it back)
SQL> delete from xtest;
1 row deleted.
SQL> select * from xtest;
no rows selected
SQL> rollback;
Rollback complete.
SQL> select * from xtest;
RN
1
SQL> delete from xtest;
1 row deleted.
SQL> select * from xtest;
no rows selectedSo now our data is deleted, but not committed, what if we issue a DDL that is syntactically incorrect...
SQL> alter tab xtest blah;
alter tab xtest blah
ERROR at line 1:
ORA-00940: invalid ALTER command
SQL> rollback;
Rollback complete.
SQL> select * from xtest;
RN
1... the data can still be rolled back. This is because the parser was not happy with the syntax of the DDL statement.
So let's delete the data again, without committing it, and issue a DDL that is syntactically correct, but cannot execute for another reason (i.e. the database object it refers to doesn't exist)...
SQL> delete from xtest;
1 row deleted.
SQL> select * from xtest;
no rows selected
SQL> truncate table bob;
truncate table bob
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> rollback;
Rollback complete.
SQL> select * from xtest;
no rows selectedSo, there we have it. Just because the statement was syntactically correct, the deletion of the data was committed, even though the DDL couldn't be performed.
This makes sense really, because if we are planning on altering the definition of the database where the data is stored, it can only really take place if the database is in a state where the data is where it should be rather than being in limbo. For example, imagine the confusion if you updated some data on a column and then altered that columns datatype to be a different size e.g. reducing a varchar2 column from 50 character down to 20 characters. If you had data that you'd just updated to larger than 20 characters whereas previously there wasn't, then the alter table command would not know about it, would alter the column size and then the data wouldn't be valid to fit whereas the update statement at the time didn't fail.
Example...
We have a table that only allows 20 characters in a column. If we try and insert more into that column we get an error for our insert statement as expected...
SQL> create table xtest (x varchar2(20));
Table created.
SQL> insert into xtest values ('012345678901234567890123456789');
insert into xtest values ('012345678901234567890123456789')
ERROR at line 1:
ORA-12899: value too large for column "SCOTT"."XTEST"."X" (actual: 30, maximum: 20)Now if our table allowed more characters our insert statement is successful. As far as our "application" goes we believe, nay, we have been told by the database, we have successfully inserted our data...
SQL> alter table xtest modify (x varchar2(50));
Table altered.
SQL> insert into xtest values ('012345678901234567890123456789');
1 row created.Now if we tried to alter our database column back to 20 characters and it didn't automatically commit the data beforehand then it would be happy to alter the column, but then when the data was committed it wouldn't fit. However the database has already told us that the data was inserted, so it can't go back on that now.
Instead we can see that the data is committed first because the alter command returns an error telling us that the data in the table is too big, and also we cannot rollback the insert after the attempted alter statement...
SQL> alter table xtest modify (x varchar2(20));
alter table xtest modify (x varchar2(20))
ERROR at line 1:
ORA-01441: cannot decrease column length because some value is too big
SQL> rollback;
Rollback complete.
SQL> select * from xtest;
X
012345678901234567890123456789
SQL>Obviously, because a commit statement is for the existing session, if we had tried to alter the table column from another session we would have got
SQL> alter table xtest modify (x varchar2(20));
alter table xtest modify (x varchar2(20))
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified
SQL>... which is basically saying that we can't alter the table because someone else is using it and they haven't committed their data yet.
Once the other session has committed the data we get the expected error...
ORA-01441: cannot decrease column length because some value is too bigHope that explains it -
I am trying to delete pages I have crated in numbers, but can only see them in print preview. Without print preview I do not see them. How can I delete these pages, but keep others before and after?
Hi Crushed,
Numbers doesn't have pages. It has a canvas that holds objects such as tables and charts.
Drag the objects from the bottom of the canvas onto the white space above. That will reduce the number of "pages" (sheets of paper) that will print.
Regards,
Ian. -
my ipod touch is stuck on the apple logo and after a while a white screen comes up and it restarts and the same thing all over agan. this happened to me before and after a while it turns on but why does it keep on doing this?
Try connecting the iPod Touch to your computer and restore it. http://support.apple.com/kb/HT1414
-
New to FCPX on a project this weekend. I have gotten reasonably comfortable with the basic features but one thing that I CANNOT figure out, is how (what used to be) selecting a track in the timeline to activate it to apply a transition. I need to select a video clip which stands alone in the stack which is positioned above the primary track and add a blend transition before and after the clip. I have set the opacity to blend with the images in the primary track below but the beginning and end of the clip in the second stack do not fall at the transition points in the lower track which should not matter anyway. I can’t find it in Help or the third party tutorials that I purchased and completed. Thanks for your help!
Tom gave you the answer. As a follow-on you can then use the Cross Dissolve transition on your newly converted connected clip. This transition will allow it to dissolve smoothly into the video below it. Note that the Fade to Black transition will take both that clip and the video below it to black which would probably be undesirable. Use Cross Dissolve instead. Best wishes.
stephen
Maybe you are looking for
-
Hi, we have problems in our xi system (PI 7.0, SPS10). The adapter engine can only be monitored in the communication channel monitoring, available in the runtime workbench! There sometimes errors disappear. At the moment these errors accumulate! Is i
-
Billing Document Function Module
Is there any function module to find out Billing Document is of which transaction type i.e. whether it is a Sales order Billing Document or it is a Service Order Billing Document or is an UBB Contract Billing Document.
-
Default plant in IW28/IH08/IW38
HI I want to make maintenance plant default based on users as I have multiple maintenance plant.Users do want to use variant concept.Also I have tried by assigning parameter id of plant to the users.But it is not being reflected. Can anyone please su
-
Question regarding bulk binding
Gurus, How does oracle try to differentiate whether the query should use the concept of bulk binding and a normal query ? Is the key word FOR ALL makes the difference ? Or is there any other difference ?? Please help Regards
-
PMB portable / iPhoto in OS 10.8 (Mountain Lion)
I upgraded my System last week to Mountain Lion. The problem now is that I can not download videos/pictures from my camcorder to iMovie or iPhoto any more due to breakdown of iPhoto and PMB Portable programs during start up after connecting the camco