Retrive records based on condition
HI,
Need some clarification on getting the records based on the condition given.
Here is my requirement. I have developed a function module to search the records based on some input given. For suppose i get some around 10000 records for this condition. Now i need the output records in multiples.
Like first i execute the FM based on the some condition and i should get 100 records as output and the second time i execute the FM with the same search condition i need to get the records from 101 to 200 and the third time i execute and so on.
Is there any way of fetching the records in multiles for the same search criteria. If so can anyone let me know hot to do the same.
Thanks in advance.
Regards,
Ram
HI Ram
Please check this example to get some idea:
tables: vbak.
data: it_vbak type table of vbak,
wa_vbak1 type vbak,
wa_vbak2 type vbak.
data: lin type i.
select-options: s_erdat for vbak-erdat obligatory.
select * into table it_vbak from vbak
package size 10
where erdat in s_erdat.
describe table it_vbak lines lin.
read table it_vbak into wa_vbak1 index 1.
read table it_vbak into wa_vbak2 index lin.
break-point.
endselect.
Check the entries in IT_VBAK whenever the break-point is reached. You will have a fresh set of entries for every collection.
Hope this gives you some idea.
Kind Regards
Eswar
Similar Messages
-
Retrive Records based on the content in a Clob Feild
Retrive Records based on the content in a Clob Feild
I have a Table NoteFile which contains a Clob Feild NoteFileContent
and is refrenced by PK DocID
i need to Match DocID with other Tables Document and folderdocument
My Query is as Below
SELECT Doc.Pap_Doc_ID, Doc.Pap_Doc_Name , NF.NoteFileContent
From NoteFile NF , Document Doc, folderdocument FD
Where Doc.Pap_Doc_ID = FD.FoldDoc_ID and FD.FoldDoc_ParentID <> 3 and
NF.DocID = DOC.Pap_Doc_ID And NF.NoteFileContent Like '%a%'
The above query throws
ORA-00600: internal error code, arguments: [504], [0x7ADEBE00], [2], [1],
[cache buffers chains], [723], [0], [0x7ADEBE00]Hi,
We can resize it.Always give the height and weight in
percentage format. and turn off the horizontal n vertical scroll
policy in u r main application.
Hopes it helps you... -
Retrieve records based on condition from xml using XPATH
Hi all,
I have a table form_content where there are two columns - form_content_id (numeric) and xml_content (clob). The structure of xml_content is
<RAF xmlns="http://www.abnamro.com/WCS/GCEG/KRT">
<XBorderRAF>
<ClientProfile isBranch="1" isBusinessAddressDifferent="1" isSubsidiary="0" regDate="2009-09-01">
<RegisteredAddress city="test" country="GB" nameOfContactPerson="3454545" street1="test" telephoneNumber="34534545"/>
</ClientProfile>
</XBorderRAF>
</RAF>
I want to retrive all form_contant_id from form_content table where country is 'GB' inside RegisteredAddress tag.
I am able to retrive all form_content_id with country value using below query,
SELECT form_content_id,
extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ClientProfile/RegisteredAddress/@country', 'xmlns="http://www.abnamro.com/WCS/GCEG/KRT"')
as registerAddress
from
form_content
but I am finding it difficult to reterive records based on any condition..
SELECT form_content_id,
extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ClientProfile/RegisteredAddress/@country', 'xmlns="http://www.abnamro.com/WCS/GCEG/KRT"')
as registerAddress
from
form_content
where
(extractValue(xmltype(xml_content),'/RAF/XBorderRAF/ClientProfile/RegisteredAddress/@country', 'xmlns="http://www.abnamro.com/WCS/GCEG/KRT"')='GB'
Please help me to resolve this problem. ....
ThanksOk, thaks to all who looked this query, I found the answer
select form_content_id
from xmltest
where existsnode(xmltype(xml_content), '/RAF/XBorderRAF/ClientProfile/RegisteredAddress[@country="GB"]','xmlns="http://www.abnamro.com/WCS/GCEG/KRT"') = 1; -
Delete duplicate records based on condition
Hi Friends,
I am scratching my head as how to select one record from a group of duplicate records based upon column condition.
Let's say I have a table with following data :
ID START_DATE END_DATE ITEM_ID MULT RETAIL | RETAIL / MULT
1 10/17/2008 1/1/2009 83 3 7 | 2.3333
2 10/17/2008 1/1/2009 83 2 4 | 2
3 10/17/2008 1/1/2009 83 2 4 | 2
4 10/31/2008 1/1/2009 89 3 6 | 2
5 10/31/2008 1/1/2009 89 4 10 | 2.5
6 10/31/2008 1/1/2009 89 4 10 | 2.5
7 10/31/2008 1/1/2009 89 6 6 | 1
8 10/17/2008 10/23/2008 124 3 6 | 2From the above records the rule to identify duplicates is based on START_DATE,+END_DATE+,+ITEM_ID+.
Hence the duplicate sets are {1,2,3} and {4,5,6,7}.
Now I want to keep one record from each duplicate set which has lowest value for retail/mult(retail divided by mult) and delete rest.
So from the above table data, for duplicate set {1,2,3}, the min(retail/mult) is 2. But records 2 & 3 have same value i.e. 2
In that case pick either of those records and delete the records 1,2 (or 3).
All this while it was pretty straight forward for which I was using the below delete statement.
DELETE FROM table_x a
WHERE ROWID >
(SELECT MIN (ROWID)
FROM table_x b
WHERE a.ID = b.ID
AND a.start_date = b.start_date
AND a.end_date = b.end_date
AND a.item_id = b.item_id);Due to sudden requirement changes I need to change my SQL.
So, experts please throw some light on how to get away from this hurdle.
Thanks,
Raj.Well, it was my mistake that I forgot to mention one more point in my earlier post.
Sentinel,
Your UPDATE perfectly works if I am updating only NEW_ID column.
But I have to update the STATUS_ID as well for these duplicate records.
ID START_DATE END_DATE ITEM_ID MULT RETAIL NEW_ID STATUS_ID | RETAIL / MULT
1 10/17/2008 1/1/2009 83 3 7 2 1 | 2.3333
2 10/17/2008 1/1/2009 83 2 4 | 2
3 10/17/2008 1/1/2009 83 2 4 2 1 | 2
4 10/31/2008 1/1/2009 89 3 6 7 1 | 2
5 10/31/2008 1/1/2009 89 4 10 7 1 | 2.5
6 10/31/2008 1/1/2009 89 4 10 7 1 | 2.5
7 10/31/2008 1/1/2009 89 6 6 | 1
8 10/17/2008 10/23/2008 124 3 6 | 2So if I have to update the status_id then there must be a where clause in the update statement.
WHERE ROW_NUM = 1
AND t2.id != t1.id
AND t2.START_DATE = t1.START_DATE
AND t2.END_DATE = t1.END_DATE
AND t2.ITEM_ID = t1.ITEM_IDInfact the entire where_ clause in the inner select statement must be in the update where clause, which makes it totally impossible as T2 is persistent only with in the first select statement.
Any thoughts please ?
I appreciate your efforts.
Definitely this is a very good learning curve. In all my experience I was always writing straight forward Update statements but not like this one. Very interesting.
Thanks,
Raj. -
Fetching Records Based on Condition
hi all,
i am having some problem in getting the records from three tables.could anybody there to help me out of this.....
there are three tables SUB,TICKETS and INDTICKETS.
In the first table SUB(master table)which contains the masters.
In the second table TICKET(detail table) which contains the tickets belongs to the subscriber in the master(SUB)table.
So if we want to see the tickets(2 each) of one subscriber belongs to which routeid we can combine the 2 tables and get it since routeid is in the SUB master table.
Sometimes all tickets wouldnt belongs to the same routeid whatever specified in the SUB master.So i created the another INDTICKET table which will save the routeid ticketid wise.So the INDTICKET Table will contains tickets which are only having routeid is been changed.
DESC SUB
SUBNO SUBNAME ROUTEID
1 SMITH 01
2 SCOTT 02
DESC TICKETS
SUBNO TICKETID AMOUNT
1 01 1000
1 02 2000
2 09 4000
2 10 7000
DESC INDTICKET
SUBNO TICKETID ROUTEID
1 02 02
2 10 01
Now i need a query which will fetch only the tickets
1 . belongs to 01 routeid in the SUB master table and not in the INDTICKET table of other routeid
2 . and the ticketid belongs to the 01 routeid in the INDTICKET table.
So from the above example the query should fetch like this
=== Tickets in routeid '01' ===
SUBNO SUBNAME TICKETID AMOUNT
1 SMITH 01 1000
2 SCOTT 10 7000
thanks in advance
regrds,
punithIn the future, it would be much more helpful if you could post the DDL to create and populate these tables instead of DESC and query output. It would greatly increase the chances of having your question answered.
I would probably have put the routeid override as an additional column in the tickets table instead of creating a new table just for the override, but with your current layout:
sql>select * from sub;
SUBNO SUBNAME ROUTEID
1 Smith 1
2 Scott 2
2 rows selected.
sql>select * from tickets;
SUBNO TICKETID AMOUNT
1 1 1000
1 2 2000
2 9 4000
2 10 7000
4 rows selected.
sql>select * from indticket;
SUBNO TICKETID ROUTEID
1 2 2
2 10 1
2 rows selected.
sql>select s.subno, s.subname, t.ticketid, t.amount
2 from sub s, tickets t
3 where s.routeid = 1
4 and t.subno = s.subno
5 and not exists (select null
6 from indticket it
7 where it.subno = s.subno
8 and it.ticketid = t.ticketid)
9 union all
10 select s.subno, s.subname, it.ticketid, t.amount
11 from indticket it, sub s, tickets t
12 where it.routeid = 1
13 and s.subno = it.subno
14 and t.subno = s.subno
15 and t.ticketid = it.ticketid;
SUBNO SUBNAME TICKETID AMOUNT
1 Smith 1 1000
2 Scott 10 7000
2 rows selected. -
Distinct records based on condition within a table
Hello PL/SQL Gurus/experts,
I am using Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production version
I have following table -
Note - Table don't have any primary key on Order_ID -
DROP TABLE T;
create table T(Order_ID,Active_Flg) as select
'201002', 'Y' from dual union all select
'201002', '' from DUAL union all select
'201003', '' from dual union all select
'201004', 'Y' from DUAL union all select
'201004', '' from dual union all select
'201005', '' from DUAL ;I want to fetch those Order_ID which have Active-Flg as NULL and don't have the entry for Active_Flg=Y
If use the following then it returns the distinct Order_ID but not the expected one -
SELECT DISTINCT ORDER_ID FROM T WHERE ACTIVE_FLG IS NULL;Result -
ORDER_ID
201004
201002
201003
201005Kindly help.....try this
with t as
select
'201002' order_id, 'Y' active_flg from dual union all select
'201002', '' from DUAL union all select
'201003', '' from dual union all select
'201004', 'Y' from DUAL union all select
'201004', '' from dual union all select
'201005', '' from DUAL
select order_id
from (
select
order_id,
active_flg,
count(case when active_flg = 'Y' then 1 end) over(partition by order_id) cntY
from t
where cntY = 0 and active_flg is null -
Select the record based count condition
Hi Experts
I have a table with columns StateDate,State,Name & Type . For the same date there could be 2 or more rows for the same name .
I need to retrieve the data from the table only for the name containing single row in the table and state = 'On'
Please find the Create & Insert Scripts below . Am assuming it needs to be done with a window function and am not yet comfortable with window function .
CREATE TABLE ItemState
(StateDate Date,
State Varchar(3),
Name Varchar(3),
Type int)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','Off','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','ABC',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','Off','CBR',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','On','CBR',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','On','XYZ',1)
Expected Result
StateDate
State
Name
Type
3/11/2014
ON
ABC
1
3/12/2014
ON
XYZ
1
Kindly help
Thanks
PriyaINSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','Off','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','ABC',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','Off','CBR',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','On','CBR',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/12/2014','On','XYZ',1)
again adding this 3 rows
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','Off','XYZ',1)
INSERT INTO Itemstate (Statedate,State,Name,Type)
Values ('3/11/2014','On','ABC',1)
SELECT *
FROM itemstate order by statedate, name,state
2014-03-11 On
ABC 1
2014-03-11 On
ABC 1
2014-03-11 Off
XYZ 1
2014-03-11 Off
XYZ 1
2014-03-11 On
XYZ 1
2014-03-11 On
XYZ 1
2014-03-12 Off
CBR 1
2014-03-12 On
CBR 1
2014-03-12 On
XYZ 1
so only xyz on 2014-03-12 will qualify
WITH test
AS (SELECT *,
row_number()
OVER (
partition BY statedate, name
ORDER BY state ASC) rnasc,
count(state)
OVER (
partition BY statedate, name
ORDER BY state desc) rncount
FROM itemstate)
SELECT *
FROM test t1 where rnasc = 1
and state = 'on' and rncount = 1
Amish shah
http://bloq.sqltechie.com -
Spliting files based on condition using multi mapping with BPM
Hi All,
Can any one please let me know How to <b>Splite the outbound records based on condition using multi mapping with Integration Process in BPM</b>?
Thanks
Govindu.Hi All,
Sorry for mistake this question for Exchange infrastructure guys.
Thanks,
Govindu -
How to create additional Line in file based on condition available as part of ZINVOIC02 Idoc segment
Scenario Details:
Receiving Zinvoic02 Idoc in PI. Idoc to file translation creates comma separated file with .csv extn
The logic was kept in such a way that how many E1EDP01 (items) are available in IDoc that many no of records will be created in csv file.
The file logic for some the fields is as below:
No of records
InvNumber
InvDate
CusNumber
LineitemDesc
Tax1Type
Tax1%
for 1st E1EDP01
E1EDK01-BELNR
E1EDK03-DATUM
E1EDK01-PARTN
Populate when E1EDP04/MSKWZ=O2 or O4 with E1EDP19/KTEXT
Hardcode when E1EDP04/MSKWZ=O2 or O4
Sum all E1EDP04 /MSATZ when E1EDP04/MSKWZ=O2 or O4
for 2nd E1EDP01
E1EDK01-BELNR
E1EDK01-DATUM
E1EDK01-PARTN
same as above
same as above
same as above
for 3rd E1EDP01
E1EDK01-BELNR
E1EDK03-DATUM
E1EDK01-PARTN
same as above
same as above
same as above
Additional Line to be created when one or more of E1EDP01 is having E1EDP04/MSKWZ = O3
same as above
same as above
same as above
Hardcode "REIM for USE TAX"
Hardcode ""
Hardcode ""
Now we have got addition requirement to add a new lineitem when tax code is equal to O3 for any of the E1EDP01.
Is it possible to create additional lineitem based on condition. If yes, please share what should be the approach.
How we can create the additional lineitem?
Currently we are using E1EDP01 to do context handling.
The target structure is :
MT_FILE
INVOICE 0..unbounded
InvNumber 0..1
InvDate 0..1
CusNumber 0..1
LineitemDesc 0..1
Tax1Type 0..1
Tax1% 0..1Hello,
Please add one extra field in the data structure of the target mapping and let its occurrence be 0..unbounded under the root node 'MT_ADP_Invoice'.
Apply the condition, if tax code MSKWZ (with its context changed to E1EDP01) equalsS to '03', then map it to the newly created target field whose occurrence is 0..unbounded.
This will then create an additional field which is your requirement.
The above is one way.
But if you want to have the same target field name as ADP_File appended for tax field being '03'.
Then in that case you can you two message mapping for one common operational mapping / interface.
In the first message mapping you need to have one target data structure created with the source data structure remaining the same as the one shown by you in scrn shot. Now this target data structure will be similar to the source, except that you need to add one more field at the end(name different from other fields) in target (whose occurrence should be 0..unbounded), and it needs to be mapped to E1EDP01 provided the tax code field MSKWZ(its context changed to E1EDP01) equalsS to constant '03'.
In the second message mapping you need to map the target structure of previous message mapping to the actual required structure. The newly added field should be mapped to ADP_File of your final target structure.
This will then create the same structure as required.
Note : Please change the occurence of ADP_File to 0..unbounded.
Regards,
Souvik -
Sql retrives record but fails when used in a view
Hi,
I have a unique problem. I am able to retrive a record based on a certain criteria using a SQL.
When the same sql is used in a create view statement the records do not show up.
I did a count on records using the sql and get 54,521 where
a count on the number of records from a view created using the same sql gives a lower number 40,967
Here is the script
/* Formatted on 2009/10/07 16:22 (Formatter Plus v4.8.8) */
CREATE OR REPLACE FORCE VIEW ssvsec2_js (term_code_key,
crn_key,
seq_number_key,
active_section_ind,
active_course_ind,
course_coreq_ind,
course_prereq_ind,
section_coreq_ind,
section_prereq_ind,
course_eff_term_code,
coll_code,
dept_code,
levl_code1,
levl_code2,
levl_code3,
levl_code4,
divs_code,
subj_code,
crse_number,
ceu_ind,
csta_code,
credit_hours,
credit_hours_low,
credit_hours_high,
credit_hours_ind,
billing_hours,
billing_hours_low,
billing_hours_high,
billing_hours_ind,
ssts_code,
camp_code,
gmod_code,
title,
sapr_code,
census_enrollment1,
census_enrollment_date1,
census_enrollment2,
census_enrollment_date2,
projected_enrollment,
maximum_enrollment,
actual_enrollment,
seats_available,
ptrm_code,
ptrm_start_date,
ptrm_end_date,
link_identifier,
begin_time1,
end_time1,
bldg_code1,
room_code1,
schd_code_meet1,
monday_ind1,
tuesday_ind1,
wednesday_ind1,
thursday_ind1,
friday_ind1,
saturday_ind1,
sunday_ind1,
begin_time2,
end_time2,
bldg_code2,
room_code2,
schd_code_meet2,
monday_ind2,
tuesday_ind2,
wednesday_ind2,
thursday_ind2,
friday_ind2,
saturday_ind2,
sunday_ind2,
begin_time3,
end_time3,
bldg_code3,
room_code3,
schd_code_meet3,
monday_ind3,
tuesday_ind3,
wednesday_ind3,
thursday_ind3,
friday_ind3,
saturday_ind3,
sunday_ind3,
begin_time4,
end_time4,
bldg_code4,
room_code4,
schd_code_meet4,
monday_ind4,
tuesday_ind4,
wednesday_ind4,
thursday_ind4,
friday_ind4,
saturday_ind4,
sunday_ind4,
begin_time5,
end_time5,
bldg_code5,
room_code5,
schd_code_meet5,
monday_ind5,
tuesday_ind5,
wednesday_ind5,
thursday_ind5,
friday_ind5,
saturday_ind5,
sunday_ind5,
begin_time6,
end_time6,
bldg_code6,
room_code6,
schd_code_meet6,
monday_ind6,
tuesday_ind6,
wednesday_ind6,
thursday_ind6,
friday_ind6,
saturday_ind6,
sunday_ind6,
begin_time7,
end_time7,
bldg_code7,
room_code7,
schd_code_meet7,
monday_ind7,
tuesday_ind7,
wednesday_ind7,
thursday_ind7,
friday_ind7,
saturday_ind7,
sunday_ind7,
begin_time8,
end_time8,
bldg_code8,
room_code8,
schd_code_meet8,
monday_ind8,
tuesday_ind8,
wednesday_ind8,
thursday_ind8,
friday_ind8,
saturday_ind8,
sunday_ind8,
begin_time9,
end_time9,
bldg_code9,
room_code9,
schd_code_meet9,
monday_ind9,
tuesday_ind9,
wednesday_ind9,
thursday_ind9,
friday_ind9,
saturday_ind9,
sunday_ind9,
begin_time10,
end_time10,
bldg_code10,
room_code10,
schd_code_meet10,
monday_ind10,
tuesday_ind10,
wednesday_ind10,
thursday_ind10,
friday_ind10,
saturday_ind10,
sunday_ind10,
attr_code1,
attr_code2,
additional_attributes_ind,
primary_instructor_id,
primary_instructor_last_name,
primary_instructor_first_name,
primary_instructor_middle_init,
instructor_id2,
instructor_last_name2,
instructor_first_name2,
instructor_middle_init2,
instructor_id3,
instructor_last_name3,
instructor_first_name3,
instructor_middle_init3,
additional_instructors_ind,
coll_code_override,
divs_code_override,
dept_code_override,
schd_code1,
schd_workload1,
schd_max_enrl1,
schd_adj_workload1,
schd_code2,
schd_workload2,
schd_max_enrl2,
schd_adj_workload2,
schd_code3,
schd_workload3,
schd_max_enrl3,
schd_adj_workload3,
schd_code4,
schd_workload4,
schd_max_enrl4,
schd_adj_workload4
AS
SELECT ssbsect_term_code, ssbsect_crn, ssbsect_seq_numb,
SUBSTR (f_active_section_ind (ssbsect_ssts_code), 1, 1),
SUBSTR (f_active_course_ind (a.scbcrse_csta_code), 1, 1),
SUBSTR (f_check_for_course_coreqs (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code
1,
1
SUBSTR (f_check_for_course_prereqs (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
1,
1
SUBSTR (f_check_for_section_coreqs (ssbsect_term_code, ssbsect_crn),
1,
1
SUBSTR (f_check_for_section_prereqs (ssbsect_term_code,
ssbsect_crn,
1,
1
a.scbcrse_eff_term, a.scbcrse_coll_code, a.scbcrse_dept_code,
SUBSTR (f_get_course_levels (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
1
1,
2
SUBSTR (f_get_course_levels (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
2
1,
2
SUBSTR (f_get_course_levels (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
3
1,
2
SUBSTR (f_get_course_levels (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
4
1,
2
a.scbcrse_divs_code, ssbsect_subj_code, ssbsect_crse_numb,
a.scbcrse_ceu_ind, a.scbcrse_csta_code,
NVL (ssbsect_credit_hrs, a.scbcrse_credit_hr_low),
a.scbcrse_credit_hr_low, a.scbcrse_credit_hr_high,
a.scbcrse_credit_hr_ind,
NVL (ssbsect_bill_hrs, a.scbcrse_bill_hr_low),
a.scbcrse_bill_hr_low, a.scbcrse_bill_hr_high,
a.scbcrse_bill_hr_ind, ssbsect_ssts_code, ssbsect_camp_code,
NVL (ssbsect_gmod_code,
SUBSTR (f_default_gmod (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code
1,
1
NVL (ssbsect_crse_title, a.scbcrse_title), ssbsect_sapr_code,
ssbsect_census_enrl, ssbsect_census_enrl_date,
ssbsect_census_2_enrl, ssbsect_census_2_date, ssbsect_proj_enrl,
ssbsect_max_enrl, ssbsect_enrl, ssbsect_seats_avail,
ssbsect_ptrm_code, ssbsect_ptrm_start_date, ssbsect_ptrm_end_date,
ssbsect_link_ident, k.ssrmeet_begin_time, k.ssrmeet_end_time,
k.ssrmeet_bldg_code, k.ssrmeet_room_code, k.ssrmeet_schd_code,
k.ssrmeet_mon_day, k.ssrmeet_tue_day, k.ssrmeet_wed_day,
k.ssrmeet_thu_day, k.ssrmeet_fri_day, k.ssrmeet_sat_day,
k.ssrmeet_sun_day, l.ssrmeet_begin_time, l.ssrmeet_end_time,
l.ssrmeet_bldg_code, l.ssrmeet_room_code, l.ssrmeet_schd_code,
l.ssrmeet_mon_day, l.ssrmeet_tue_day, l.ssrmeet_wed_day,
l.ssrmeet_thu_day, l.ssrmeet_fri_day, l.ssrmeet_sat_day,
l.ssrmeet_sun_day, m.ssrmeet_begin_time, m.ssrmeet_end_time,
m.ssrmeet_bldg_code, m.ssrmeet_room_code, m.ssrmeet_schd_code,
m.ssrmeet_mon_day, m.ssrmeet_tue_day, m.ssrmeet_wed_day,
m.ssrmeet_thu_day, m.ssrmeet_fri_day, m.ssrmeet_sat_day,
m.ssrmeet_sun_day, n.ssrmeet_begin_time, n.ssrmeet_end_time,
n.ssrmeet_bldg_code, n.ssrmeet_room_code, n.ssrmeet_schd_code,
n.ssrmeet_mon_day, n.ssrmeet_tue_day, n.ssrmeet_wed_day,
n.ssrmeet_thu_day, n.ssrmeet_fri_day, n.ssrmeet_sat_day,
n.ssrmeet_sun_day, o.ssrmeet_begin_time, o.ssrmeet_end_time,
o.ssrmeet_bldg_code, o.ssrmeet_room_code, o.ssrmeet_schd_code,
o.ssrmeet_mon_day, o.ssrmeet_tue_day, o.ssrmeet_wed_day,
o.ssrmeet_thu_day, o.ssrmeet_fri_day, o.ssrmeet_sat_day,
o.ssrmeet_sun_day, p.ssrmeet_begin_time, p.ssrmeet_end_time,
p.ssrmeet_bldg_code, p.ssrmeet_room_code, p.ssrmeet_schd_code,
p.ssrmeet_mon_day, p.ssrmeet_tue_day, p.ssrmeet_wed_day,
p.ssrmeet_thu_day, p.ssrmeet_fri_day, p.ssrmeet_sat_day,
p.ssrmeet_sun_day, q.ssrmeet_begin_time, q.ssrmeet_end_time,
q.ssrmeet_bldg_code, q.ssrmeet_room_code, q.ssrmeet_schd_code,
q.ssrmeet_mon_day, q.ssrmeet_tue_day, q.ssrmeet_wed_day,
q.ssrmeet_thu_day, q.ssrmeet_fri_day, q.ssrmeet_sat_day,
q.ssrmeet_sun_day, r.ssrmeet_begin_time, r.ssrmeet_end_time,
r.ssrmeet_bldg_code, r.ssrmeet_room_code, r.ssrmeet_schd_code,
r.ssrmeet_mon_day, r.ssrmeet_tue_day, r.ssrmeet_wed_day,
r.ssrmeet_thu_day, r.ssrmeet_fri_day, r.ssrmeet_sat_day,
r.ssrmeet_sun_day, s.ssrmeet_begin_time, s.ssrmeet_end_time,
s.ssrmeet_bldg_code, s.ssrmeet_room_code, s.ssrmeet_schd_code,
s.ssrmeet_mon_day, s.ssrmeet_tue_day, s.ssrmeet_wed_day,
s.ssrmeet_thu_day, s.ssrmeet_fri_day, s.ssrmeet_sat_day,
s.ssrmeet_sun_day, t.ssrmeet_begin_time, t.ssrmeet_end_time,
t.ssrmeet_bldg_code, t.ssrmeet_room_code, t.ssrmeet_schd_code,
t.ssrmeet_mon_day, t.ssrmeet_tue_day, t.ssrmeet_wed_day,
t.ssrmeet_thu_day, t.ssrmeet_fri_day, t.ssrmeet_sat_day,
t.ssrmeet_sun_day, e1.ssrattr_attr_code, e2.ssrattr_attr_code,
SUBSTR (f_more_attributes (scbcrse_subj_code,
scbcrse_crse_numb,
scbcrse_eff_term
1,
1
x.spriden_id, NVL (x.spriden_last_name, 'STAFF'),
x.spriden_first_name, SUBSTR (x.spriden_mi, 1, 1), y.spriden_id,
y.spriden_last_name, y.spriden_first_name,
SUBSTR (y.spriden_mi, 1, 1), z.spriden_id, z.spriden_last_name,
z.spriden_first_name, SUBSTR (z.spriden_mi, 1, 1),
DECODE (u.spriden_pidm, NULL, 'N', 'Y'), ssbovrr_coll_code,
ssbovrr_divs_code, ssbovrr_dept_code, f1.scrschd_schd_code,
f1.scrschd_workload, f1.scrschd_max_enrl, f1.scrschd_adj_workload,
f2.scrschd_schd_code, f2.scrschd_workload, f2.scrschd_max_enrl,
f2.scrschd_adj_workload, f3.scrschd_schd_code, f3.scrschd_workload,
f3.scrschd_max_enrl, f3.scrschd_adj_workload, f4.scrschd_schd_code,
f4.scrschd_workload, f4.scrschd_max_enrl, f4.scrschd_adj_workload
FROM scbcrse a,
ssbovrr,
spriden x,
spriden y,
ssrmeet k,
ssrmeet l,
ssrmeet m,
ssrmeet n,
ssrmeet o,
ssrmeet p,
ssrmeet q,
ssrmeet r,
ssrmeet s,
ssrmeet t,
scrschd f1,
scrschd f2,
scrschd f3,
scrschd f4,
ssrattr e1,
ssrattr e2,
spriden z,
spriden u,
ssbsect
WHERE x.ROWID(+) =
f_get_instr_spriden_rowid (ssbsect_crn,
ssbsect_term_code,
'Y',
AND y.ROWID(+) =
f_get_instr_spriden_rowid (ssbsect_crn, ssbsect_term_code, '', 1)
AND z.ROWID(+) =
f_get_instr_spriden_rowid (ssbsect_crn, ssbsect_term_code, '', 2)
AND u.ROWID(+) =
f_get_instr_spriden_rowid (ssbsect_crn, ssbsect_term_code, '', 3)
AND ssbovrr_term_code(+) = ssbsect_term_code
AND ssbovrr_crn(+) = ssbsect_crn
AND a.scbcrse_subj_code = ssbsect_subj_code
AND a.scbcrse_crse_numb = ssbsect_crse_numb
AND a.scbcrse_eff_term =
(SELECT MAX (b.scbcrse_eff_term)
FROM scbcrse b
WHERE b.scbcrse_subj_code = ssbsect_subj_code
AND b.scbcrse_crse_numb = ssbsect_crse_numb
AND b.scbcrse_eff_term <= ssbsect_term_code)
AND k.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
1
AND l.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
2
AND m.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
3
AND n.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
4
AND o.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
5
AND p.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
6
AND q.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
7
AND r.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
8
AND s.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
9
AND t.ROWID(+) =
gvsuowner.f_get_ssrmeet_rowid_js (ssbsect_term_code,
ssbsect_crn,
10
AND f1.ROWID(+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
1
AND f2.ROWID(+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
2
AND f3.ROWID(+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
3
AND f4.ROWID(+) =
f_get_scrschd_rowid (ssbsect_subj_code,
ssbsect_crse_numb,
ssbsect_term_code,
4
AND e1.ssrattr_term_code(+) = ssbsect_term_code
AND e1.ssrattr_crn(+) = ssbsect_crn
AND e1.ssrattr_attr_code(+) = 'SWS'
AND e2.ssrattr_term_code(+) = ssbsect_term_code
AND e2.ssrattr_crn(+) = ssbsect_crn
AND e2.ssrattr_attr_code(+) LIKE 'TM%';
Thanks ,
IreneWelcome to the forums !
If this issue is not related to a database upgrade, pl post the question in the "SQL and PL/SQL" or "Database - General" forums for a better/faster response.
http://forums.oracle.com/forums/category.jspa?categoryID=18
HTH
Srini -
Suppress Target structure based on condition
Hi
How to suppress target structure based on condition
Example:
Source is like:
<Details>
<Name>abdc</Name>
<ID>234</ID>
<Address>US</Address>
</Details>
I have two target structures
1:
<Details>
<Name>abdc</Name>
<ID>234</ID>
<Address>US</Address>
</Details>
2:
<Error>
<ErrorID>
</Error>
if Any of the source filed is null then i dont want to map it to source structure. instead I want to assign an error id to ErrrorID node of the target.
example
abc,123,US
abc
in above case second record has two null values
so my target structure should be
<Details>
<Name>abc</Name>
<ID>123</ID>
<Address>US</Address>
</Details>
<Error>
<ErrorID>2nd record has erro</ErrorID>
</Error>
How to acheive this..
Please help us
Regards
Sowmyahi ,
plz try the following mapping
Name-->exist-->if than else-> tuue----->Name
false---(constant)--
error
ID-->exist-->if than else-> tuue----->ID
false---(constant)--
error
adress-->exist-->if than else-> tuue----->address
false---(constant)--
error
regards,
navneet -
Select records based on the closest given time
Dear SQL gurus,
I have a table T1:
Name Null? Type
ID NOT NULL NUMBER(5)
MOMENT NOT NULL DATE [DD.MM.YYYY HH24:MI]
MEASUREMENT NOT NULL NUMBER(8,3)
Example (ID, MOMENT, MEASUREMENT)
-- START OF EXAMPLE --
9380 18.11.2000 03:45 17.6
9380 18.11.2000 04:30 17.3
9380 18.11.2000 05:45 16.8
9380 18.11.2000 06:15 16.8
9380 18.11.2000 07:00 16.2
9380 18.11.2000 07:30 16.2
9380 18.11.2000 08:15 16
9380 18.11.2000 08:45 15.7
9380 18.11.2000 09:30 15.4
9380 18.11.2000 10:00 15.4
9380 18.11.2000 11:15 15.4
9380 18.11.2000 11:45 15.4
9380 18.11.2000 12:30 15.4
9380 18.11.2000 13:00 15.4
9380 18.11.2000 13:45 15.4
--- END OF EXAMPLE --
How to select records based on the:
- time period specified by the day only [DD.MM.YYYY] - CONDITION 1
- with values for 6AM only, and if not available, with values closest to 6AM - CONDITION 2
(if the time gap in MOMENT field is too big, lets say > 5h then choose the average between the value before 6AM (ex. 4:15AM) and the value after the 6AM (ex. 9:45AM))
CONDITION 1 (something like): moment between '01.01.2005' and '31.12.2004' - this is OK
CONDITION 2: I do not know how to formulate, especially if 6AM value is not availabe, and I have to find the closest available value, or get the avergae from the two adjacent values.
Maybe cursor magic??? Thanks a lot for your help.
RadoAbout condition two, would the following select be of use to you? Picking the first record could be achived by rownum, analytic function, etc.
WITH t1 AS (SELECT 9380 id, TO_DATE('18.11.2000 03:45', 'dd.mm.yyyy hh24:mi') moment, 17.6 measurement
FROM dual
UNION
SELECT 9380 id, TO_DATE('18.11.2000 04:30', 'dd.mm.yyyy hh24:mi') moment, 17.3 measurement
FROM dual
UNION
SELECT 9380 id, TO_DATE('18.11.2000 05:45', 'dd.mm.yyyy hh24:mi') moment, 16.8 measurement
FROM dual
UNION
SELECT 9380 id, TO_DATE('18.11.2000 06:15', 'dd.mm.yyyy hh24:mi') moment, 16.8 measurement
FROM dual
SELECT id, moment, measurement, diff
FROM (SELECT id, moment, measurement,
moment - TO_DATE(TO_CHAR(moment, 'dd.mm.yyyy ') || '06:00', 'dd.mm.yyyy hh24:mi') diff
FROM t1
ORDER BY abs(diff) asc, SIGN(diff) desc;
C. -
ABAP - HR : Need macro or FM to get record based on changed on date (AEDTM)
Hi,
I am having the requirement to get record which changed on yesterday (for sy-datum - 1). That means if record is updated today, by using rp_provide_from_last I will get today's record. But i should get yesterdays record.
we can get this by using select or loop or provide - endprovide. Taking performance issue in consideration, this statements are not allowed.
So please provide me any macro or function module which we can retrive the record based on AEDTM.
I am using PNPCE LDB and i need to extract data for PA infotypes.
Thanks in Advance,
Ravi KumarHi Ravi,
There is no macro which can retrieve the record based on AEDTM. One more thing to say is statement provide ...endprovide statement can be used and there would be no performance issue if i am not wrong. Anyway try this code.
tables: pa0001, pernr.
infotypes : 0001.
data : begin of itab occurs 0,
pernr like pa0001-pernr,
aedtm like pa0001-aedtm,
end of itab.
data : v_aedtm type pa0001-aedtm.
start-of-selection.
v_aedtm = sy-datum - 1.
get pernr.
provide * from p0001 between pn-begda and pn-endda.
if p0001-aedtm = v_aedtm.
move : p0001-pernr to itab-pernr,
p0001-aedtm to itab-aedtm.
append itab.
endif.
endprovide.
end-of-selection.
loop at itab.
write :/ itab-pernr, itab-aedtm.
endloop.
Regards,
Kranthi -
Display image based on conditions.
Hi every one.
We have to display image (circle) based on three conditions.
Example; if employee is < 1000 small circle, if salary is > 1000 and < 10000 medium size circle and >10000 big size circle.
And second condition if employee location is East coast fill black color in that circle, west coast red color central green color.
Third condition is if employee joining date is less than two years I should display * (Star symbol) in that circle.
I am trying to create conditional format but it is possible to display only one image .
My question is how can I change size and color if the image based on conditions and display start symbol with in the image.
I think I have to create different own images to display for every conditions.
Is there any way to create my report?
Thank you very much for your time and help.Hi,
If you want to display everything in one image for end user you need to do some trick.
sal orginal region orginal Joining date Sal decode value Region decode value Joining date decode value ImageCode
100 east 20\2\2008 1 10 100 111
200 WEST 20\2\2008 1 20 100 121
300 NORTH 20\2\2009 1 30 200 211
300 NORTH 20\2\2008 1 30 100 131
100 east 20\2\2008 1 10 100 111
2000 west 20\2\2009 2 20 200 222
30000 south 20\2\2009 3 40 200 243
Create few more columns in your answers, as following
Salary decode value: based on your original salary decode it to 1 or 2 or 3
region decode value: based on your regions decode it to 10 or 20 or 30 or 40
joining date decode value: based on joining date decode it to 100 or 200
Image code add all of decoded values ie 1+10+100 = 111
In report show image based on image code
i.e from above table row1 image code is 111 (small black circle), last record BigCircle Red with Star.
Pain full thing is you need to create 24 images on your own(3(salary range)*4(regions)*2(join dates) =24) and place all 24 conditions in that column.
--Hope it helped you
Thanks
Srinivas Malyala -
Info record based on lead time
How to create info record based on Lead time.
If vendor supplies material with in 5 days cost will be 5 dollars each
if he supplied after 5 days cost will be 3 dollars.
how to control this function in info record or in Purchase order or in Conditions.
Thanks
SUNIL KUMARclosed
Maybe you are looking for
-
MacBook Pro mid 2012 15" - one RAM slot gone bad
Hi, Has anyone ever had the issue with not working RAM slot? My MacBook Pro mid 2012 (non-retina) suddenly froze and after restart was beeping three times every few seconds. I found out that the beeping signals bad RAM. Bought new chips, and the prob
-
Problems connecting/syncing the new ipod touch to itunes
Hey there I have recently bought a new ipod touch 32gb 3g. Im running on windows 7, updated to the latest itunes (9.0.3.15). Im connecting the device with the usb, but i get noting Itunes show an ipod touch, but no sync. Heres the itunes diagnostic:
-
Equium A100-147 - Native resolution on external LCD doesn't work
Hi, My Equium A100-147 has 1 VGA and 1 S-Video output, so I'm using the VGA output on a external LCD monitor with native resolution of 1680x1050@60hz, but the integrated Intel 945 graphics card doesnt give me the right resolution to choose for this m
-
Design view is unavailable for x64 and ARM target platforms. - Visual Studio 2013 Update 3
Hello. I am having this problem at design view when i set project to x64. However problem disappear when i set to any cpu which makes it 32 bit. Design view is unavailable for x64 and ARM target platforms. Here my full XAML code <Window x:Class="dokt
-
I tried tonight to open photo booth but it has just a green screen. When I takea photo the camera button is red abd although it goes into countdown it take a green page as the photo. camera is working as it looks fine in ichat. I have trashed the pho