I am working on a form, whose one block is query_find, so on clicking find button it will open another block.the find block contain 4 column and second block contain around 10 column.but the column present in find block are associated to standard tables and the column present in block-2 are from custom tables.there is a query which link those column.
I am not sure where to use that query, so that it will take input from the find block and then populate the result into the block-2.
Suppose if I have defined two triggers Key-next and When-validate-item on the same item.
If my key-next is going to fire first and When-validate-item laterhow can the validation happen if I write a code like go_item('XXXX') in my Key-next.Does it mean that if u write a code in key-next to jump to some other item, no validation takes pLace?
A requisition application shows the latest requisition details in the homepage and allow the users to go particular requisitions (extract) details from a button (CALL_FORM), also they can modify the records in that form.
I want to give an EXECUTE_QUERY (WHEN-WINDOW-ACTIVATED) when im returning to the home page and the cursor should return to the last row where i was.
do this from navigation triggers (with out writing a select statement in when-window-activated).
I 've noticed transactional triggers, as a value for Query data block property, How can i use it, and is it really 's mode advantages than using from clause and procedure based with DMLs on non-based items?
In one of my form , there is some code "next_record;" in the key-next-item trigger of one field.Here before going to next record, it is executing the WHEN-VALIDATE-TRIGGER of all the items in that record.Is it the default behavior of oracle forms?Can we override this?
building SQL query to get the result as shown below.
Create Table Temp
CREATE TABLE TEMP ( CASEID NUMBER, SATUS VARCHAR2(1 BYTE), TRANS_DATE DATE ) Insert data
[Code]...
I want to build a query which should give output as shown below. Basically i want to select those rows which having minimum trans_date for a given CASEID & Status.
INSERT INTO main_t VALUES(1, 'u1'); INSERT INTO main_t VALUES(2, 'u2'); INSERT INTO main_t VALUES(3, 'u3'); INSERT INTO main_t VALUES(4, 'u4'); INSERT INTO main_t VALUES(5, 'u5');
[Code]....
I have written this query, which gives me the expected output.
SELECT membr.username member_name , frnd.username friend_name FROM main_t membr, main_t frnd, relation_t rltn WHERE rltn.user_id=membr.user_id AND rltn.frnd_id=frnd.user_id /
MEMBER_NAM FRIEND_NAM ---------- ---------- u1 u2 u2 u3 u5 u4 u1 u5
SELECT HISTORY_ID ,SUM(MISSED_SCHOOL) AS MISSED_SCHOOL,SUM(MISSED_SCHOOL_LAST) AS MISSED_SCHOOL_LAST FROM EMRASTHAMAHISTORYDETAILS WHERE ------ GROUP BY HISTORY_ID
There is no date column in table using sysdate alone need to retrieve last 6 month records
I need to find out that assume i have a table having 2 column
Num Name 1 Adam 2 Akanksha 1 barren 2 bosli 3 Benergee 4 Bhawna 3 anjani
I want a query as if A is there 2 times then there should be 1 then 2 then there is b coming in 4 places then it should be 1 2 3 4 and again there is anjani so 3 should be there as 1 and 2 in first 2 places and the num should be automatically generated number based on the count of the alphabets
i need a SQL query which should return me relevant table names. i.e. if there is table 'EMP' , then query should give table names with below result:
EMP EMP_1 EMP_2 EMP_3 EMP_4
i.e. All tables which is starting with EMP (No Hardcoding of table, It should be dynamic way).I know we can achieve through SELECT * FROM USER_ OBJECTS WHERE OBJECT_NAME LIKE 'EMP%'. But here object_name i will passing dynamically.
I want to know how I can find which query is taking more time , for example some query's are run from unix, java and from toad,sqlplus. and one query is taking much more time to execute, so how i can get that query and all the details.
My table has two date columns EFF_DT which is the start date and TERM_DT is the end date. The EFF_DT of the next record should be the next date of the TERM_DT record.
In the fourth record, the effective date should be 1-Oct-13 which is the next date to the last TERM_DT 30-Sep-13.As the is the break in the date, the output should show 15-Oct-13 sa the second start date.
Note: Refer to the PI_ID columns, there is a break in the date for the sale PI_ID 'ABC'.
Here I am trying to generate a pseudo column, so that the table with the pseudo column looks like as shown below. and I can use first_value and LAST_value by partitioning on the pseudo column to get the desired output.
1) CNT_VAL is the pseudo column: ----------------------------- CK_IDPI_IDEFF_DT TERM_DT CNT_VAL Mem1ABC1-Jan-1331-Mar-131 Mem1ABC1-Apr-1331-May-131 Mem1ABC1-Jun-1330-Sep-131
[code].....
My Query : ----------
I not getting the desired output here as the value in pseudo column is 3.
select CK_ID, PI_ID,EFF_DT,TERM_DT, (case when case_CONT - LAG(case_CONT,1) over (ORDER BY EFF_DT) = 0 then to_char(case_CONT) when case_CONT - LAG(case_CONT,1) over (ORDER BY EFF_DT) <> 0 then to_char(LAG(case_CONT,1) over (ORDER BY EFF_DT) + 1) else to_char(nvl(case_CONT,0))
in the above, for job 1 ,on 19/08/2010 the time difference should be calculated as
01:23:12-00:56:00 and the difference should be in minutes.
for end_time. i can't take the substring as the length of the date varies for 19 and 7. In case of start date, the time has to be in format, hh:mm:ss, to calculate the difference.
customers ------------------------------------------------------------------------------------------ custid credit amt month -------------------------------------------------------------------------------------------- 001 C 2000 Jan-2012 001 D 5000 Feb-2012 001 C 3000 Mar-2012 001 C 3000 Apr-2012 001 D 7000 May-2012
I Have to write a single query to calculate the sum of credit and sum of debit value separately.
I google to find the Table Name and Column Name by having a value(Number/String). And my where clauses are
where owner NOT IN ('SYS','SYSTEM') and data_type IN ('CHAR','VARCHAR2','NUMBER')
My query as follows
select a.owner, c.column_name, c.data_type, c.owner, c.table_namefrom dba_objects a, all_tab_cols c where a.owner NOT IN ('SYS','SYSTEM') and where c.owner NOT IN ('SYS','SYSTEM') and where c.data_type IN ('CHAR','VARCHAR2')order by a.owner
We have data as below in the table. I need the to display the records in the order based on number of NULL values and position for each record.
provide a simple query using case in ORDER BY clause.
ID CLASS NAME DIST_ID DIST_NAME 0 NULL KIRAN 0 AP 0 C1213 NULL 0 AP 0 NULL NULL 0 AP NULL C1234 NULL 0 AP 0 NULL NULL 0 AP NULL NULL NULL NULL NULL 0 C123 RAJESH 0 AP NULL C123 RAVI NULL AP
We have to give the rank based on NULL values and NULL value column position.Let us assume column positions as
1 2 3 4 5 ID CLASS NAME DIST_ID DIST_NAME
for the following three records number of NULL values are same. but positions are different.
0 NULL NULL 0 AP NULL C1234 NULL 0 AP 0 NULL NULL 0 AP NULL C123 RAVI NULL AP
Based on the column positions the ranks as 2*2+3*3=13 1*1+3*3=10 2*2+3*3=13 1*1+4*4=17
Which is having high rank (greatest number) that record should come last . The record which is having all values that should come first. The record which is having all NULL values should come last. The out put I want as
ID CLASS NAME DIST_ID DIST_NAME 0 C123 RAJESH 0 AP 0 NULL KIRAN 0 AP 0 C1213 NULL 0 AP NULL C1234 NULL 0 AP 0 NULL NULL 0 AP 0 NULL NULL 0 AP NULL C123 RAVI NULL AP NULL NULL NULL NULL NULL
NO VDATE T ---------- --------- - 1245 07-JAN-13 N 1246 07-JAN-13 N 1247 07-JAN-13 R 1248 07-JAN-13 N 1251 08-JAN-13 N 1250 08-JAN-13 R 1253 08-JAN-13 N 1252 09-JAN-13 R 1254 09-JAN-13 N 1255 09-JAN-13 N
Need a query to find the count of presence of delimiter "," in column VAL for below mentioned table.
Table:
CREATE TABLE N_B_S_1 ( NUM NUMBER, VAL VARCHAR2(20) )
Data:
INSERT INTO N_B_S_1 VALUES(1,'A,B,C'); INSERT INTO N_B_S_1 VALUES(2,'D'); INSERT INTO N_B_S_1 VALUES(3,'ER,NF,G,H,XK'); INSERT INTO N_B_S_1 VALUES(4,'LQW,MBV'); INSERT INTO N_B_S_1 VALUES(5,'KS,YJ,WE,RQ,PM'); COMMIT;
I have table called test script for table is given below
create table TEST ( col1 Number );
[Code]...
For these values Query is not returning values(3 and 4). So i want generic query to get this result. I am working on it but not able to generate proper query.