How to build table join query in Jdeveloper
Hi,
Can someone tell me how to build table join query in Jdeveloper's Expression Builder UI?
[Is it possible to create a table of contents in Crystal Reports?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313335333133303330%7D.do]
Similar Messages
-
How to build Table of Content in Crystal Reports
Hi,
Initially, I am looking for an article about how to build Table of Content in Crystal Reports in table-based approach----including how to write to DB table from report:
http://support.businessobjects.com/library/kbase/articles/c2011950.asp
However, the link above is invalid. I also searched through SDN articles, but no luck.
Can someone please forward me the link if you happend to know?---does not have to link to this specific article, any working solution is just fine.
I am aware of another approach which put the TOC to the end of the report(http://www.ml-consult.co.uk/cryst-05.htm), which probably does not satisfy the requirement.
If you have other solutions, your share is greatly appreciated.
Thanks a ton![Is it possible to create a table of contents in Crystal Reports?|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233313335333133303330%7D.do]
-
How to build a WEBI query on a SAP NANA OLAP connection?
hi fellows,
we all know that a relational connection can be built to SAP HANA database, and we build data foundation, biz layer to publish it to the repository, so that we can create a WEBI report based on a query to visit the universe.
However, does anybody know how to create a WEBI query on a SAP HANA OLAP connection? Since we don't need to build any data foundation on it.
I created a sap hana olap connection, but failed to find anywhere to publish it? Can anybody help?
thanks,
JenniferHi Jennifer,
Check SCN thread http://scn.sap.com/thread/3493857.
Also check below for Creating a SAP Universe on HANA: Best Practics.
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00922ede-de2f-2f10-c2aa-f9b0f6495d34?overridelayout=t…
Regards,
JC -
How to define table specific QUERY in parameter file for Export Utility
Hi All
I am trying to create A SINGLE parameter file for export utility. I have 2 tables and want to use a different QUERY condition for each of these tables. However i do not want to create 2 seperate parameter files for this and run/script exp twice.
Is there a way to do it ?
NOTE: I am using normal export utility for Version 9 and NOT oracle data pump.
Following is an example of what i want to achive in parameter file:
Tables = (TabA,TabB)
# for table - TabA
QUERY = "where id =25"
#for table - TabB
QUERY = " where court_id=54 and id >1"
Please advice on syntax of parameter file so that exp knows that it has to process 1st condition for only TabA and second condition for TabB.
Any samples/syntax examples are greately appreciated.
thanks in advance!
cool techNo there is no such alternative. Query condition is applicable to all the tables listed in TABLES parameter.
http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch01.htm#1005843 -
Table name stored in another table and how to Build the Dynamic Query
TblMasterTable
Id
Unqid
Tbl_TemplateNameid
Tbl_Template1
Unqid
Field1
Filed2
Tbl_Template2
Unqid
Field1
Filed2
Filed3
Tbl_Template3
Unqid
Field1
Filed2
Filed3
Filed4
Filed5
TblMasterTable contains the reference for the table names.
TblMasterTable contains the data
1 12 Tbl_Template1
2 22 Tbl_Template2
3 12 Tbl_Template1
4 343 Tbl_Template3
I want to build the query to retrieve all the Template table records based on the TblmasterTable data for a given id.This is possible but you need to understand the performance implications of Dynamic SQL before proceeding with this approach.
<br>
use this logic:<br>
declare sqlstring varchar2(500):=null <br>
select 'select stuff from '|| tbl_templatenameid into sqlstring from MasterTable where id=someid;<br>
execute immediate sqlstring;
<br>
<br>
I have really seen very few cases where this approach is justified.
<br>
<br>
Dave<br>
lehr.servehttp.com -
How to build dynamic select query
Using the ZCO_SETTLE_CHK-REC_FIELD and DISTRIBUTION_RULE-KONTY write a dynamic select single query <table>-<field name> e.g. <COAS>- <AUART> on the <table> e.g. <COAS>. If the DISTRIBUTION_RULE-KONTY is u2018ORu2019, then use DISTRIBUTION_RULE-AUFNR value in the where clause of the query to fetch the ZCO_SETTLE_CHK-REC_FIELD value maintained in the <table>-<field name>. If DISTRIBUTION_RULE-KONTY = u2018KSu2019 or u2018PRu2019 use DISTRIBUTION_RULE-KOSTL or DISTRIBUTION_RULE- PS_PSP_PNR respectively in the where clause to fetch the values.
For above how we can build dynamic queryHi,
Refer the below code which helps to design a dynamic where condition.
IF NOT p1 IS INITIAL.
CLEAR : lv_p1_condition.
CONCATENATE 'F1' ' = ' '''' p1 '''' INTO
lv_p1_condition.
ENDIF.
IF NOT p2 IS INITIAL.
CLEAR : lv_p2_condition.
CONCATENATE 'F2' ' = ' '''' p2 '''' INTO
lv_p2_condition.
ENDIF.
IF NOT p3 IS INITIAL.
CLEAR : lv_p3_condition.
CONCATENATE 'F3' ' = ' '''' p3 '''' INTO
lv_p3_condition.
ENDIF.
IF NOT lv_p1_condition IS INITIAL.
CONCATENATE lv_p1_condition lv_condition
INTO lv_condition SEPARATED BY space.
ENDIF.
IF NOT lv_p2_condition IS INITIAL.
IF lv_condition IS INITIAL.
CONCATENATE lv_p2_condition lv_condition
INTO lv_condition SEPARATED BY space.
ELSE.
CONCATENATE lv_condition 'AND' lv_p2_condition
INTO lv_condition SEPARATED BY space.
ENDIF.
ENDIF.
IF NOT lv_p3_condition IS INITIAL.
IF lv_condition IS INITIAL.
CONCATENATE lv_p3_condition lv_condition
INTO lv_condition SEPARATED BY space.
ELSE.
CONCATENATE lv_condition 'AND' lv_p3_condition
INTO lv_condition SEPARATED BY space.
ENDIF.
ENDIF.
SELECT * FROM link INTO wa
WHERE lv_condition . -
Table joining query with dates
Hello,
I have two tables, one containing a list of pupils, their class start date and their class end dates. The second table contains the address (postcode) history of the pupil. I need to bring these two tables together into one query to show all the classes from the 'pupils' table and add in the most recent postcode of the address prior to the start date of the clasS from the 'addresses' table. I.e. to show where the pupil lived when they started the class.
Could anyone show me how to do this please? I've provided a 'desired' table to show what I need the results to look like.
I hope this is clear, please ask if it isn't - I'm sure this should be simple! But I can't get my head around it. I'm using Oracle 9i and SQL Developer.
Thanks :)
select pupils.* from
(select 'A227' as pupil_id, to_date('21/04/2010','dd/mm/rrrr') class_start, to_date('21/09/2010','dd/mm/rrrr') class_end from dual union all
select 'A227' as pupil_id, to_date('08/08/2011','dd/mm/rrrr'), to_date('26/10/2011','dd/mm/rrrr') from dual ) pupils
select addresses.* from
(select 'A227' as pupil_id, to_date('20/04/2010','dd/mm/rrrr') address_start, null address_end, 'TW1 XVT' as postcode from dual union all
select 'A227' as pupil_id, to_date('03/08/2011','dd/mm/rrrr'), to_date('31/10/2011','dd/mm/rrrr'), 'TW3 ZE3' as postcode from dual union all
select 'A227' as pupil_id, to_date('01/11/2011','dd/mm/rrrr'), null, 'n23 4ty' as postcode from dual) addresses
select desired.* from
(select 'A227' as pupil_id, to_date('21/04/2010','dd/mm/rrrr') class_start, to_date('21/09/2010','dd/mm/rrrr') class_end, to_date('20/04/2011','dd/mm/rrrr') as address_start, 'TW1 XVT' as postcode from dual union all
select 'A227' as pupil_id, to_date('08/08/2011','dd/mm/rrrr') class_start, to_date('26/10/2011','dd/mm/rrrr') class_end, to_date('03/08/2011','dd/mm/rrrr') as address_start, 'TW3 ZE3' as postcode from dual) desired
Hi,
That's an example of a Top-N Query , and here's one way to do it:
WITH got_r_num AS
SELECT p.*
, a.address_start
, a.postcode
, ROW_NUMBER () OVER ( PARTITION BY p.pupil_id
, p.class_start
ORDER BY a.address_start DESC
) AS r_num
FROM pupils p
JOIN addresses a ON p.pupil_id = a.pupil_id
AND p.class_start >= a.address_start
SELECT pupil_id, class_start, class_end, address_start, postcode
FROM got_r_num
WHERE r_num = 1
;As you can see, the sib-query pairs each pupil and class with all the earlier addresses, and then numbers the addresses such that the latest address_start gets the lowest r_num (that is, 1, since ROW_NUMBER always starts with 1). The main query displays only the most recent address (the one with r_num = 1) for each pupil and class.
Does addresses.address_end plays any role in this problem? For example, would it matter if the most recent address for a given pupil and class had expired before the class started? That is, if we change the middle of address to:
select 'A227' as pupil_id
, to_date ('03/08/2011', 'dd/mm/rrrr')
, to_date ('07/08/2011', 'dd/mm/rrrr') -- Not 31/10/2011
, 'TW3 ZE3' as postcode
from dual would it still count as the last address before the class that started on 08/08/2011?
Edited by: Frank Kulash on Nov 1, 2011 11:36 AM
Added question about address_end -
How to tune self join query in Oracle 11g
Oracle & SQL new to me,and I'm still in learning phase.
Could you please help me to tune below oracle query?? This table contains ~95 lac records and it takes 1 hour to retrieve data using this query.
Your suggestions/comments/help will be appreciated.
Thanks in advance.
SELECT A.CNO AS CNO, A.FNO AS FNO, A.CID AS CID, A.IID AS IID
FROM CAC_LKP A, (SELECT C_DATE, CNO, FNO
FROM (SELECT MAX(CAC_LKP.C_DATE) AS C_DATE, CAC_LKP.CNO AS CNO, CAC_LKP.FNO AS FNO
FROM CAC_LKP
WHERE ACTIVE = 'Y' GROUP BY CNO, FNO)) B
WHERE A.C_DATE = B.C_DATE
AND A.CNO = B.CNO
AND A.FNO = B.FNO
AND A.ACTIVE = 'Y'
Primary key is defied over combination of c_date,iid,active.
Edited by: 1009236 on Jun 1, 2013 12:52 AM>
SELECT A.CNO AS CNO,
A.FNO AS FNO,
A.CID AS CID,
A.IID AS IID
FROM CAC_LKP A,
SELECT C_DATE,
CNO,
FNO
FROM
SELECT MAX(CAC_LKP.C_DATE) AS C_DATE,
CAC_LKP.CNO AS CNO,
CAC_LKP.FNO AS FNO
FROM CAC_LKP
WHERE ACTIVE = 'Y'
GROUP BY CNO, FNO
) B
WHERE A.C_DATE = B.C_DATE AND
A.CNO = B.CNO AND
A.FNO = B.FNO AND
A.ACTIVE = 'Y';Hi,
Before even starting to see why there is a performance problem, I think you should consider the fact that there is logical problem in your WHERE clause. According to what you mentioned the primary key is composed of *(c_date, iid, active)* yet iid is absent in both the global query's WHERE clause and also that of the subquery.
Consequently the (aggregate) rows in the subquery will not be linked based on a correct logic to the external query.
Regards,
Dariyoosh -
How to build an SQL Query to print Week ranges of a Month
Hi Gurus!!
I have a requirement to create a query to display the Week periods of a month.
The inputs will be Year and month.
The result should be some thing like this:
If Year = 2009 and Month = June
The SQL Query should return the following:
01-Jun-2009 to 06-Jun-2009
07-Jun-2009 to 13-Jun-2009
14-Jun-2009 to 20-Jun-2009
21-Jun-2009 to 27-Jun-2009
27-Jun-2009 to 30-Jun-2009
I am confused how to do this. Please help me. Any help would be grately Appreciated.
Thanks
AhmedThis is how My Final Query Looks Like:
SELECT TO_CHAR(SYSDATE+7*(level-1),'DD-MON-RRRR')
||' to '
||TO_CHAR(SYSDATE+7*(level-1)+6,'DD-MON-RRRR') RANGES
FROM dual
connect by level<=5
--Ahmed -
How to build SAP B1 query reports for VAT in Source currencies
Hello,
Need help ASPYou may start your query by checking these threads first:
VAT Report
I need VAT Report
Re: Can we set tax amount directly instead of tax code?
Thanks,
Gordon -
How to build a query to join on two tables without mapping
I did Automatic mapping by the workbench Directofield mapping with the table and java object.
Wanted to build a simple join query by joining on the same field on both the tables.Not the sql query through the toplink using expression builder.
Please help.............
Spent one full day for this................Thanks Don for the reply,sorry to bug you,but i need help.....
SELECT A.AGNCY_C,
A.TYPE_C,
A.RESN_C,
A.S_TYPE_C,
A.SUB_ID_C,
A.RY_C
FROM RATING A, REF B
WHERE A.ID_C = B._ID_C
AND A.ALPHA_C = B.ALPHA_C
AND A.EFF_D >= B.MATURITY_D
This is the real query i was talking about.I did mapping automatically through the workbench,generated java classes also throught the workbench.
Now they don't want to execute the raw sql.They wanted to get all the RATING objects with the where condition.
So how to build a query by using toplink.
tried your example
ExpressionBuilder builder = new ExpressionBuilder();
Expression creditRating = builder.getTable("RATING").getField("ID_C");
Expression issue_ref = builder.getTable("REF").getField("ID_C");
Expression join = creditRating.equal(issue_ref);
I am getting java.lang.OutOfMemoryError
error.
I selected the option generate classes and descriptors
from the tables (RATING,REF).,so it created the classes and dscriptors automatically.
In Database script for the table RATING like this
ALTER TABLE RATING ADD (
CONSTRAINT RATING_F1 FOREIGN KEY (ID_C, ALPHA_C)
REFERENCES REF (ID_C,ALPHA_C));
I think when i generate descriptor automatically it is keeping this association.
Please help me......... -
1. How to create an explain plan with rowsource statistics for a complex query that include multiple table joins ?
When multiple tables are involved , and the actual number of rows returned is more than what the explain plan tells. How can I find out what change is needed in the stat plan ?
2. Does rowsource statistics gives some kind of understanding of Extended stats ?You can get Row Source Statistics only *after* the SQL has been executed. An Explain Plan midway cannot give you row source statistics.
To get row source statistics either set STATISTICS_LEVEL='ALL' in the session that executes theSQL OR use the Hint "gather_plan_statistics" in the SQL being executed.
Then use dbms_xplan.display_cursor
Hemant K Chitale -
How to build View that join 2 tables that one of them exists twice in join
Hello ,
I want to create a database view (in CRM) which joins
the following tables : but000 , but050 , but000 again .
but000 holds BP general data (including BP name).
but050 holds the connection (relationship) between two BPS.
I want to build a dictionary view that shows a relation between
two BP and I want also to see their names ... that's why I need
but000 twice ..
I didn't manage doing this in SE11 (like I can do it with abap code).
I need this view in order to use it in a search help I need to build.
Does anyone know a way to build a view like this ?
If it is not possible how can I build a search help that shows
relation with names ?
Please , help .
Thanks ,
N.S.Creating a Database View
Procedure
1.Enter an explanatory short text in the field Short text.
You can for example find the view at a later time using this short text.
2.Define the tables to be included in the view in the Tables field of the Tables/Join conditions tab page.
Keep in mind that you can only include transparent tables in a database view.
3.Link the tables with join conditions.
If there are suitable foreign keys between the tables, you should copy the join conditions from these foreign keys (see Foreign Key Relationships and Join Conditions).
Place the cursor on a table name and choose Relationships. All foreign keys to other tables defined for this table are displayed. Select the foreign keys and choose Copy. The join condition is now derived from the definitions in the foreign key.
If you only want to see the foreign key relationship existing between two tables, you must first select these two tables (click on the first column of the input area Tables) and then choose Relationships.
4.On the View fields tab page, select the fields that you want to copy to the view.
Choose Table fields. All the tables contained in the view are displayed in a dialog box. Select a table. All the fields contained in this table are displayed. You can copy fields by selecting them in the first column and choosing Copy.
You can also include an entire table in the view (see Includes in Database Views).
5.On the Selection conditions tab page, you can (optionally) formulate restrictions for the data records to be displayed with the view (see Maintaining Selection Conditions for Views).
The selection conditions define the data records that can be selected with the view.
6.With Goto ® Technical settings, you can (optionally) maintain the technical settings of the database view.
You can define whether and how the database view should be buffered here. Proceed as for the technical settings of a table (see Maintaining Technical Settings). Note that only the settings for buffering can be maintained for database views.
7.On the Maintenance status tab page, select the maintenance status of the database view.
If the view contains more than one table, the maintenance status read only cannot be altered.
8.Save your entries. You are asked to assign the view a development class.
You can change this development class later with Goto ® Object directory entry.
9.Choose activate.
Girish -
How do i join 3 table with the 'join' query ?
Hello,
i want to join 3 tables -> bsis, bsad and vbrp
the components of the query to be are ,
- select (matnr from vbrp) sum(amount from bsad).
- join bsis and bsad on bsisbukrs = bsadbukrs, bsisbelnr = bsadaugbl and bsisbldat = bsadaugdt.
- where bsisblart = 'DZ' and bsishkont = '123456'.
- join bsad and vbrp on vbrpburks = bsadbukrs, vbrpgjahr = bsadgjahr and vbrpbelnr = bsadbelnr.
The double join query is to be constructed out of the above components.
Thanks,
Shehryar Daharc an example....
DATA: BEGIN OF wa,
carrid TYPE spfli-carrid,
connid TYPE spfli-connid,
fldate TYPE sflight-fldate,
bookid TYPE sbook-bookid,
END OF wa,
itab LIKE SORTED TABLE OF wa
WITH UNIQUE KEY carrid connid fldate bookid.
SELECT pcarrid pconnid ffldate bbookid
INTO CORRESPONDING FIELDS OF TABLE itab
FROM ( ( spfli AS p
INNER JOIN sflight AS f ON pcarrid = fcarrid AND
pconnid = fconnid )
INNER JOIN sbook AS b ON bcarrid = fcarrid AND
bconnid = fconnid AND
bfldate = ffldate )
WHERE p~cityfrom = 'FRANKFURT' AND
p~cityto = 'NEW YORK' AND
fseatsmax > fseatsocc.
LOOP AT itab INTO wa.
AT NEW fldate.
WRITE: / wa-carrid, wa-connid, wa-fldate.
ENDAT.
WRITE / wa-bookid.
ENDLOOP.
Ramesh. -
How to build sql query for view object at run time
Hi,
I have a LOV on my form that is created from a view object.
View object is read-only and is created from a SQL query.
SQL query consists of few input parameters and table joins.
My scenario is such that if input parameters are passed, i have to join extra tables, otherwise, only one table can fetch the results I need.
Can anyone please suggest, how I can solve this? I want to build the query for view object at run time based on the values passed to input parameters.
Thanks
Srikanth AddankiAs I understand you want to change the query at run time.
If this is what you want, you can use setQuery Method then use executeQuery.
http://download.oracle.com/docs/cd/B14099_19/web.1012/b14022/oracle/jbo/server/ViewObjectImpl.html#setQuery_java_lang_String_
Maybe you are looking for
-
How to insert new Item in JCombox through setEditable?
Hey guys, Is there somebody who can help me on how to insert new Item in the JComboBox through setEditable? JComboBox box = new JComboBox(); box.addItem("");box.addItem("a"); box.addItem("b"); box.setEditable(true); When I run it and selected the in
-
ISCSI disk not available for storage
I am trying to create a lab to demonstrate a simple clustering environment. Best practices is not an issue here. I have a lone Domain Controller that is also running Hyper-V. I am hosting 2 VMs, I call Cluster1 and Cluster2. The VMs share the NIC wi
-
Configuration Assistants Stops in Infrastructure installation
hi. I'm installing Oracle Infrastructure for OCS. I installed fine until I met Configuration Assistants many of them are fine but in "OPMN Configuration Assistant - start OPMN" it says "in progressing". what do i do? I was trying to find some tips in
-
Vista - WRT54G Wireless Router Problem
I'm sure your all tired of answering this question or variations of, but here we go. I have a WRT54G V.6 wireless router running a hard wired pretty new Hp Pavallion With Vista Home premium. It's running an AMD Athlon 64 X2 Dual Core 5000+- 2.60 GHz
-
Sending spool request through email
Hi I am executing ransaction SP01. then i am displaying spool requests of a particular user. next screen shows spool reuqests of that user. now when i click on a spool request , on next screen in meny send mail option is not appearing. How can i sen