Decode in a join condition
Hi all,
I stumbled across a very inefficient query in my product. I think the reason is having "decode" in two join conditions. Before I post the query, execution plan etc, and get the tuned sql statement on a platter, I want to fight it myself. :-)
I want to know, is it true that having a decode in the where clause (as a join condition) is bad for performance? Can you give me some tips on avoiding them (splitting the query into many is not possible here, though I think it is a good solution).
Thanks a lot,
Aditya
P.S. I'm trying to somehow use subqueries to eliminate the decode in the where clause.
Yes. If decode is only join-condition, then Oracle
produces cartesian join and only then filters it
based on decode.+/- 1 :-Q
select *
from emp, dept
where decode(emp.deptno, dept.deptno, 1, 0) = 1
Statement Id=2 Type=TABLE ACCESS
Cost=3 TimeStamp=07-05-07::15::49:44
(1) SELECT STATEMENT ALL_ROWS
Est. Rows: 1 Cost: 9
(4) NESTED LOOPS
Est. Rows: 1 Cost: 9
(2) TABLE TABLE ACCESS FULL SCOTT.DEPT [Analyzed]
(2) Blocks: 5 Est. Rows: 4 of 4 Cost: 3
Tablespace: USERS
(3) TABLE TABLE ACCESS FULL SCOTT.EMP [Analyzed]
(3) Blocks: 5 Est. Rows: 1 of 14 Cost: 2
Tablespace: USERS
select *
from emp, dept
-- where decode(emp.deptno, dept.deptno, 1, 0) = 1
[pre] Statement Id=2 Type=TABLE ACCESS
Cost=3 TimeStamp=07-05-07::15::50:49
(1) SELECT STATEMENT ALL_ROWS
Est. Rows: 56 Cost: 9
(5) MERGE JOIN CARTESIAN
Est. Rows: 56 Cost: 9
(2) TABLE TABLE ACCESS FULL SCOTT.DEPT [Analyzed]
(2) Blocks: 5 Est. Rows: 4 of 4 Cost: 3
Tablespace: USERS
(4) BUFFER SORT
Est. Rows: 14 Cost: 6
(3) TABLE TABLE ACCESS FULL SCOTT.EMP [Analyzed]
(3) Blocks: 5 Est. Rows: 14 of 14 Cost: 2
Tablespace: USERS
Similar Messages
-
More than one join condition for 2 tables in obiee
Hello,
I am using obiee 11g.
There are 2 tables tableA and tableB where the join condition is like (tableA.col1=tableB.col1) or (tableA.col1 is null and tableB.col1 is null)
where should i do these type of joins.
I tried putting in physcial layer->f(x) but giving error like here only columns an d opertaors are allowed.
Thanksok here it goes.
I have a tableA with columns col1(pk),col2 and other columns
I have tableB with columns col1(pk),col2..Only these 2 columns.
Now distinct tableA.col2 values are put in tableB.col2. For those distinct values i have put the tableB.col1 values.
Now tableA.col2 as well as tableB.col2 can be null beacuse there may be null values in tableA.col2.
Now in tableB i have added one more row which has col1 as value and col2 as null.
Now when in physical layer when i do tableA.col2=tableB.col2 i dont get the null values.
What i want is whenever the tableA.col2 and tableB.col2 is null then take tableB.col1 for those vales.
So when i query i do
select * from tableA,tableB where
((tableA.col2=tableB.col2) or (tableA.col2 is null and tableB.col2 is null))
What i want is when i do a join i should be able to give this OR condition in rpd thats it.
because when i do in where clause of content tab it goes like a AND condition and not OR.
Thanks
Edited by: user123 on Jul 5, 2011 1:57 PM -
Infoset Join condition on Key feilds and data fields
Hi Guys,
I have a requirement to biuld the Info set with join conditon on two DSO's the info objects which i am using in the JOin condition are defined as data fieds in one DSO and defined as key fields in another DSO, is it possible to define join condition on key fields and data fields.
The two info objects are
0AC_DOC_NO
0ITEM_NUM
These two info objects are defined as data fields in DSO : 0LIV_DS1 Invocie verificaion
key fields in DSO: 0FIAP_0o3 FI AP Line Item
Please suggest me is it possible to define join the condtion on the data fields and key feilds.
Thanks
Best regards
SGHi
yes you can create join, you will get any issue in reporting level.
example: Say i want to create Info Set on 0MATERIAL and Sales DSO.
In 0MATERIAL Info Object it is key filed, but in my DSO 0MATERIAL is data field.Still we can create
Creation of join is dependent on fields common in your source objects.
check out the below document
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2f5aa43f-0c01-0010-a990-9641d3d4eef7?QuickLink=index&overridelayout=true
Regards,
Venkatesh
Edited by: Venkateswarlu Nandimandalam on Sep 27, 2011 2:26 AM -
Set operator NE in Database View creation in join condition
Hi Experts,
I have a requirement to set NE(not equal) operator in join condition of Database View creation. Could you please help me how to set in operator.
Join condition :
Ex : BSAK-AUGBL NE BSAK-BELNR.
You know that by default operator is '='. i want to set NE in place of '='.
Thanks,Hi Chinna,
Check whether if there is any possibility or not to include more key fields like bukrs, lifnr, gjahr etc in the where condition, so that you query may result faster. Then, there won't be any necessary to create the view.
Hope this helps.
Please reward if useful.
Thanks,
Srinivasa -
Join is not working for NULL values on join condition
HI ,
I have the following problem .
SQL> select *from a;
X Y
1
2
3
4
SQL> select *from b;
B Y
1
2
SQL> select f.x,f.y,s.b from a f,b s
2 where f.x=s.b(+);
X Y B
1 1
2 2
4
3
SQL> select f.x,f.y,s.b from a f,b s
2 where f.x=s.b(+)
3 and f.y=s.y;
no rows selected
So now if i include one more join condition where in null = null situation arises , it is now working.
Simply saying its not treating ( 1 and null ) and ( 1 and null ) are same.
What is the solution.Is this a expected behaviour.
Thanks
Pramod GarreHI
I want something like this
SQL> select f.x,f.y,s.b from a f,b s
2 where f.x=s.b(+);
X Y B
1 1
2 2
4
3
SQL> select f.x,f.y,s.b from a f,b s
2 where f.x=s.b(+)
3 and f.y=s.y;
Instead of "now Rows " i have to get
X Y B
1 1
2 2
4
3
Is there is any way to do this.
Thanks
Pramod -
Join condition between PO_REQUISITION_HEADERS_ALL and WF_NOTIFICATIONS
Hi,
Could anyone tell me what is the join condition between PO_REQUISITION_HEADERS_ALL and WF_NOTIFICATIONS?
I joined these two tables by WF_NOTIFICATIONS.ITEM_KEY = PO_REQUISITION_HEADERS_ALL .WF_ITEM_KEY.But I cannot found some approved requisitions item key in WF_NOTIFICATIONS table.
Please help.
I paste my query below:
SELECT PRH.ORG_ID ORG_ID,
WF.ITEM_KEY,
WF.FROM_ROLE,
PRH.WF_ITEM_KEY,
WF.RECIPIENT_ROLE APPROVERS_NAME,
TRUNC(NVL(PRH.APPROVED_DATE, '')) DATE_APPROVED,
WF.SUBJECT SUBJECT,
PRH.DESCRIPTION REQ_DESC,
PRH.SEGMENT1,
(SUM(NVL(PRL.AMOUNT, 0)) +
SUM(NVL(PRL.UNIT_PRICE, 0) * NVL(PRL.QUANTITY, 0))) REQ_AMT,
GL.SEGMENT1 || '.' || GL.SEGMENT2 || '.' || GL.SEGMENT3 || '.' ||
GL.SEGMENT4 || '.' || GL.SEGMENT5 || '.' || GL.SEGMENT6 || '.' ||
GL.SEGMENT7 || '.' || GL.SEGMENT8 CHARGE_ACCT
FROM APPS.WF_NOTIFICATIONS WF,
APPS.PO_REQUISITION_HEADERS_ALL PRH,
APPS.PO_REQUISITION_LINES_ALL PRL,
APPS.PO_REQ_DISTRIBUTIONS_ALL PRD,
APPS.GL_CODE_COMBINATIONS GL
WHERE WF.FROM_ROLE IN ('GHAWKINS', 'GHALVERSON', 'NCERNOTTA', 'DCOLLOPY', 'RHAY')
AND BEGIN_DATE > SYSDATE - 60
AND WF.MESSAGE_TYPE = 'REQAPPRV'
AND WF.ITEM_KEY = PRH.WF_ITEM_KEY --added
AND PRH.AUTHORIZATION_STATUS = 'APPROVED'
AND PRL.REQUISITION_HEADER_ID = PRH.REQUISITION_HEADER_ID
AND PRD.REQUISITION_LINE_ID = PRL.REQUISITION_LINE_ID
AND PRD.CODE_COMBINATION_ID = GL.CODE_COMBINATION_ID
GROUP BY PRH.ORG_ID,
WF.ITEM_KEY,
WF.FROM_ROLE,
PRH.WF_ITEM_KEY,
WF.BEGIN_DATE,
WF.SUBJECT,
WF.RECIPIENT_ROLE,
PRH.APPROVED_DATE,
PRH.DESCRIPTION,
PRH.SEGMENT1,
PRL.REQUISITION_HEADER_ID,
GL.SEGMENT1 || '.' || GL.SEGMENT2 || '.' || GL.SEGMENT3 || '.' ||
GL.SEGMENT4 || '.' || GL.SEGMENT5 || '.' || GL.SEGMENT6 || '.' ||
GL.SEGMENT7 || '.' || GL.SEGMENT8Pl see if these MOS Docs can help -
603232.1 - How to Diagnose Purchasing Document Approval Routing
579522.1 - Forward Document Form FAQ
431767.1 - How To View Requisition From The Email Notifications For Which Workflow Data Is Purged
HTH
Srini -
How to use outer join condition in my below query.
Hi All,
How to use outer join condition in my below query.
In the table APPS_JP.GEDIS_OFFER_HEADER goh I have more records
in the table APPS_JP.GEDIS_ORDER_BUILDS gob I have less number of records.
I want all the records from APPS_JP.GEDIS_OFFER_HEADER goh
including other conditions.
I have tried goh.OFFER_NO=gob.OFFER_NO(+) but same result.
[code]SELECT GOH.ORIG_SYSTEM,
gsp.USER_NAME,
goh.ORDER_NO,
goh.OMEGA_ORDER_NUMBER,
goh.ORDER_TYPE,
gc.CUSTOMER_ID,
gc.OMEGA_CUSTOMER_NUMBER,
CASE WHEN gc.PRIVATE = 'N' THEN gc.CUSTOMER_NAME ELSE '' END
AS COMPANY_NAME,
goh.ORDER_STATUS,
goh.TOTAL_SELLING_PRICE,
goh.TOTAL_MARGIN,
ga1.ADDRESS1
|| ','
|| ga1.ADDRESS2
|| ','
|| ga1.ADDRESS3
|| ','
|| ga1.POSTAL_CODE
|| ','
|| ga1.CITY
AS SHIPPING_ADDRESS,
ga2.ADDRESS1
|| ','
|| ga2.ADDRESS2
|| ','
|| ga2.ADDRESS3
|| ','
|| ga2.POSTAL_CODE
|| ','
|| ga2.CITY
AS BILLING_ADDRESS,
ga.ADDRESS_ID,
gol.DESCRIPTION,
APPS_JP.TZ.to_local_date (goh.OFFER_DATE, goh.OFFER_DATE_UTC)
AS OFFER_DATE,
gc.LEVEL_8,
goh.NO_OF_BUILDS,
gob.SFDC_ID,
goh.PURCHASE_ORDER_NO AS PO,
gc1.CUSTOMER_NAME AS END_USAGE,
gol.LOB,
goh.TOTAL_MARGIN_PCT,
goh.TOTAL_DISCOUNT,
goh.TOTAL_DISCOUNT_PCT
FROM APPS_JP.GEDIS_OFFER_HEADER goh,
APPS_JP.GEDIS_ORDER_BUILDS gob,
APPS_JP.GEDIS_ORDER_LINES gol,
APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER gorc,
APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER ship,
APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER bill,
APPS_JP.GEDIS_CUSTOMER gc,
APPS_JP.GEDIS_CUSTOMER gc1,
APPS_JP.GEDIS_CONTACT gct,
APPS_JP.GEDIS_ADDRESS ga,
APPS_JP.GEDIS_ADDRESS_NORM ga1,
APPS_JP.GEDIS_ADDRESS_NORM ga2,
(SELECT DISTINCT SALESPERSON_ID, USER_NAME
FROM APPS_JP.GEDIS_SALESPERSON
WHERE SALESPERSON_ID IN
(SELECT TO_NUMBER (COLUMN_VALUE) AS SALESPERSON_ID
FROM TABLE (APPS_GLOBAL.SplitString ('337309'))))
gsp
WHERE goh.ORDER_NO <> 0
AND goh.OFFER_NO <> 0
AND goh.OFFER_NO=gol.OFFER_NO
AND gol.BUILD_NO = 1
AND gol.LINE_NO = 1
AND goh.OFFER_NO=gob.OFFER_NO
AND gob.BUILD_NO = 1
AND goh.OFFER_NO = gorc.OFFER_NO
AND gct.CONTACT_ID = gorc.CONTACT_ID
AND ga.CUSTOMER_ID = gc.CUSTOMER_ID
AND ga.PRIMARY = 'Y'
AND goh.LEAD_SALESPERSON=gsp.SALESPERSON_ID
AND goh.OFFER_NO = ship.OFFER_NO
AND ship.RELATION_TYPE = 'SHIP'
AND ga1.ADDRESS_ID = ship.ADDRESS_ID
AND ga1.CUSTOMER_ID = gc1.CUSTOMER_ID
AND goh.OFFER_NO = bill.OFFER_NO
AND bill.RELATION_TYPE = 'BILL'
AND ga2.ADDRESS_ID = bill.ADDRESS_ID
AND goh.OFFER_DATE BETWEEN APPS_JP.TZ.LOCAL_TO_DB_DATE (
SYSDATE - 30
AND APPS_JP.TZ.LOCAL_TO_DB_DATE (SYSDATE)
AND gorc.RELATION_TYPE = 'BASE'
AND gorc.CUSTOMER_ID = gc.CUSTOMER_ID
AND goh.SALES_CHANNEL = gc.SALES_CHANNEL
AND gc.SALES_CHANNEL = 'SMB'
AND goh.LEAD_SALESPERSON IN (goh.CREATED_BY, goh.LEAD_SALESPERSON)
ORDER BY goh.OFFER_NO;[/code]
Please help me how to use this outer join condition.
Thanks in advance.Hi,
If you want all the rows from goh, then you don't want any conditions like goh.OFFER_NO <> 0.
Make all the joins to goh outer joins, and make all conditions that apply to any tables joined to goh (or to tables joined to them) part of the join condition, like this:
FROM APPS_JP.GEDIS_OFFER_HEADER goh
LEFT OUTER JOIN APPS_JP.GEDIS_ORDER_BUILDS gob ON gob.OFFER_NO = goh.OFFER_NO
AND gob.BUILD_NO = 1
LEFT OUTER JOIN APPS_JP.GEDIS_ORDER_LINES gol ON gol.OFFER_NO = goh.OFFER_NO
AND gol.BUILD_NO = 1
AND gol.LINE_NO = 1
LEFT OUTER JOIN APPS_JP.GEDIS_OFFER_RELATED_CUSTOMER
gorc ...
I hope this answers your question.
If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all the tables involved, and the results you want from that data.
Simplify the problem as much as possible. For example, do you really need all those tables to show what the problem is? Of course, you need them in tyour real query, but if you understand a solution that only involves 4 or 5 tables, you'll know how to apply it to any number of tables.
Explain, using specific examples, how you get those results from that data.Always say what version of Oracle you're using (e.g. 11.2.0.2.0).
See the forum FAQ https://forums.oracle.com/message/9362002#9362002 -
In-different behaviour of join condition
My query is of in-different behaviour of join condition with join between a varchar2 column and a number column. I am using the following join condition :-
CM.UPDATED_BY=to_char(LM.LOGIN_ID)
where CM.UPDATED_BY is a varchar2 column and LM.LOGIN_ID is a number column. Now, CM.UPDATED_BY also has number only but some previous & old data is having varchar2 data. So, for that reason, i put the to_char before LM.LOGIN_ID, otherwise, only
CM.UPDATED_BY=to_char(LM.LOGIN_ID)
would having been okay. Now, my real question is that the query with the condition,
CM.UPDATED_BY=to_char(LM.LOGIN_ID)
works fine as long as there is no 'character' data in 'CM.UPDATED_BY'. If i put the condition:
CM.UPDATED_BY=to_char(LM.LOGIN_ID)
then, the query is taking too long and the output is also not coming. Please help in solving my doubt as i need it resolved urgently.1) Did you intend for all 4 join conditions to be identical? From the text of your question, it sounds like some of the conditions should be different.
2) How do you compare the running time when CM.UPDATED_BY has non-numerica data and when it has numeric data? If you are altering the data in the table, are you reanalyzing the table between runs? Is there a difference in the query plan in the two cases?
Justin
Distributed Database Consulting, Inc.
www.ddbcinc.com/askDDBC -
How to add join conditions in ABAP Query.
Hi,
I need a help on "ABAP Query".
How to add join conditions in ABAP Query.
Thanks in advance.
Thanks & Regards,
RamanaHi,
See below code,
*& Report ZRNP_ALV_SO
REPORT zrnp_alv_so MESSAGE-ID z7rnp .
INCLUDE zrnp_include .
*SELECTION SCREEN *
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-004 .
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln ,
s_auart FOR v_auart ,
s_vkorg FOR v_vkorg ,
s_spart FOR v_spart ,
s_kunnr FOR v_kunnr ,
s_matnr FOR v_matnr .
SELECTION-SCREEN END OF BLOCK blk1 .
*AT SELECTION SCREEN *
AT SELECTION-SCREEN.
SELECT SINGLE vbeln
FROM vbak INTO vbak-vbeln
WHERE vbeln IN s_vbeln.
IF sy-subrc <> 0.
MESSAGE e202.
ENDIF.
*START OF SELECTION *
START-OF-SELECTION .
PERFORM data_select.
PERFORM t_sort USING i_sort .
PERFORM event_cat USING i_event .
PERFORM fld_cat USING i_fldcat[] .
PERFORM t_layout USING i_layout .
PERFORM fld_cat2 USING i_fldcat2[] .
PERFORM call_alv.
* DATA SELECT *
*& Form DATA_SELECT
* text
* --> p1 text
* <-- p2 text
FORM data_select .
REFRESH: it_vbfa, it_so1, it_del_ful ,it_del1 .
BREAK-POINT.
*SELECT*
*a~vbeln*
*a~auart*
*a~vkorg*
*a~spart*
*a~kunnr*
*b~posnr*
*b~matnr*
*c~maktx*
*b~kwmeng*
*b~vrkme*
*INTO TABLE it_so1 FROM vbak AS a*
*INNER JOIN vbap AS b ON b~vbeln = a~vbeln*
*INNER JOIN makt AS c ON c~matnr = b~matnr*
*AND c~spras = sy-langu*
*WHERE a~vbeln IN s_vbeln .*
IF sy-subrc = 0.
SORT it_so1 BY vbeln.
DELETE ADJACENT DUPLICATES FROM it_so1.
ENDIF.
* COLURING DISPLAY *
DATA: ld_color(1) TYPE c .
* LOOP AT it_so1 INTO wa_so.
* Populate color variable with colour properties
* Char 1 = C (This is a color property)
* Char 2 = 3 (Color codes: 1 - 7)
* Char 3 = Intensified on/off ( 1 or 0 )
* Char 4 = Inverse display on/off ( 1 or 0 )
* i.e. wa_ekko-line_color = 'C410'
* ld_color = ld_color + 1.
* Only 7 colours so need to reset color value
* IF ld_color = 8.
* ld_color = 1.
* ENDIF.
* CONCATENATE 'C' ld_color '10' INTO wa_so-line_color.
** wa_ekko-line_color = 'C410'.
* MODIFY it_so1 FROM wa_so.
* ENDLOOP .
* IF sy-subrc = 0.
IF NOT it_so1[] IS INITIAL.
SELECT vbelv
posnv
vbeln
posnn
vbtyp_n
INTO TABLE it_vbfa
FROM vbfa
FOR ALL ENTRIES IN it_so1
WHERE vbelv = it_so1-vbeln
AND posnn = it_so1-posnr
AND vbtyp_n ='J' .
IF sy-subrc = 0.
SELECT vbeln
posnr
matnr
werks
lgort
charg
lfimg
vrkme
FROM lips INTO TABLE it_del_ful
FOR ALL ENTRIES IN it_vbfa
WHERE vbeln = it_vbfa-vbeln
AND posnr = it_vbfa-posnn.
ENDIF.
ENDIF.
ENDFORM. " DATA_SELECT
**************** EVENT CATALOG ****************************************
*& Form EVENT_CAT
* text
* -->P_I_EVENT text
FORM event_cat USING p_i_event TYPE slis_t_event .
REFRESH p_i_event .
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
* EXPORTING
* I_LIST_TYPE = 0
IMPORTING
et_events = p_i_event
* EXCEPTIONS
* LIST_TYPE_WRONG = 1
* OTHERS = 2
* IF sy-subrc <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
READ TABLE p_i_event WITH KEY name = slis_ev_top_of_page INTO t_event.
IF sy-subrc = 0.
MOVE 'TOP_OF_PAGE' TO t_event-form.
MODIFY p_i_event FROM t_event INDEX sy-tabix TRANSPORTING form.
ENDIF.
CLEAR t_event .
ENDFORM. " EVENT_CAT
**********FORM FOR EVENT TOP_OF_PAGE**********************************
FORM top_of_page .
REFRESH i_listheader.
DATA: t_header TYPE slis_listheader.
DATA: v_text(50).
WRITE sy-datum TO v_text.
CLEAR t_header.
t_header-typ = 'S'.
t_header-key = "Date".
t_header-info = v_text.
APPEND t_header TO i_listheader.
CLEAR t_header.
CLEAR v_text.
WRITE: 'SALES ORDER & DELIVERY DETAILS REPORT ' TO v_text .
t_header-typ = 'S'.
t_header-key = 'TITLE'.
t_header-info = v_text.
APPEND t_header TO i_listheader.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = i_listheader.
* I_LOGO = 'ALV_BACKGROUND'.
* I_END_OF_LIST_GRID =
ENDFORM. "TOP_OF_PAGE
******** FIRST ALV GRID DISPLAY ***************************************
FORM call_alv .
* FORM TO MAKE THE CELL CONTENTS INVISIBLE.
* PERFORM INVISIBLE_CELL_CONTENTS. *
*EXCLUDE-DECLARATION.
CLEAR wa_exclude.
wa_exclude-fcode = '&VEXCEL'.
APPEND wa_exclude TO i_exclude.
*& Form CALL_ALV
* text
* --> p1 text
* <-- p2 text
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND1'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_background_id = 'ALV_BACKGROUND'
is_layout = i_layout
it_fieldcat = i_fldcat[]
it_excluding = i_exclude
it_sort = i_sort
it_events = i_event
TABLES
t_outtab = it_so1
* IF sy-subrc <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
ENDFORM. " CALL_ALV
************** FIRST FIELDCATALOG *************************************
*& Form FLD_CAT
* text
* -->P_I_FLDCAT[] text
FORM fld_cat USING p_i_fldcat TYPE slis_t_fieldcat_alv.
CLEAR i_fldcat.
i_fldcat-fieldname = 'VBELN'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'."TABLE NAME
i_fldcat-seltext_m = 'SALES ORDER NO.'.
i_fldcat-col_pos = 1. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-hotspot = 'X'.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'AUART'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'."TABLE NAME
i_fldcat-seltext_m = 'SALES DOC. TYPE'.
i_fldcat-col_pos = 2. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 15. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'VKORG'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'SALES ORG.'.
i_fldcat-col_pos = 3. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 12. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'SPART'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'DIVISION'.
i_fldcat-col_pos = 4. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 10. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'KUNNR'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'SOLD TO PARTY'.
i_fldcat-col_pos = 5. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 15. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'POSNR'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'SALES DOC. ITEM'.
i_fldcat-col_pos = 6. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 17. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'MATNR'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'MATERIAL NO.'.
i_fldcat-col_pos = 7. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'MAKTX'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'DESCRIPTION'.
i_fldcat-col_pos = 8. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'KWMENG'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'QUANTITY'.
i_fldcat-col_pos = 9. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 15. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-do_sum = 'X'. " For doing "SUM"
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
CLEAR i_fldcat.
i_fldcat-fieldname = 'VRKME'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat-tabname = 'IT_SO1'.
i_fldcat-seltext_m = 'SALES UNIT'.
i_fldcat-col_pos = 10. " POSITION OF THE COLUMN.
i_fldcat-outputlen = 10. " SET THE OUTPUT LENGTH.
i_fldcat-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat-just(1) = 'C'.
APPEND i_fldcat.
ENDFORM. " FLD_CAT
****************** ALV SORTING ***************************************
*& Form SORT
* text
* -->P_I_SORT text
FORM t_sort USING p_i_sort TYPE slis_t_sortinfo_alv .
DATA: i_sort TYPE slis_sortinfo_alv .
REFRESH p_i_sort .
CLEAR i_sort.
i_sort-spos = 1.
i_sort-tabname = 'IT_SO1'.
i_sort-fieldname = 'VBELN'.
i_sort-up = 'X'.
i_sort-subtot = 'X'.
i_sort-group = '*'.
APPEND i_sort TO p_i_sort.
ENDFORM. " SORT
*FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
* SET PF-STATUS 'ZSTANDARD'.
*ENDFORM. "Set_pf_status
***********FORM FOR EVENT USER_COMMAND1********************************
FORM user_command1 USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
*CASE R_UCOMM .
* WHEN '&IC1' .
* IF rs_selfield-FIELDNAME = 'VBELN' .
* ENDIF .
* WHEN OTHERS .
* ENDCASE .
CLEAR wa_so.
REFRESH: it_del1 .
IF r_ucomm = '&IC1' AND rs_selfield-fieldname = 'VBELN' AND
rs_selfield-value IS NOT INITIAL.
READ TABLE it_so1 INTO wa_so INDEX rs_selfield-tabindex.
IF sy-subrc = 0.
LOOP AT it_vbfa INTO wa_vbfa WHERE vbelv = wa_so-vbeln
AND posnv = wa_so-posnr.
READ TABLE it_del_ful INTO wa_it_del_ful
WITH KEY vbeln = wa_vbfa-vbelv
posnr = wa_vbfa-posnn.
IF sy-subrc = 0.
CLEAR wa_del.
MOVE wa_it_del_ful TO wa_del.
APPEND wa_del TO it_del1.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
********* SECOND ALV GRID DISPLAY ***********************************
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
* I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'
i_callback_user_command = 'USER_COMMAND2'
i_callback_top_of_page = 'TOP_OF_PAGE'
i_background_id = 'ALV_BACKGROUND'
it_fieldcat = i_fldcat2[]
it_sort = i_sort
TABLES
t_outtab = it_del_ful
* IF sy-subrc <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
** WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
* ENDIF.
ENDFORM . "USER_COMMAND1
********** FORM FOR EVENT USER_COMMAND 2 ******************************
FORM user_command2 USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CLEAR wa_so.
REFRESH: it_del1 .
IF r_ucomm = '&IC1' AND rs_selfield-fieldname = 'VBELN' AND
rs_selfield-value IS NOT INITIAL.
READ TABLE it_so1 INTO wa_so INDEX rs_selfield-tabindex.
* IF SY-SUBRC = 0.
* LOOP AT it_vbfa INTO wa_vbfa WHERE vbelv = WA_SO-vbeln
* AND posnv = WA_SO-posnr.
READ TABLE it_del_ful INTO wa_it_del_ful
WITH KEY vbeln = rs_selfield-value
" vbeln = wa_vbfa-vbeln
posnr = wa_vbfa-posnn.
IF rs_selfield-fieldname = 'VBELN'.
SET PARAMETER ID 'VL' FIELD wa_vbfa-vbeln .
CALL TRANSACTION 'VL03' AND SKIP FIRST SCREEN.
ENDIF .
* ENDLOOP.
* ENDIF.
ENDIF.
ENDFORM . "USER_COMMAND2
********* SECOND FIELDCATALOG ******************************************
*& Form FLD_CAT2
* text
* -->P_I_FLDCAT2[] text
FORM fld_cat2 USING p_i_fldcat2 TYPE slis_t_fieldcat_alv .
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'VBELN'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-tabname = 'IT_DEL_FUL'."TABLE NAME
i_fldcat2-seltext_m = 'DELIVERY NO.'.
i_fldcat2-col_pos = 1. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-hotspot = 'X'.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'POSNR'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'DELIVERY ITEM'.
i_fldcat2-col_pos = 2. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'MATNR'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'MATERIAL NO.'.
i_fldcat2-col_pos = 3. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'WERKS'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'PLANT.'.
i_fldcat2-col_pos = 4. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'LGORT'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'ST. LOCATION'.
i_fldcat2-col_pos = 5. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'CHARG'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'BATCH NO.'.
i_fldcat2-col_pos = 6. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'LFIMG'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'ACT. DEL. QTY.'.
i_fldcat2-col_pos = 7. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
CLEAR i_fldcat2.
i_fldcat2-fieldname = 'VRKME'. "FIELD FOR WHICH CATALOG ID FILLED
i_fldcat2-seltext_m = 'SALES UNIT.'.
i_fldcat2-col_pos = 8. " POSITION OF THE COLUMN.
i_fldcat2-outputlen = 20. " SET THE OUTPUT LENGTH.
i_fldcat2-emphasize = 'X'. " COLOR OF THIS COLUMN.
i_fldcat2-key = 'X'. " SO THAT THIS FIELD IS NOT
"SCROLLABLE AND HIDDABLE.
i_fldcat2-just(1) = 'C'.
APPEND i_fldcat2.
ENDFORM. " FLD_CAT2
***************** ALV LAYOUT *******************************************
*& Form LAYOUT
* text
* -->P_I_LAYOUT text
FORM t_layout USING p_i_layout TYPE slis_layout_alv .
p_i_layout-zebra = 'X'.
p_i_layout-totals_text = 'GRAND TOTAL ='.
* p_i_layout-CONFIRMATION_PROMPT = 'X'.
* p_i_layout-DEF_STATUS = ' '.
p_i_layout-info_fieldname = 'LINE_COLOR'.
ENDFORM. " LAYOUT -
Very urgent (using join conditions in PI)
Hi PI gurus.
My scenario is SOAP to JDBC(Portal Webdynpro screen to Oracle database).
I have a requirement to fetch some complex data from the database using complex nested queries.How can i go ahead using join conditions in PI.Here the client is insisiting only on queries and rejected all other methods for solving this like
1)Java proxies
2)stored procedures written in the database system
3)Create a logical view in database system .
The following option is permitted for me by the client to follow
· Using the SQL_QUERY as a query method in the JDBC Receiver Channel in XI
· Trying out JOIN conditions to make multiple query into a single query:- Here need to check the feasibility of the JOIN Condition
Please help me to complete our task.
points will be rewarded for helpful answers.
Thanks & Regards
VeenaDefine the data structures (Request & Response)
A JDBC Synchronous scenario, the response message type name is dependent on the request message type name
i.e., if request is
Dear Raj,
This is my scenario SOAP-to-JDBC(syn) with out using BPM's.
4datatypes & message types,
MT_JDBCRequest
--->Statement1
My response msg type
MT_JDBCRequest_response
>Statement1_response
>row
twoMessage Interfaces, two mappings (for request & response) and one interface mapping
Configure the Objects In Integration directory.
Define the Web services and save the WSDL file After completion of configuration.
WSDL file is used for the integration of Portal - PI scenario.
Process Flow:
1. User requests for a report from the available list of PSMA reports by providing required set of input parameters.
2. Portal forwards the request with these input parameters to PI using web service model through SOAP protocol and the required results are derived from PI
3. Report is viewed on portal screen.
Thanks & regards,
Veena -
Reg: Join Conditions for Tables to create a View for Generic Extraction
Hi Experts,
Am trying to extract the data from Solman, for this purpose am creating a Generic Extractor based on three tables. So, can anyone please help me out by providing the join conditions to create a view based upon the following three tables,
1. CRM_ORDERM_H
2. DNOD_NOTIF
3. DNOD_NOTIF_S
Anyways i require the following fields in the extractor finally:
CRM CHANGED AT
GUID
SAP COMPONENT
RELEASE
REPORTED BY
These are the some of the major fields that i require in the final extractior. Please help me out ASAP with the table join conditions..
Will Assign Points for the helpfull answer...
Thanks,
Gattu.Hi,
I don't know the table CRM_ORDERM_H however you can link DNOD_NOTIF and DNOD_NOTIF_S
DNOD_NOTIF_S-CLIENT = DNOD_NOTIF-CLIENT
DNOD_NOTIF_S-GUIDS = DNOD_NOTIF-GUIDS
For the third table could you please paste here its definition like the hereunder?
Transp. table DNOD_NOTIF Active
Short Text Notification Header
Field KeyInitData element Data TyLengthDecimaShort Text
CLIENT X X MANDT CLNT 3 0Client
GUIDH X X DNOT_GUIDH RAW 16 0GUID Notification
.INCLUDE DNOS_NOTIF_INT STRU 0 0Notifications (Header, Internal Fields)
OBJNR DNOT_OBJNR CHAR 22 0Status Management Object Number
STATUS DNOT_STATUS CHAR 1 0Notification Status
DELETED DNOT_DELE_N CHAR 1 0Deletion Indicator Notification
PROCESSOR DNOT_PROC CHAR 12 0Current Processor
TYPE_PROC DNOT_TYPE_PRC CHAR 2 0Type of Processor
REPORTER DNOT_REPORTER CHAR 12 0Reported By
TYPE_REPO DNOT_TYPE_REP CHAR 2 0Type of Notification Creator
CREA_TSTMP DNOT_CREA_TSTMP DEC 15 0Entry Time Stamp
CHNG_TSTMP DNOT_CHNG_TSTMP DEC 15 0Time of Last Change
START_TSTMP DNOT_START_TSTMPDEC 15 0Initial Response Time - Time Stamp
END_TSTMP DNOT_END_TSTMP DEC 15 0Requested End of Processing - Time Stamp
CLO_TSTMP DNOT_CLO_TSTMP DEC 15 0Completion Time Stamp
.INCLUDE DNOS_NOTIF_EXT STRU 0 0Notifications (Header, External Fields)
NUMB DNOT_NUM CHAR 12 0Notification Number (External)
REFNUM DNOT_REFNUM CHAR 20 0External Reference Number
TYPE_NOTIF DNOT_TYPE_N CHAR 6 0Message category
CATEGORY DNOT_CATEGORY CHAR 12 0Topic, Area
SUBJECT DNOT_SUBJECT CHAR 60 0Re:
PRIORITY DNOT_PRIORITY CHAR 1 0Notification priority
LANGUAGE DNOT_LANG_N LANG 1 0Notification Language
hope this helps...
Olivier. -
Xmlsequence with where clause or with join condition...
Hi
I have a XML as like below:
<File>
<FileDetails>
<Student>
<RegNo>1001</RegNo>
<Name>Joseph</Name>
<ResultDetails>
<Subjects>
<SNo>1</SNo>
<SubjectName>ENGLISH</SubjectName>
<Marks>80</Marks>
</Subjects>
<Subjects>
<SNo>2</SNo>
<SubjectName>MATHS</SubjectName>
<Marks>78</Marks>
</Subjects>
</ResultDetails>
</Student>
<Student>
<RegNo>1002</RegNo>
<Name>Vincent</Name>
<ResultDetails>
<Subjects>
<SNo>1</SNo>
<SubjectName>ENGLISH</SubjectName>
<Marks>62</Marks>
</Subjects>
<Subjects>
<SNo>2</SNo>
<SubjectName>MATHS</SubjectName>
<Marks>73</Marks>
</Subjects>
</ResultDetails>
</Student>
</FileDetails>
</File>
This XML file has been inserted into a table gtt_xmlfile on column "XML_DATA" of datatype "CLOB(4000)".
Now i have executed the below query:
select
extract(value(d),'//RegNo/text()').getStringVal(),
extract(value(d),'//Name/text()').getStringVal(),
extract(value(d),'//SNo/text()').getStringVal(),
extract(value(d),'//SubjectName/text()').getStringVal(),
extract(value(d),'//Marks/text()').getStringVal()
from gtt_xmlfile x,
table(xmlsequence(extract(pk_xml.clob_to_xmltype(x.xml_data),'//File/FileDetails/Student'))) d;
And i got the below output:
REGNO NAME SNO SUBJECTNAME MARKS
1001 Joseph 12 ENGLISHMATHS 8078
1002 Vincent 12 ENGLISHMATHS 6273
After i have executed the below query:
select
extract(value(d),'//RegNo/text()').getStringVal() RegNo,
extract(value(d),'//Name/text()').getStringVal() Name,
extract(value(e),'//SNo/text()').getStringVal() SNo,
extract(value(e),'//SubjectName/text()').getStringVal() SubjectName,
extract(value(e),'//Marks/text()').getStringVal() Marks
from gtt_xmlfile x,
table(xmlsequence(extract(pk_xml.clob_to_xmltype(x.xml_data),'//File/FileDetails/Student'))) d,
table(xmlsequence(extract(pk_xml.clob_to_xmltype(x.xml_data),'//File/FileDetails/Student/ResultDetails/Subjects'))) e
i get the below output: (Cartesian product)
REGNO NAME SNO SUBJECTNAME MARKS
1001 Joseph 1 ENGLISH 80
1001 Joseph 2 MATHS 78
1001 Joseph 1 ENGLISH 62
1001 Joseph 2 MATHS 73
1002 Vincent 1 ENGLISH 80
1002 Vincent 2 MATHS 78
1002 Vincent 1 ENGLISH 62
1002 Vincent 2 MATHS 73
But my required output should be like below:
REGNO NAME SNO SUBJECTNAME MARKS
1001 Joseph 1 ENGLISH 80
1001 Joseph 2 MATHS 78
1002 Vincent 1 ENGLISH 62
1002 Vincent 2 MATHS 73
How can i achieve that using a join condition??
Any help would be much appreciated...
Best Regards
MuthuNo
The above doesn't help me. Because, if the same set repeats, it gives an error:
XQuery dynamic type mismatch: expected singleton sequence - got multi-item sequence.
Note: Same set means, on the below sample, the student set repeats twice. In this case, that gives me error as mentioned above
<File>
<FileDetails>
<Student>
<RegNo>1001</RegNo>
<Name>Joseph</Name>
<ResultDetails>
<Subjects>
<SNo>1</SNo>
<SubjectName>ENGLISH</SubjectName>
<Marks>80</Marks>
</Subjects>
<Subjects>
<SNo>2</SNo>
<SubjectName>MATHS</SubjectName>
<Marks>78</Marks>
</Subjects>
</ResultDetails>
</Student>
<Student>
<RegNo>1002</RegNo>
<Name>Vincent</Name>
<ResultDetails>
<Subjects>
<SNo>1</SNo>
<SubjectName>ENGLISH</SubjectName>
<Marks>62</Marks>
</Subjects>
<Subjects>
<SNo>2</SNo>
<SubjectName>MATHS</SubjectName>
<Marks>73</Marks>
</Subjects>
</ResultDetails>
</Student>
</FileDetails>
</File> -
In which join condition case, it will go to infiniti loop , in Oracle data
Hi Experts,
Can any one please tell me , in which join condition case, it will go to infiniti loop , in Oracle database.
Thanks&Regards,
Sanjeev.user13483989 wrote:
Hi Experts,
Can any one please tell me , in which join condition case, it will go to infiniti loop , in Oracle database.
Thanks&Regards,
Sanjeev.with faulty data
Handle: user13483989
Status Level: Newbie (15)
Registered: Jan 16, 2011
Total Posts: 192
Total Questions: 87 (73 unresolved)
why so many unanswered questions? -
Case-when-then logic in join condition
Is it possible to implement case when then logic in join condition?
Instead of:
INGRP1.COL1 = INGRP2.COL1 (+)
something like:
case
when INGRP1.COL2 IS NULL
then INGRP1.COL1 = INGRP2.COL1 (+)
else INGRP1.COL3 = INGRP2.COL3 (+)
end
expression builder for join condition.
Any help much appreciated.Hi Kaiser,
this is my variant
1) join first table with second table twice (define two input group in join, include second table in mapping twice and map them to appropriate join group)
INGRP1.COL1=INGRP2.COL1(+) and INGRP1.COL3=INGRP3.COL3(+)
2) after join calculate attributes from second table with expression like
case when COL2 IS NULL the INGRP2_ATTR else INGRP3_ATTR end
Maybe anyone has a better solution...
Regards,
Oleg -
Creating a Relation between two Blocks - the Join Condition [SOLVED]
Hi. I'm trying to create a Relation between my TTMS_Audit table and my Bundle_Exceptions table. This is the join condition:
ttms_audit.primary_key_values = bundle_exceptions.project_cd||','||bundle_exceptions.bundle||','||bundle_exceptions.exception_cd
And I get the following error:
FRM-15004: Error while parsing join condition
Does anyone know if my concatenated values in the Join Condition are allowed? Can I even do this? Is there a logical work around?Got it.
I first created the concatenated values as a non-base table item on my form:
:NBT_PRIMARY_KEY_VALUES := :bundle_exceptions.project_cd||','||:bundle_exceptions.bundle||','||:bundle_exceptions.exception_cd;
Then my join condition simply became:
ttms_audit.primary_key_values = bundle_exceptions.nbt_primary_key_values
Maybe you are looking for
-
I received a 27 LED apple/mac monitor --not the 2011/12 version though. I want to use with my work computer--a dell laptop. I can't seem to find the right adaptor to connect the two. I need a dvi port converter that also connects to my vga on my lap
-
Work on .an files on different computers
I created an animation in Edge on my PC. Later when I went to continue working on the file on my laptop, it would not load, and I got an error message sating that the .an file could not load as the associated html file could not be found, even though
-
Error while creation Shift Report SHR1
Hi, i created shift report type and assigned to Resource and the same resource used in Master Recipe. i can create Shift note using SHN1 but when i am creating Shift Report (SHR1) i am getting error -- Not possible to create shift report for work cen
-
I try to publish my web by iWeb to Web.me.com got a message: There is error updating mobileme, so who can tell me what can I do
-
Capture DDL for Oracle Scheduled Jobs and job from DBMA_JOBS
I have trying at this for while and now I am stuck...so I need some help or advice. I am doing a DB migration and I need to capture the DDL for all Oracle Scheduled Jobs as well as DBMS_JOBS. Anyone have a good way? I took a datapump export last week