Picking unique records from huge set of records
Hi db experts,
Could anyone help me in having a query which is based on partitioned table with 400,00,000 records each day . It has member number unique and I want to pick unique ones say for dates between 20-jan-2007 and 20-apr-2007.
How can I proceed to write query. Am expecting query which will only pull unique records in less possible time.
Thanks in advance
Ravikanth
The table has 400 lakh records each day my mistake - I misread the original post.
Is this a one-off exercise or an ongoing requirement? What are you going to do with the data once you've got it - do you need more columns than the numbers? Do you have a feel for how many unique numbers there are per day and over the entire quarter?
The easiest way to do this would probably be to create an extract table (maybe a temporary one) and vary the query I posted to insert the unique numbers into this table for each day i.e. run it multiple times against a smaller data set. Then you can select the unique numbers from the extract table to get the finished set.
Of course, whether this is a viable solution depends on the answers to the questions I posed above. The more information you give us the easier it is for us to advise you.
Cheers, APC
Similar Messages
-
How get all record from master and matching record from detail
hi master
sir i have master detail table
i have many record in master table but some record in detail table how i get
all record from master and matching record from detail
such as
select m.accid,m.title,d.dr,d.cr from master m, detail d where m.accid=d.accid
this query not work that get only related record i need all record from master
please give me idea
thanking you
aamirhi master
sir i have master detail table
i have many record in master table but some record in
detail table how i get
all record from master and matching record from
detail
such as
select m.accid,m.title,d.dr,d.cr from master m,
detail d where m.accid=d.accid
this query not work that get only related record i
need all record from master
please give me idea
thanking you
aamir
select m.accid,m.title,d.dr,d.cr
from master m, detail d
where m.accid=d.accid (+)The outer join operator (+) will get you all the details from master and any details from the detail if they exist, but the master details will still be got even if there are not details.
Note: Oracle 10g now supports ANSI standard outer joins as in:
select m.accid,m.title,d.dr,d.cr
from master m LEFT OUTER JOIN detail d on m.accid=d.accid -
I want to diaplay my records from the databasewith 10 records per page. i l
i want to diaplay my records from the databasewith 10 records per page. i learned that it can be done through pagination . Please can anyone there help me and give me the code of how to page my records in my jsp pages
I have small code ,but its not working....
below is the code....
public ResultSet codeResult(int i){
if(dataSource!= null){
try {
con=dataSource.getConnection();
stmt=con.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY);
int maxRows=stmt.getMaxRows();
System.out.println("the maxRows is:"+maxRows);
System.out.println("the I value is:"+i);
if((i < 0) || (i > maxRows)){
i=0;
stmt.setFetchSize(i);
long t = System.currentTimeMillis();
rs=stmt.executeQuery("select asc_code,countrycode,asc_name,asc_address1,asc_address2,asc_city,asc_country,asc_region,asc_contact_person,asc_contact_no,asc_email_id,asc_fax_no,nso_incharge,nso_email,ar_ap_code from asc_master order by asc_code asc");
but,its giving all records...
any one help me on this........
Thank you,
D.Nagireddy.
} catch (SQLException e) {
e.printStackTrace();
return rs;
}hey, here my code for paging. hope it helps...
public void DueRecordInfo(int page,int MAX_PER_PAGE)
con = new DBConnection().getConnection();
try
Statement stmt = con.createStatement();
String sqlcount = "SELECT COUNT(*) FROM INFO WHERE TO_DATE(DATEUPDATED,'Month DD, YYYY') < ADD_MONTHS(SYSDATE,-6) AND OBSOLETE LIKE 'No'";
ResultSet rscount = stmt.executeQuery(sqlcount);
rscount.next();
total_row_count = rscount.getInt(1);
lowerbound = (page * MAX_PER_PAGE - (MAX_PER_PAGE))+1;
upperbound = lowerbound - 1 + MAX_PER_PAGE;
String sql = "Select * from "+
"(SELECT row_number() over(ORDER BY TO_DATE(DATEUPDATED,'Month DD, YYYY') DESC) AS RN,ID,SPECNO,REVISEDNO,DATEREVISED,TITLE,ORIGINATOR,DCBNUMBER,DCBLOCATION,OBSOLETE,DATEOBSOLETE,WORDFILE,PDFFILE,DATEUPDATED FROM INFO WHERE TO_DATE(DATEUPDATED,'Month DD, YYYY') < ADD_MONTHS(SYSDATE,-6) AND OBSOLETE LIKE 'No') " +
"WHERE RN BETWEEN "+ lowerbound + " AND " +upperbound;
ResultSet rs = stmt.executeQuery(sql);
while (rs.next())
id.add(num, rs.getString("ID"));
specno.add(num, rs.getString("SPECNO"));
revisedno.add(num, rs.getString("REVISEDNO"));
daterevised.add(num, rs.getString("DATEREVISED"));
title.add(num, rs.getString("TITLE"));
originator.add(num, rs.getString("ORIGINATOR"));
dcbnumber.add(num, rs.getString("DCBNUMBER"));
dcblocation.add(num, rs.getString("DCBLOCATION"));
obsolete.add(num, rs.getString("OBSOLETE"));
dateobsolete.add(num, rs.getString("DATEOBSOLETE"));
wordfile.add(num, rs.getString("WORDFILE"));
pdffile.add(num, rs.getString("PDFFILE"));
dateupdated.add(num, rs.getString("DATEUPDATED"));
num++;
con.close();
rscount.close();
rs.close();
stmt.close();
} -
Find first record in a set of record
I want to find first record in a set of record .What built in function shall i use and which trigger should I use.Please help.
Hi,
First_record takes you to the position of that first record, but doesn't gives you the value of the record, you have to get it form the :block_name.item_name
Jose. -
Join Table from a set of records
I will try to explain the best I can...
In the first code; I have assigned my UNION result set to BCALC.
How do I modify the second query so I will get all records from BCALC and all filtered records from second query in one result set?
First Query:
SELECT * FROM (
SELECT bc.SpecId, bc.EmpNo, e.LastName, e.FirstName, rcd.EarningsCode, bc.FinalPayoutDollars, eh.CompanyNo,
FROM Speculations bc, Employees e, RoleCodeDefs rcd, PeriodDefs p, EmpHist eh, vw_RollupPortfolios rp
WHERE
bc.EmpNo=e.EmpNo
AND bc.PeriodId=p.PeriodId
AND bc.RoleCode = rcd.RoleCode
UNION
SELECT bc.SpecId, bc.EmpNo, e.LastName, e.FirstName, rcd.EarningsCode, bc.FinalPayoutDollars, c.CompanyNo,
FROM Speculations bc, Employees e, RoleCodeDefs rcd, dbo.afn_CommunityLookup() c
WHERE
bc.EmpNo=e.EmpNo
AND bc.PeriodId=p.PeriodId
AND bc.RoleCode = rcd.RoleCode
AND bc.RoleCode <> 'MS'
) BCALC
Second Query:
select 'IBDX' AS EarningsCode,
ROUND(BCALC.FinalPayoutDollars * dbo.udsf_GetInfo(BCALC.EmpNo, otpr.PeriodStartDate), 2) as FinalPayoutDollars
from otprhours otpr, BCALC
WHERE otpr.EmpNo=BCALC.EmpNoQuery1 returns record from two select statement; I need to insert new records (or UNION) in it form Query2 which contains a field reference to Query1 and a where clause (Query1.EmpNo = Query2.EmpNo).
Basically, for each EmpNo in Query1; look into Query2. If EmpNo matches; insert a new record in Query1 with the values of EarningsCode and FinalPayoutDollars as in Query2.
Query1:
SELECT bc.SpecId, bc.EmpNo, e.LastName, e.FirstName, rcd.EarningsCode, bc.FinalPayoutDollars, eh.CompanyNo,
FROM Speculations bc, Employees e, RoleCodeDefs rcd, PeriodDefs p, EmpHist eh, vw_RollupPortfolios rp
WHERE
bc.EmpNo=e.EmpNo
AND bc.PeriodId=p.PeriodId
AND bc.RoleCode = rcd.RoleCode
UNION
SELECT bc.SpecId, bc.EmpNo, e.LastName, e.FirstName, rcd.EarningsCode, bc.FinalPayoutDollars, c.CompanyNo,
FROM Speculations bc, Employees e, RoleCodeDefs rcd, dbo.afn_CommunityLookup() c
WHERE
bc.EmpNo=e.EmpNo
AND bc.PeriodId=p.PeriodId
AND bc.RoleCode = rcd.RoleCode
Query2:
SELECT 'IBDX' AS EarningsCode,
ROUND(Query1.FinalPayoutDollars * dbo.udsf_GetInfo(Query1.EmpNo, otpr.PeriodStartDate), 2) as FinalPayoutDollars
from otprhours otpr, Query1
WHERE otpr.EmpNo=BCALC.EmpNo -
How to select a row from duplicate set of records?
I want to select a row from a duplicate set of records.
below is the explanation of my requirement.
select * from test_dup;
COL_BILL COL_SERV COL_SYS
b1 s1 c
b1 s1 g
b1 s2 c
b1 s2 g
b2 s2 g
b2 s3 c
b2 s3 g
b3 s3 c
Here what I want is, for a distinct col_sys if col_bill and col_serv is same then I need the row where col_sys='c'
from the above result set I need the following:
b1 s1 c
b1 s2 c
b2 s3 c
I am using the following SQL query which is giving me the correct result set. But it will hamper the performance because there are total 45 columns in the table and total volume is around 50 million.
select * from test_dup where col_bill||col_serv in (
select col_bill||col_serv from (
select col_bill,col_serv,count(*) from test_dup
where col_sys in ('c','g')
group by col_bill,col_serv having count(*) >1)) and
col_sys='c';
Can anyone please provide me the optimize SQL query for the same.Hi,
Another way,
SQL> with test_dup
as
select 'b1' col_bill, 's1' col_serv, 'c' col_sys from dual union all
select 'b1', 's1', 'g' from dual union all
select 'b1', 's2', 'c' from dual union all
select 'b1', 's2', 'g' from dual union all
select 'b2', 's2', 'g' from dual union all
select 'b2', 's3', 'c' from dual union all
select 'b2', 's3', 'g' from dual union all
select 'b3', 's3', 'c' from dual
select col_bill, col_serv, min(col_sys) col_sys
from test_dup
where col_sys in ('c', 'g')
group by col_bill, col_serv
having count( * ) > 1
and count(nullif(col_sys, 'g')) > 0;
CO CO C
b1 s1 c
b2 s3 c
b1 s2 c
3 rows selected.Regards
Peter
Edited by: Peter on Feb 18, 2009 1:10 AM
- Added test data, thanks Karthick -
Extracting unique records from two different tables record
Hello,
In the following code of two different tables www.testing.com exists in both tables. I want to compare two different columns of the two different tables to get unique records.
SQL> select unique(videoLinks) from saVideos where sa_id=21;
VIDEOLINKS
www.testing.com
SQL> ed
Wrote file afiedt.buf
1* select unique(picLinks) from saImages where sa_id=21
SQL> /
PICLINKS
test
test14
www.hello.com
www.testing.comThanks & best regardsUnfortunatly you didn't mention the expected output. I guess it would be the one line
"www.testing.com"
in that case simply join the two tables.
select *
from saVideos v
join saImages i on i.sa_id = v.sa_id and i.picLinks = v.videoLinks
where v.sa_id=21;If needed then you could change the select list to retrieve only distinct values.
select unique v.sa_id, v.videolinks
from saVideos v
join saImages i on i.sa_id = v.sa_id and i.picLinks = v.videoLinks
where v.sa_id=21;I usually avoid distinct/unique whereever possible. This requires the database to do a sort and makes the query slow.
Edited by: Sven W. on Feb 10, 2011 1:55 PM -
DTP does not fetch all records from Source, fetches only records in First Data Package.
Fellas,
I have a scenario in my BW system, where I pull data from a source using a Direct Access DTP. (Does not extract from PSA, extracts from Source)
The Source is a table from the Oracle DB and using a datasource and a Direct Access DTP, I pull data from this table into my BW Infocube.
The DTP's package size has been set to 100,000 and whenever this load is triggered, a lot of data records from the source table are fetched in various Data packages. This has been working fine and works fine now as well.
But, very rarely, the DTP fetches 100,000 records in the first data package and fails to pull the remaining data records from source.
It ends, with this message "No more data records found" even though we have records waiting to be pulled. This DTP in the process chain does not even fail and continues to the next step with a "Green" Status.
Have you faced a similar situation in any of your systems? What is the cause? How can this be fixed?
Thanks in advance for your help.
Cheers
ShivaHello Raman & KV,
Thanks for your Suggestions.
Unfortunately, I would not be able to implement any of your suggestions because, I m not allowed to change the DTP Settings.
So, I m working on finding the root cause of this issue and came across a SAP Note - 1506944 - Only one package is always extracted during direct access , which says this is a Program Error.
Hence, i m checking more with SAP on this and will share their insights once i hear back from them.
Cheers
Shiva -
Selecting Records from one table where records don't exist in a linked table
Post Author: RMC
CA Forum: Crystal Reports
Tables:
Stock (Main Table)
Transactions (Left Outer Join)
Criteria:
Select all items with no transactions between a selected date range.
The items will exist in Main table but I want to select all items that haven't been in a transaction between a date range so I can identify no movement with stock items just sitting in the database doing nothing.
Any suggestions??Post Author: yangster
CA Forum: Crystal Reports
Sorry for the delay. Dam meetings all day yesterday.You are essentially looking for something that doesn't exist in the db so you need to look at it from a different approach.You definitely don't want to use a full outer join. From what i can tell from your description above you are looking for stocks that are inactive/idle.So you need not look at data that doesn't exist but the last activity date.So you'd want something along the lines ofselect s.stock_name, s.stock_blah, max(t.transaction_date) Transaction_datefrom stocks sjoin transactions t on s.itemid = t.itemidwhere whatever restrictions you need to addgroup by s.stock_name, s.stock_blahthis will produce one record for each stock you have in the stock table showing you only the last date of activityput that in a command in crystalin the selection expert in crystal reports put in a simple criteriatransaction_date <= some datethis will only pull in records based on your date selection so if you say give me all records from dec 31, 2006 you will know all the records being pulled in are stocks that have been idle since dec 31, 2006 or earlierlet me know if this doesn't work -
How urgent:how can we know the size of a record from result set
hi proffesionals i attend on problum with arrangment,for that what i am doing is i am fetching datas from database and printing in a row vertically.it is not looking good.i want to print it horizontaly like
ae00023 as3333 a6556 a457864 a6576
ae00025 as3336 a6556 a457866 a6578
i wrote the coding like
<%while(resultsetdisplay.next())
{%>
// try to print the datas in horizontal way
<tr>
for (int i=index;i<resultsetdisplay.getFetchSize()-10;i--)
<td class=display><%=resultsetdisplay.getObject(4)%></td>
int i=index;
</tr>
<%}%>
is it prints horizontaly.
help me soonHi
You can the Meta Data for the result set and then get the getColumnCount() from the MataData to get the number of columns in the resultset.
Bye -
How to find a string from a set of records?
I am having a stored procedure which is used for creating a crystal report. When I run the stored procedure sometimes it gives more than one row of data. I want to check if a particular string exists in any row of a particular column. To make it clear let me give an example
When I run the query I get the below columns
Part Part type
A001 Blanket
A002 Blanket
A003 Toys
What I want to check is if Toys is appearing in any of the row in a formula in crystal reports.
Thanks
Sreejith JHi,
If you want to check a particular sub string or part of a string within a string, you can try this:
if instr(<database column>, <String to be searched>) = 1 then true
So, your formula output will be true if the <string to be searched> is part of your <database field>.
Thanks,
Raghavendra -
Recording from external mic while recording music from internal device?
Not sure where to ask this? I'm rather new to MAC. I was under the impression GARAGE BAND would be able to record my vocals from an external mic while playing an audio either from an internal mp3 or CD? I don't see how if so?
I simply wish to record vocals over an instrumental song from mp3 or CD, but I am unsure how to do this on my IMAC? On my old PC, I was able to just use WINAMP to play whatever audio while recording my vocals over it with COOL EDIT? Is there some thing I'm missing here? Can I do this with Garage band or what do I need to get to do this?
Also, I've plugged my external mic in, went into my preferences to set "audio line in" and it doesn't pick up my voice? What am I doing wrong?
Thanks in advanceHi Wil3,
Best place would be to ask this question in the GarageBand forum which you can find here:
http://discussions.apple.com/forum.jspa?forumID=1120
Kryten -
I can't seem to get GarageBand to recognize my Behringer X1222 USB Mixer. It will record, but only on the generic "USB Input, without seeing or letting me select the input channel from the mixer. Can't find any drivers from Behringer. How do I getGB to "see" the mixer? Thanks, I'm a newbie to Macs in genreal, and recording...
viiram wrote:
It will record, but only on the generic "USB Input, without seeing or letting me select the input channel from the mixer.
the x1222 includes a 2 channel audio interface, 2 channels are all you can get from it.
the most you can do is record to 2 tracks at a time; skim this tute to see how:
http://www.bulletsandbones.com/GB/Tutorials.html#allaboutrecording2tracks
(Let the page FULLY load. The link to your answer is at the top of your screen) -
Split R3 table's records into detailed set of records for extracting to BI
Hello, everybody,
In R3 table i have records:
<i>Document_numberA-Material_numberA-Date1-Date2-Date3-Amount1-Amount2---Amount3</i>
I have extract data to BI ODS in format:
<i>Document_numberA-Material_numberA-Date1---Amount1
Document_numberA-Material_numberA-Date2---Amount2
Document_numberA-Material_numberA-Date3---Amount3</i>
<i>Document_numberB-Material_numberB-Date1---Amount1</i>
How i have define extractor and loading mechanism?
Could you give me a suggestion?
Thanks in advance.
Best Regards,
Arunas StonysHello, everybody,
I have created a START ROUTINE, but it doesn't replaces <b>YEARS</b> and <b>AMOUNTS</b>.
<b>Code:</b>
PROGRAM trans_routine.
CLASS routine DEFINITION
CLASS lcl_transform DEFINITION.
PUBLIC SECTION.
Attributs
DATA:
p_check_master_data_exist
TYPE RSODSOCHECKONLY READ-ONLY,
*- Instance for getting request runtime attributs;
Available information: Refer to methods of
interface 'if_rsbk_request_admintab_view'
p_r_request
TYPE REF TO if_rsbk_request_admintab_view READ-ONLY.
PRIVATE SECTION.
TYPE-POOLS: rsd, rstr.
Rule specific types
TYPES:
BEGIN OF tys_SC_1,
Field: BANFN Paraikos nume..
BANFN TYPE C LENGTH 10,
Field: BANFPO Paraikos pozc..
BANFPO TYPE N LENGTH 5,
Field: TXZ01 Pavadinimas.
TXZ01 TYPE C LENGTH 40,
Field: FISTL Lėų centras.
FISTL TYPE C LENGTH 16,
Field: FKBER Programa.
FKBER TYPE C LENGTH 16,
Field: FIPOS Biud.straips..
FIPOS TYPE C LENGTH 14,
Field: GEBER Finan. altinis.
GEBER TYPE C LENGTH 10,
Field: FIPEX Straipsnis.
FIPEX TYPE C LENGTH 24,
Field: ZZYEAR1 Metai 1.
ZZYEAR1 TYPE N LENGTH 4,
Field: ZZYEAR2 Metai 2.
ZZYEAR2 TYPE N LENGTH 4,
Field: ZZYEAR3 Metai 3.
ZZYEAR3 TYPE N LENGTH 4,
Field: ZZSUM1 Suma 1.
ZZSUM1 TYPE P LENGTH 7 DECIMALS 2,
Field: ZZSUM2 Suma 2.
ZZSUM2 TYPE P LENGTH 7 DECIMALS 2,
Field: ZZSUM3 Suma 3.
ZZSUM3 TYPE P LENGTH 7 DECIMALS 2,
Field: WAERS Valiuta.
WAERS TYPE C LENGTH 5,
Field: BSART Paraikos tipas.
BSART TYPE C LENGTH 4,
Field: ERDAT Pakeista.
ERDAT TYPE D,
Field: RECORD Record Number.
RECORD TYPE RSARECORD,
END OF tys_SC_1.
TYPES:
tyt_SC_1 TYPE STANDARD TABLE OF tys_SC_1
WITH NON-UNIQUE DEFAULT KEY.
$$ begin of global - insert your declaration only below this line -
... "insert your code here
$$ end of global - insert your declaration only before this line -
METHODS
start_routine
IMPORTING
request type rsrequest
datapackid type rsdatapid
EXPORTING
monitor type rstr_ty_t_monitors
CHANGING
SOURCE_PACKAGE type tyt_SC_1
RAISING
cx_rsrout_abort.
METHODS
inverse_start_routine
IMPORTING
i_th_fields_outbound TYPE rstran_t_field_inv
i_r_selset_outbound TYPE REF TO cl_rsmds_set
i_is_main_selection TYPE rs_bool
i_r_selset_outbound_complete TYPE REF TO cl_rsmds_set
i_r_universe_inbound TYPE REF TO cl_rsmds_universe
CHANGING
c_th_fields_inbound TYPE rstran_t_field_inv
c_r_selset_inbound TYPE REF TO cl_rsmds_set
c_exact TYPE rs_bool.
ENDCLASS. "routine DEFINITION
$$ begin of 2nd part global - insert your code only below this line *
... "insert your code here
$$ end of 2nd part global - insert your code only before this line *
CLASS routine IMPLEMENTATION
CLASS lcl_transform IMPLEMENTATION.
Method start_routine
Calculation of source package via start routine
<-> source package
METHOD start_routine.
*=== Segments ===
FIELD-SYMBOLS:
<SOURCE_FIELDS> TYPE tys_SC_1.
DATA:
MONITOR_REC TYPE rstmonitor.
*$*$ begin of routine - insert your code only below this line *-*
... "insert your code here
DATA:
ls_SOURCE_PACKAGE type tys_SC_1,
lt_SOURCE_PACKAGE like table of ls_SOURCE_PACKAGE,
l_tabix like sy-tabix.
loop at SOURCE_PACKAGE into ls_SOURCE_PACKAGE.
l_tabix = sy-tabix.
ls_SOURCE_PACKAGE-BANFN = ls_SOURCE_PACKAGE-BANFN.
ls_SOURCE_PACKAGE-BANFPO = ls_SOURCE_PACKAGE-BANFPO.
ls_SOURCE_PACKAGE-TXZ01 = ls_SOURCE_PACKAGE-TXZ01.
ls_SOURCE_PACKAGE-FISTL = ls_SOURCE_PACKAGE-FISTL.
ls_SOURCE_PACKAGE-FKBER = ls_SOURCE_PACKAGE-FKBER.
ls_SOURCE_PACKAGE-FIPOS = ls_SOURCE_PACKAGE-FIPOS.
ls_SOURCE_PACKAGE-GEBER = ls_SOURCE_PACKAGE-GEBER.
ls_SOURCE_PACKAGE-FIPEX = ls_SOURCE_PACKAGE-FIPEX.
ls_SOURCE_PACKAGE-WAERS = ls_SOURCE_PACKAGE-WAERS.
ls_SOURCE_PACKAGE-BSART = ls_SOURCE_PACKAGE-BSART.
ls_SOURCE_PACKAGE-ERDAT = ls_SOURCE_PACKAGE-ERDAT.
ls_SOURCE_PACKAGE-RECORD = ls_SOURCE_PACKAGE-RECORD.
ls_SOURCE_PACKAGE-ZZYEAR1 = ls_SOURCE_PACKAGE-ZZYEAR1.
ls_SOURCE_PACKAGE-ZZSUM1 = ls_SOURCE_PACKAGE-ZZSUM1.
append ls_SOURCE_PACKAGE to lt_SOURCE_PACKAGE.
ls_SOURCE_PACKAGE-ZZYEAR1 = ls_SOURCE_PACKAGE-ZZYEAR2.
ls_SOURCE_PACKAGE-ZZSUM1 = ls_SOURCE_PACKAGE-ZZSUM2.
append ls_SOURCE_PACKAGE to lt_SOURCE_PACKAGE.
ls_SOURCE_PACKAGE-ZZYEAR1 = ls_SOURCE_PACKAGE-ZZYEAR3.
ls_SOURCE_PACKAGE-ZZSUM1 = ls_SOURCE_PACKAGE-ZZSUM3.
append ls_SOURCE_PACKAGE to lt_SOURCE_PACKAGE.
delete SOURCE_PACKAGE index l_tabix.
endloop.
move lt_SOURCE_PACKAGE[] to SOURCE_PACKAGE[].
*-- fill table "MONITOR" with values of structure "MONITOR_REC"
*- to make monitor entries
... "to cancel the update process
raise exception type CX_RSROUT_ABORT.
$$ end of routine - insert your code only before this line -
ENDMETHOD. "start_routine
Method inverse_start_routine
This subroutine needs to be implemented only for direct access
(for better performance) and for the Report/Report Interface
(drill through).
The inverse routine should transform a projection and
a selection for the target to a projection and a selection
for the source, respectively.
If the implementation remains empty all fields are filled and
all values are selected.
METHOD inverse_start_routine.
$$ begin of inverse routine - insert your code only below this line-
... "insert your code here
$$ end of inverse routine - insert your code only before this line -
ENDMETHOD. "inverse_start_routine
ENDCLASS. "routine IMPLEMENTATION
<b>Could you look at code and tell what is wrong?</b>
Thanks in advance!
Best Regards,
Arunas Stonys
Arunas Stonys -
How do I add a subset of records to a set of records?
I have a result set of consultants and branch offices and I need to add a subset of employees to each branch office.
I added an Employee[ ] subset to my consultant getter/setters. A PL/SQL package returns a cursor result set
of consultants and branch offices and another cursor result set of employees. Each employee is assigned an
office ID and each consultant and branch office is assigned an office ID.
I am unsure in Java how to traverse the employee result set to get each subset of employees with the correct office.
Here is the code that calls the PL/SQL and loads my vector array with consultants and branch offices:
public Consultant[] getConsultants(String pvConsultant_Firm,
String pvAddr_City_Main,
String pvAddr_State_Main,
String pvAddr_Zip_Main,
String pvAddr_City_Branch,
String pvAddr_State_Branch,
String pvAddr_Zip_Branch,
String pvResidency,
String pvFirst_Name,
String pvLast_Name,
String pvOrder_By_Office,
String pvOrder_By_Employee,
String display_Branch,
String display_Employee)
Vector retval = new Vector();
DBConnection conn = new DBConnection();
CallableStatement cstmt = conn.prepareCall("begin " + PACKAGE + "Get_Consultant_Cursors(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);end;");
ResultSet rsConsultant;
ResultSet rsEmployee;
Consultant curConsult;
Employee curEmployee;
try
if(cstmt!=null)
String Consult_Type = null;
if ("true".equalsIgnoreCase(display_Branch) ||
"true".equalsIgnoreCase(display_Employee)){
Consult_Type = null;
else {
Consult_Type = "MAIN";
cstmt.setString("pvConsultant_Firm", pvConsultant_Firm);
cstmt.setString("pvOffice_Type", Consult_Type);
cstmt.setString("pvAddr_City_Main", pvAddr_City_Main);
cstmt.setString("pvAddr_State_Main", pvAddr_State_Main);
cstmt.setString("pvAddr_Zip_Main", pvAddr_Zip_Main);
cstmt.setString("pvAddr_City_Branch", pvAddr_City_Branch);
cstmt.setString("pvAddr_State_Branch", pvAddr_State_Branch);
cstmt.setString("pvAddr_Zip_Branch", pvAddr_Zip_Branch);
cstmt.setString("pvResidency", pvResidency);
cstmt.setString("pvFirst_Name", pvFirst_Name);
cstmt.setString("pvLast_Name", pvLast_Name);
cstmt.setString("pvOrder_By_Employee", pvOrder_By_Employee);
cstmt.setString("pvOrder_By_Office", pvOrder_By_Office);
cstmt.registerOutParameter("pcurConsultant_Office", OracleTypes.CURSOR);
cstmt.registerOutParameter("pcurConsultant_Employee", OracleTypes.CURSOR);
cstmt.execute();
rsConsultant = (ResultSet)cstmt.getObject("pcurConsultant_Office");
rsEmployee = (ResultSet)cstmt.getObject("pcurConsultant_Employee");
while(rsConsultant.next())
curConsult = getConsultant(rsConsultant);
retval.add(curConsult);
if ("true".equalsIgnoreCase(display_Employee)){
HOW DO I HANDLE THIS?
rsConsultant.close();
conn.closeCstmt(cstmt);
catch (SQLException e)
conn.logToFile(this, "getConsultants()", e);
conn.close();
return (Consultant[])retval.toArray(new Consultant[retval.size()]);
}It will basically look something like this:
Consultant A Main Office
Employee 1
Employee 2
Employee 3
Branch A
Employee 4
Employee 5
Branch B
Employee 6
Employee 7
Consultant B Main Office
Employee 8
Employee 9
Branch A
Employee 10
Employee 11The consultant and branch offices are in one result set and the employees are in another. I need to combine them
so I can return them and display them as above in my JSP.
Maybe you are looking for
-
Resource planning in cprojects with xRPM or MRS?
Dear Experts, To my understanding there are four options to perform resource planning in combination with cprojects: 1. Do a planning in cprojects only 2. Use resource planning application (RPA) from SAP CRM 3. Schedule resources with xRP
-
BAPI function module name and mandatory fields
Give the name of BAPI function module for pricing change into the transaction VA05 ? What are the mandatory fields ? Please give a exemple code to do this.
-
ATV 1st gen use with a DVI monitor?
I am trying to use my old 1st Gen Apple TV as an digital announcements unit at my church. It looks like the ATV only allows 480p, 720p and 1080i resolution. I am trying to use a 17" monitor with DVI & 1280x1024 resolution. Any suggestions on how to m
-
Password doesn't work when connecting other devices
I have tried several hundred times and I can't connect any other devices to my wireless network using the password. I am using the router password. Is that the correct password. Just got a android phone and woud like to be able to use my wireless net
-
Error while entering number range
Dear All While entering number ranges for Assets using t-code AS08 i am getting the following error: Company code........ 2000 does not exist Message no. NR011 The company code 2000 is assigned to Chart of depreciation also. Please advice. Thanks & R