The XLA API retrieves read operations (Select statements)?
Hi allFirstly, I'm writing a request for implementation of the scheme of replication on databases TimesTen installed on servers that are distributed over several nodes, the application uses the API of XLA for monitors & retrieves changes apply on database TimesTen to a node, then propagates the changes to other nodes.
The application must also propagate the transaction to read for some cases. If the XLA API doesn't get read operations? OTHERWISE, there are solutions to this situation?
Thanks & BR
Maher
Software engineer
No, XLA doesn't read operations. XLA is an API 'notification of change '. TimesTen has not any functgionality to allow you to 'hang' selects performed by another connection, sorry.
Chris
Tags: Database
Similar Questions
-
Put the name of partition in a SELECT statement
Hello
I'm trying to do something like that.
SELECT u.id FROM user PARTITION (SELECT partition_name FROM dba_tab_partitions WHERE table_name = 'users') u u.active = 1 WHERE
The problem is that you cannot have a select in there to retrieve the name of the partition. Is there a way I can do this in a single SELECT statement?
Thanks in advanceObject name cannot be passed to a SQL dynamically. You need to know the name of the object during the compilation of a SQL. If you want to make it dynamic, then use dynamic SQL using EXECUTE IMMEDIATE or DBMS_SQL.
-
Get the types of columns in a select statement
Hello
Is there a way to get the types of columns that results in a select statement?
For example to force an analysis on this topic and then look for the types of columns resulting in the view v$?
Best regards
Klaus Mogensen
declare c number; d number; col_cnt integer; rec_tab dbms_sql.desc_tab; col_num number; begin c := dbms_sql.open_cursor; dbms_sql.parse(c, 'select dummy, 33 x, sysdate now from dual', dbms_sql.native); dbms_sql.describe_columns(c, col_cnt, rec_tab); col_num := rec_tab.first; while col_num is not null loop dbms_output.put_line( rec_tab(col_num).col_name || ' ' || case rec_tab(col_num).col_type when 1 then 'varchar2' when 2 then 'number' when 12 then 'date' else '???? ' || rec_tab(col_num).col_type end ); col_num := rec_tab.next(col_num); end loop; dbms_sql.close_cursor(c); end; / DUMMY varchar2 X number NOW date
-
What is the recommended API for reading/analysis of XML in Java files?
Hello, everyone!
In my application, I have to read a XML file. I think that Java has several APIs to parse XML files and as I am new to this, I would like to know from you what is the recommended Java for this API.
Thank you.
MarcosUnless you plan to edit nodes and I would recommend that you use a Sax parser, which is a lot less hunger of memory as a DOM parser. The DOM parser to read the entire document in memory for the manipulation of the user.
If you are looking only to read the document and extract specific values then a DOM parser would be an exaggeration. If you are planning leave the document unchanged then a SAX parser is the way to go - a little more complex to write but worth the extra as it will be faster and more scalable. -
Use of the TABLE OF... in select statements
Hello
I need to set up a list of objects that require multiple controls and operations in an anonymous pl/sql block. I've created a type that is a table of varchar2 (sys.user_objects.object_name%TYPE).
After a search on the web, I can't understand how to integrate or use this type of table variables.
Here is my code:
It does not work, error are:DECLARE TYPE list_of_objects_t IS TABLE OF sys.user_objects.object_name%TYPE; needed_objects list_of_objects_t := list_of_objects_t('OBJ1','OBJ2',...); BEGIN FOR c1_rec IN ( SELECT * FROM TABLE ( needed_objects ) ) LOOP DBMS_OUTPUT.PUT_LINE('Ceci est un test'); END LOOP; END; /
PLS-00642 and ORA-22905
How can I make it work?
Thank you
BrunoYou must create a SQL type.
CREATE OR REPLACE TYPE LIST_OF_OBJECTS_T AS TABLE OF VARCHAR2(30);
Example:
SQL> CREATE OR REPLACE TYPE LIST_OF_OBJECTS_T AS TABLE OF VARCHAR2(30); 2 / Type created. SQL> DECLARE 2 needed_objects list_of_objects_t := list_of_objects_t('OBJ1','OBJ2'); 3 BEGIN 4 FOR c1_rec IN ( 5 SELECT * 6 FROM TABLE ( 7 needed_objects 8 ) 9 ) 10 LOOP 11 DBMS_OUTPUT.PUT_LINE('Ceci est un test'); 12 END LOOP; 13 END; 14 / Ceci est un test Ceci est un test PL/SQL procedure successfully completed.
SQL is not aware of your PL/SQL type when you try to run the statement.
Published by: Centinul on April 19, 2010 12:13
-
Need help on the use of Partition for a SELECT statement
-Hello everyone,
-This my request. I'm a junior developer of the APEX.
-database version is 11g version 4.0 apex
- and the results areDEFINE startmonth = "Aug 2012"; DEFINE endmonth = "Oct 2012"; WITH all_months AS ( SELECT ADD_MONTHS(to_date('&startmonth','MON YYYY'), ROWNUM-1) AS which_month , ADD_MONTHS(to_date('&startmonth','MON YYYY'), ROWNUM ) AS next_month from all_objects where rownum <= months_between(to_date('&endmonth','MON YYYY'), add_months(to_date('&startmonth','MON YYYY'), -1)) ) , lt_event_type_a AS ( select event_type, active, e_id from lt_event_type where active = 1 ) , engagement_event_a as (SELECT * FROM engagement_event where active =1 ) select lt_ev.event_type,TO_CHAR (am.which_month, 'Mon YYYY') AS month, count(ce.engagement_id) as monthly_events_per_event_type from lt_event_type_a lt_ev left join engagement_event_a ev on lt_ev.event_type = ev.event_type left join court_engagement ce on ev.e_eng_id = ce.engagement_id and ce.court_name like '%' --will be filtered with a court_name parameter right join all_months am on ce.date_joined_court <= LAST_DAY(am.which_month) and (ce.date_terminated is null or ce.date_terminated > LAST_DAY(am.which_month) ) group by rollup(lt_ev.event_type, am.which_month) order by lt_ev.event_type, am.which_month ;
- but the condition is that I list all types of event in the search listEVENT_TYPE MONTH MONTHLY_EVENTS_PER_EVENT_TYPE -------------------------------------------------- ----------------- ----------------------------- Absent without leave Sep 2012 1 Absent without leave Oct 2012 1 Absent without leave 2 Court Appearance Sep 2012 2 Court Appearance Oct 2012 3 Court Appearance 5 Incentive granted Aug 2012 1 Incentive granted Sep 2012 2 Incentive granted Oct 2012 1 Incentive granted 4 Judicial direction Oct 2012 1 Judicial direction 1 Police report Sep 2012 2 Police report Oct 2012 2 Police report 4 Positive test Sep 2012 1 Positive test Oct 2012 1 Positive test 2 Sanction imposed Aug 2012 1 Sanction imposed Sep 2012 1 Sanction imposed Oct 2012 1 Sanction imposed 3 21 23 rows selected
-with a total number of events by event type for each month in a number of calendar months (user will select months like August 2012 or a range of month August 2012 - October 2012)
-the query above just list all the events (see table engagement_event) that have the date_join_court and date_terminated meets the required conditions.
-I wonder, is it possible to enumerate all types of event, then monthly for each event type with the total as
-I tried to use PARTTTION, but still, it does not produce the correct result,EVENT_TYPE MONTH MONTHLY_EVENTS_PER_EVENT_TYPE -------------------------------------------------- ----------------- ----------------------------- A very long long name Aug 2012 0 A very long long name Sep 2012 0 A very long long name Oct 2012 0 A very long long name Total 0 Absent without leave Aug 2012 0 Absent without leave Sep 2012 1 Absent without leave Oct 2012 1 Absent without leave Total 2 Court Appearance Aug 2012 0 Court Appearance Sep 2012 2 Court Appearance Oct 2012 3 Court Appearance Total 5 Incentive granted Aug 2012 1 Incentive granted Sep 2012 2 Incentive granted Oct 2012 1 ......
-Here's a version shortened the tables related to the query
-Thank you very much in advance.
-Thanks for reading this.--create lookup table for event type CREATE TABLE "LT_EVENT_TYPE" ("E_ID" NUMBER, "EVENT_TYPE" VARCHAR2(50 BYTE), "DATE_CREATED" DATE, "ACTIVE" NUMBER(2,0) DEFAULT 1 ) --create table court_engagement CREATE TABLE "COURT_ENGAGEMENT" ( "ENGAGEMENT_ID" NUMBER, "COURT_NAME" VARCHAR2(50 BYTE), "DATE_REFERRED" DATE, "DETERMINATION_HEARING_DATE" DATE, "DATE_JOINED_COURT" DATE, "DATE_TERMINATED" DATE, "TERMINATION_TYPE" VARCHAR2(50 BYTE), "DATE_CREATED" DATE, "ACTIVE" NUMBER(2,0) DEFAULT 1, "DEFENDANT_ID" NUMBER ) --create table engagement_event CREATE TABLE "ENGAGEMENT_EVENT" ( "EVENT_ID" NUMBER, "E_ENG_ID" NUMBER, "EVENT_TYPE" VARCHAR2(50 BYTE), "START_DATE" DATE, "END_DATE" DATE, "RELATED_SERVICE_ID" NUMBER, "DATE_CREATED" DATE, "ACTIVE" NUMBER(2,0) ) ------- Insert into LT_EVENT_TYPE (E_ID,EVENT_TYPE,DATE_CREATED,ACTIVE) values (9,'A very long long name',to_date('02/11/12','DD/MM/RR'),0); Insert into LT_EVENT_TYPE (E_ID,EVENT_TYPE,DATE_CREATED,ACTIVE) values (6,'Excellent performance',to_date('27/09/12','DD/MM/RR'),1); Insert into LT_EVENT_TYPE (E_ID,EVENT_TYPE,DATE_CREATED,ACTIVE) values (7,'Sanction imposed',to_date('27/09/12','DD/MM/RR'),1); Insert into LT_EVENT_TYPE (E_ID,EVENT_TYPE,DATE_CREATED,ACTIVE) values (8,'Incentive granted',to_date('27/09/12','DD/MM/RR'),1); Insert into LT_EVENT_TYPE (E_ID,EVENT_TYPE,DATE_CREATED,ACTIVE) values (2,'Police report',to_date('25/09/12','DD/MM/RR'),1); Insert into LT_EVENT_TYPE (E_ID,EVENT_TYPE,DATE_CREATED,ACTIVE) values (1,'Court Appearance',to_date('25/09/12','DD/MM/RR'),1); Insert into LT_EVENT_TYPE (E_ID,EVENT_TYPE,DATE_CREATED,ACTIVE) values (3,'Judicial direction',to_date('25/09/12','DD/MM/RR'),1); Insert into LT_EVENT_TYPE (E_ID,EVENT_TYPE,DATE_CREATED,ACTIVE) values (4,'Positive test',to_date('25/09/12','DD/MM/RR'),1); Insert into LT_EVENT_TYPE (E_ID,EVENT_TYPE,DATE_CREATED,ACTIVE) values (5,'Absent without leave',to_date('27/09/12','DD/MM/RR'),1); ---------- REM INSERTING into COURT_ENGAGEMENT Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (13,'BBB',null,null,to_date('01/09/12','DD/MM/RR'),to_date('14/09/12','DD/MM/RR'),'Graduated',to_date('03/10/12','DD/MM/RR'),1,4); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (16,'BBB',null,null,to_date('15/09/12','DD/MM/RR'),to_date('07/11/12','DD/MM/RR'),'Did not Graduate',to_date('04/10/12','DD/MM/RR'),1,4); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (20,'AAA',null,null,to_date('07/10/12','DD/MM/RR'),null,'Did not Graduate',to_date('08/10/12','DD/MM/RR'),1,10); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (30,'BBB',null,null,to_date('04/09/12','DD/MM/RR'),null,null,to_date('05/11/12','DD/MM/RR'),1,19); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (21,'AAA',null,null,to_date('07/10/12','DD/MM/RR'),null,null,to_date('10/10/12','DD/MM/RR'),1,11); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (15,'AAA',null,null,to_date('02/10/12','DD/MM/RR'),null,null,to_date('03/10/12','DD/MM/RR'),1,3); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (23,'AAA',null,to_date('30/09/12','DD/MM/RR'),to_date('29/09/12','DD/MM/RR'),null,null,to_date('15/10/12','DD/MM/RR'),1,8); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (25,'AAA',null,to_date('10/10/12','DD/MM/RR'),to_date('20/09/12','DD/MM/RR'),null,null,to_date('18/10/12','DD/MM/RR'),1,15); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (27,'AAA',null,to_date('11/09/12','DD/MM/RR'),to_date('19/07/12','DD/MM/RR'),null,null,to_date('23/10/12','DD/MM/RR'),1,16); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (2,'BBB',to_date('01/10/12','DD/MM/RR'),to_date('01/10/12','DD/MM/RR'),to_date('29/09/12','DD/MM/RR'),null,'Did not Graduate',to_date('27/09/12','DD/MM/RR'),1,2); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (28,'AAA',null,to_date('03/10/12','DD/MM/RR'),to_date('01/10/12','DD/MM/RR'),null,null,to_date('24/10/12','DD/MM/RR'),1,17); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (17,'AAA',null,null,to_date('08/10/12','DD/MM/RR'),to_date('11/10/12','DD/MM/RR'),'Did not Graduate',to_date('04/10/12','DD/MM/RR'),1,6); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (18,'AAA',null,null,to_date('03/09/12','DD/MM/RR'),to_date('16/10/12','DD/MM/RR'),'Graduated',to_date('05/10/12','DD/MM/RR'),1,7); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (19,'BBB',null,null,to_date('01/10/12','DD/MM/RR'),to_date('09/10/12','DD/MM/RR'),'Graduated',to_date('05/10/12','DD/MM/RR'),1,9); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (22,'AAA',null,null,null,null,null,to_date('11/10/12','DD/MM/RR'),1,12); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (24,'AAA',to_date('08/10/12','DD/MM/RR'),to_date('01/10/12','DD/MM/RR'),to_date('04/10/11','DD/MM/RR'),null,'GangNam Style',to_date('17/10/12','DD/MM/RR'),1,14); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (26,'BBB',null,to_date('17/10/12','DD/MM/RR'),to_date('16/10/12','DD/MM/RR'),null,null,to_date('18/10/12','DD/MM/RR'),1,7); Insert into COURT_ENGAGEMENT (ENGAGEMENT_ID,COURT_NAME,DATE_REFERRED,DETERMINATION_HEARING_DATE,DATE_JOINED_COURT,DATE_TERMINATED,TERMINATION_TYPE,DATE_CREATED,ACTIVE,DEFENDANT_ID) values (29,'AAA',null,null,to_date('20/09/12','DD/MM/RR'),null,'GangNam Style',to_date('30/10/12','DD/MM/RR'),1,18); --------------- REM INSERTING into ENGAGEMENT_EVENT Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (8,18,'Incentive granted',to_date('01/10/12','DD/MM/RR'),null,null,to_date('05/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (21,2,'Police report',to_date('20/09/12','DD/MM/RR'),to_date('02/10/12','DD/MM/RR'),null,to_date('24/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (7,2,'Court Appearance',to_date('02/10/12','DD/MM/RR'),to_date('16/10/12','DD/MM/RR'),12,to_date('03/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (11,19,'Court Appearance',to_date('02/10/12','DD/MM/RR'),null,null,to_date('05/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (13,21,'Court Appearance',to_date('01/10/12','DD/MM/RR'),to_date('11/10/12','DD/MM/RR'),null,to_date('10/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (18,24,'Incentive granted',to_date('01/10/12','DD/MM/RR'),to_date('15/10/12','DD/MM/RR'),null,to_date('17/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (20,2,'Police report',to_date('16/09/12','DD/MM/RR'),to_date('18/09/12','DD/MM/RR'),10,to_date('23/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (24,17,'Court Appearance',to_date('16/10/12','DD/MM/RR'),null,null,to_date('25/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (26,30,'Judicial direction',to_date('01/10/12','DD/MM/RR'),null,null,to_date('06/11/12','DD/MM/RR'),0); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (9,2,'Court Appearance',to_date('01/09/12','DD/MM/RR'),to_date('15/09/12','DD/MM/RR'),10,to_date('05/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (12,20,'Judicial direction',to_date('07/10/12','DD/MM/RR'),null,null,to_date('08/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (17,24,'Sanction imposed',to_date('16/10/12','DD/MM/RR'),to_date('31/10/12','DD/MM/RR'),null,to_date('17/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (23,13,'Court Appearance',to_date('01/10/12','DD/MM/RR'),null,34,to_date('24/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (5,2,'Positive test',to_date('01/10/12','DD/MM/RR'),to_date('10/10/12','DD/MM/RR'),1,to_date('02/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (10,19,'Judicial direction',to_date('01/10/12','DD/MM/RR'),null,null,to_date('05/10/12','DD/MM/RR'),1); Insert into ENGAGEMENT_EVENT (EVENT_ID,E_ENG_ID,EVENT_TYPE,START_DATE,END_DATE,RELATED_SERVICE_ID,DATE_CREATED,ACTIVE) values (19,25,'Absent without leave',to_date('18/10/12','DD/MM/RR'),null,null,to_date('18/10/12','DD/MM/RR'),1);
AnnPlease give sample data and expected results.
Hope below is what you'd expect - yet, I would like to ask a clarification - you have a filter 'where active = 1.
And yet, you want these types in the output. I commented on this to my query filter.
You can change accordinglyWITH all_months AS ( SELECT ADD_MONTHS(to_date('&startmonth','MON YYYY'), ROWNUM-1) AS which_month , ADD_MONTHS(to_date('&startmonth','MON YYYY'), ROWNUM ) AS next_month from all_objects where rownum <= months_between(to_date('&endmonth','MON YYYY'), add_months(to_date('&startmonth','MON YYYY'), -1)) ) , lt_event_type_a AS ( select event_type, which_month,next_month from lt_event_type, all_months --where active = 1 ) , engagement_event_a as (SELECT * FROM engagement_event where active =1 ) select lt_ev.event_type,TO_CHAR (lt_ev.which_month, 'Mon YYYY') AS month, count(ce.engagement_id) as monthly_events_per_event_type from engagement_event_a ev left outer join court_engagement ce on ( ev.e_eng_id = ce.engagement_id and ce.court_name like '%' ) right outer join lt_event_type_a lt_ev on (ce.date_joined_court <= LAST_DAY(lt_ev.which_month) and (ce.date_terminated is null or ce.date_terminated > LAST_DAY(lt_ev.which_month) ) and lt_ev.event_type = ev.event_type ) group by rollup(lt_ev.event_type, lt_ev.which_month) order by lt_ev.event_type, lt_ev.which_month ; EVENT_TYPE MONTH MONTHLY_EVENTS_PER_EVENT_TYPE -------------------------------------------------- -------- ----------------------------- A very long long name Aug 2012 0 A very long long name Sep 2012 0 A very long long name Oct 2012 0 A very long long name 0 Absent without leave Aug 2012 0 Absent without leave Sep 2012 1 Absent without leave Oct 2012 1 Absent without leave 2 Court Appearance Aug 2012 0 Court Appearance Sep 2012 2 Court Appearance Oct 2012 3 Court Appearance 5 Excellent performance Aug 2012 0 Excellent performance Sep 2012 0 Excellent performance Oct 2012 0 Excellent performance 0 Incentive granted Aug 2012 1 Incentive granted Sep 2012 2 Incentive granted Oct 2012 1 Incentive granted 4 Judicial direction Aug 2012 0 Judicial direction Sep 2012 0 Judicial direction Oct 2012 1 Judicial direction 1 Police report Aug 2012 0 Police report Sep 2012 2 Police report Oct 2012 2 Police report 4 Positive test Aug 2012 0 Positive test Sep 2012 1 Positive test Oct 2012 1 Positive test 2 Sanction imposed Aug 2012 1 Sanction imposed Sep 2012 1 Sanction imposed Oct 2012 1 Sanction imposed 3 21 37 rows selected
-
How to get the name of the adapter file file (read operation)
Hi all
I like to read files from the local site, I gave the filename property in the jca file = *. * (who reads all the files) and now I want to read the name of the incoming within bpel file and I want to copy the file name in a variable. Is this possible?Yes, its possible.
In your business, set below property in its properties tab:Before this make sure you create a variable of type string "filename".
Whatever your file adapter reads, his name will be stored in this variable.I hope this helps.
Kind regards
Karan
http://learn-oraclesoa.blogspot.com/ -
TimesTen create a lock for a select statement through sqldev
What ttisql use connect to TimesTen Release 7.0.6.15.0 to autocommit = 1, there is no lock for a select statement.
but when I use sql developer (driver is ttjdbc5.jar, regardless of the version) to connect, even with autocommit = 1, there will be locks for the select statement.
Is this a bug? How can I achieve the same no lock for a select statement through sql developer? Thank you.
-your update told me that you are connected to a remote timesten data store using the client driver
-the output from ttXactAdmin shows that SqlNavigator has a shared lock on the database itself: it will not interfere with someone else "read operations and I think that until you actually try a kind of DML against the database that e IX lock on the database lock will not interfere with any other DML either."
-sharing database lock is still acquired for any transaction TimesTen. You can test it for yourself ttisql: set off autocommit, perform a simple update and do not commit the transaction. Then, open a separate session and run ttxactadmin - you will have the database IX lock as well as the various locks on the tables and indexes.
-I think this pretty much proves my original thought: this sqlDeveloper attaches to TimesTen in transaction mode. However, the IX lock on the database will not interfere with anyone else's work and should not be a problem.
-
Ask about the ReadConsoleW API
Hello, I have a cople of applications below concerning the API ReadConsoleW:
(1) I use the ReadConsoleW API to read all the console buffer both its working fine in all windows except Windows 2000 and Windows XP 64-bit OS.(2) and if I use the ReadConsoleW API to read the console buffer of a character at the same time, the problem is its fine if I give input keyboard, but when I copy and paste my couple of lines of text to console am adding an extra character of work ' at the beginning of each new line. find the code example below.
uint dummy_errors;
u16buf static wchar_t [MAX_CONSOLE_LINE_SIZE + 1], * pos;
size_t mblen = 0;
DWORD console_mode;
DWORD nchars;
Console handle = GetStdHandle (STD_INPUT_HANDLE);
(Mbbufsize > 0) DBUG_ASSERT; / * Need space to the coarser '\0 ' * /.GetConsoleMode (console, & console_mode);
SetConsoleMode (console, ENABLE_LINE_INPUT |) ENABLE_PROCESSED_INPUT | ENABLE_ECHO_INPUT);for (pos = u16buf; pos)< &u16buf[max_console_line_size]="" ;="">
{DWORD nchars;
If (!.) ReadConsoleW (console, pos, 1, & nchars, NULL). nChars == 0)
{SetConsoleMode (console, console_mode); return null; }
If (* pos == L '\r') / * do not '\r' in the resulting string, pop it * /.
continue;
If (* pos == L '\n')
break;
PDS ++;
}You will need to create a new post on the MSDN forums for assistance to development and programming:
http://social.msdn.Microsoft.com/forums/en-us/vcgeneral/threads -
Formatting for a select statement
I am trying to include formatting in a select statement.
The data, I'm pulling compared to the SSN for a unique value. The problem is that the SSN is formatted with dashes in a table and not in the other.
Example:
Table 1
Name SSN
John 400-30-8745
Mary 348-00-4093
Table 2
Name SSN
John 400308745
Mary 348004093
What I would do is:
Select * into Table1, Table2 where table1.ssn = table2.ssn
However, I am unable to do so due to the formatting.
Thxs!It will not replace the data in the database because it is a SELECT statement and not a DML (INSERT, UPDATE, DELETE) statement. You can also consider putting a function based on this column in table1 index to facilitate this request. However, it depends on many factors and because we do not know the versions, estimated use, how many times the table is updated, etc., we can say with certainty whether this can help or not. An example would be:
CREATE INDEX TABLE1_SSN_FBIDX ON TABLE1(REPLACE(SSN,'-'))
-
to find the number of records retrieved in the select statement in the cursor
Hi all
with the cursor, I'm selecting select statement together and writing in the .txt file.
his worksheet, but it should not open the file, if the cursor returns nothing.
How to find the number of records returned by the select statement in the cursor.
pls help me.
Thank you...Don't understand what you're trying to say, but maybe it's...
DECLARE vCounter NUMBER; -- Other variables... BEGIN vCounter:=0; FOR .. IN cursor LOOP IF vCounter=0 THEN -- Here open file... -- Here write one time data... END IF; -- Here write cursor data... vCounter:=1; END LOOP; END;
-Clément
-
DDL lock on the object in a SELECT statement?
Environment:
Oracle 11.2.0.4 EE on Solaris
My client called me when she was trying to create a new index on a table and the process was just hanging. Also, she was not able to DELETE an existing index on the same table, which deal with hang them as well.
After reviewing the advice DBA_DDL_LOCKS, I found a DDL lock on the target of the index table.
The DDL lock is held by a process doing a SELECT on the table and this process worked for several hours.
There was no entry in V$ LOCKED_OBJECTS for the table.
I don't know, yet, what other operations prior to the SELECT statement in the offending process, I have not heard of the user yet.
I realize a DDL lock is placed on objects to prevent changes while specific operations are directed against this object, i.e. the DROP, UPDATE, compile the PACKAGE, etc.
Question: Is a select also place a DDL lock on a table at a level that would avoid a new index is created or an existing index having fallen?
Thank you very much for your comments!
Any reference to the resolution is greatly appreciated.
I searched some Concepts Developers Guide, SQL, even Google reference Guide.
-gary
> My question is now, this lock persists for the duration of the running query?
Easy enough to show that it is not.
Session1:
SQL> create table foo(bar number); Table created. SQL> insert into foo values(1); 1 row created. SQL> commit; Commit complete. SQL> variable x refcursor SQL> variable a number SQL> begin 2 open :X for select bar from foo; 3 end; 4 / PL/SQL procedure successfully completed.
Session 2:
SQL> drop table foo; Table dropped.
Note that I was able to remove the table even if select is still 'in progress' - the cursor is open.
If you really want to blow your mind, go back to the session 1:
SQL> begin 2 fetch :X into :a; 3 end; 4 / PL/SQL procedure successfully completed. SQL> print a A ---------- 1
The picture has gone, but I can always look for him. However, try again:
SQL> / begin * ERROR at line 1: ORA-00604: error occurred at recursive SQL level 1 ORA-00942: table or view does not exist
Note that the forum software is stupid. is: followed by x. seems it's really important to have a smiley to lovey eyes in a technical forum.
Edit - and when you format the SQL code, it is removed completely and render invisible... silly.
I edited my code to use: X and the problem disappeared...
-
How to format the output of a .sql script that has select statements.
Hello
I have a .sql script which is having several select statements. Each Select statement is to have hundreds of Table columns.
When we run the .sql script, we are unable to read the output.
Please let know us the commands that we include for better readable output format.
You work with the lin standard set 80.
Increase this setting to set lin 3000 or more. -
How to split string separated by commas and pass to the clause of the select statement
Referring to article How to divide string separated by commas, then pass to clause of a select statement, tquery that there the following plan:
Query1:
select * from emp where ename in ( select regexp_substr('SMITH,ALLEN,WARD,JONES','[^,]+', 1, level) from dual connect by regexp_substr('SMITH,ALLEN,WARD,JONES', '[^,]+', 1, level) is not null );
Base1:
Plan hash value: 4242290184 -------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 133 | 7 (29)| 00:00:01 | |* 1 | HASH JOIN | | 1 | 133 | 7 (29)| 00:00:01 | | 2 | VIEW | VW_NSO_1 | 1 | 46 | 3 (34)| 00:00:01 | | 3 | HASH UNIQUE | | 1 | | 3 (34)| 00:00:01 | |* 4 | CONNECT BY WITHOUT FILTERING| | | | | | | 5 | FAST DUAL | | 1 | | 2 (0)| 00:00:01 | | 6 | TABLE ACCESS FULL | EMP | 14 | 1218 | 3 (0)| 00:00:01 | -------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - access("ENAME"="$nso_col_1") 4 - filter( REGEXP_SUBSTR ('SMITH,ALLEN,WARD,JONES','[^,]+',1,LEVEL) IS NOT NULL)
However, the following query generates the plan I want:
Query2:
select * from emp where ename in ('SMITH','ALLEN','WARD','JONES');
Plan2:
Plan hash value: 3956160932 -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 4 | 348 | 3 (0)| 00:00:01 | |* 1 | TABLE ACCESS FULL| EMP | 4 | 348 | 3 (0)| 00:00:01 | -------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter("ENAME"='ALLEN' OR "ENAME"='JONES' OR "ENAME"='SMITH' OR "ENAME"='WARD')
Can I change the query1 query for plan2?
As Juliet was mentioned in the first SQL that you generate from the ENAME list that you must pass in the IN clause when executing. But in the second SQL, it passed as a static value. So first SQL must do more work. So you see a different execution plan.
But this is a work around to get what you are looking for. But I can't say it's a foolproof method. But anyway here you go.
SQL > var ename_list varchar2 (100)
SQL > exec: ename_list: = 'SMITH, ALLEN, WARD, JONES ';PL/SQL procedure successfully completed.
SQL > select *.
2 of PEM
where the 3 «,» | : ename_list | ',' like '%', | Ename | ',%';EMPNO, ENAME, JOB HIREDATE DEPTNO ID COM SAL MGR
---------- ------ --------- ---------- --------- ---------- ---------- ---------- ----------
7369 SMITH COMMITTED 7902 2975 2 APRIL 81 0 20
7499 ALLEN 7698 1600 20 FEBRUARY SALESMAN 81 300 30
7521 WARD 7698 1250 22 FEBRUARY SALESMAN 81 500 30
7566 JONES MANAGER 7839 2975 2 APRIL 81 0 20SQL > select * from table (dbms_xplan.display_cursor);
PLAN_TABLE_OUTPUT
-------------------------------------------------------------------------------------------------------
SQL_ID, 848zhvbvgf7d6, number of children 0
-------------------------------------
Select * from emp where «,» | : ename_list | ',' like '%', | Ename
|| ',%'Hash value of plan: 2872589290
--------------------------------------------------------------------------
| ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | | | 2 (100) | |
|* 1 | TABLE ACCESS FULL | EMP | 1. 38. 2 (0) | 00:00:01 |
--------------------------------------------------------------------------Information of predicates (identified by the operation identity card):
---------------------------------------------------1 - filter(','||:ENAME_LIST||',' LIKE '%,'||") ENAME "|", %')
19 selected lines.
SQL >
-
Menu Module v2 supported for the selected state?
I can't understand if v2 menu module supports the selected state. I remember reading somewhere that it was planned to produce in the future, but it seems that the file /ModuleTemplates/Menu/Default/container.html has accommodations for her.
A resource if so, it would be appreciated.
By default I did, the JavaScript code is there in the updates page and not different from the normal version in this respect.
Maybe you are looking for
-
I have problems of space on my iPhone 6, I have only 21 photos and 2 videos on my phone. However, I am part of a chart group on whatsapp. The problem now is that my storage space is almost full. How can I create more space for photos and everything?
-
K135 move v0.35 on v0.37 is not possible because USB or MicroSD not recognized
My problem is described in the topic: K135 move v0.35 on v0.37 is not possible because USB or MicroSD not recognized? I read the instructions in the PDF and the user manual. Can someone help me?
-
Second HARD drive not recognized by windows 8 but is recognized by the sata bios
Second disk sata hard of not appearing is not on my computer and disk management. However, the hard drive is displayed in the bios. I am running windows 8 and the hard drive has been used in another cpu with linux installed on it, I want to format th
-
Applications of database account and can't question the views
Not even run queries with db applications account we don't seem to be able to return data in the default views that I know contain data. is it all still around that?
-
A publication of signature and lock filling PDF form. [Android]
Guys,I created a PDF form for our engineers in the Department, and he works well with your Android app re clients signature on site.However, when my engineers send the signed PDF it can be changed, and the form fields modified by anyone who opens it