Report generation with two tables having no join
Hi,
I would like to know if i can generate a report to view data from purchase and sales tables at one time even if they are not directly linked.
Regards,
Bhavna
hi jain,
You can use Union All to combine sql queries of sales and
purchase tables.
Jeyakanthan.
Similar Messages
-
How to specify more than Two Tables in NATURAL JOIN
Hi,
I am using Oracle9i R-2. I want help in writing a Query using Two Tables in SQL*PLUS. I am using ANSI/ISO Standrard for table-joins:
select col1, col2, descr
from tab1 natural join tab2
There are two columns col1 & col2 is common between thse two tables. So, it will join them and query execute well.
How can i use 3rd table tab3 in the same way in Natural Join...? If column col1 & col2 is available in tab3 also.
I tried this way, but it gives me error:
select col1, col2
from tab1 natural join tab2 natural join tab3
Is it possible to specify more than two tables in Natural Join Clause.
Please check that out & help please. Thanks.
Regards,
Kamesh RastogiI do not get an error when I try the same thing on the same version, as demonstrated below. Can you post your table structure and a copy and paste of a run of your actual query with the error that you are receiving?
scott@ORA92> select banner from v$version
2 /
BANNER
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production
scott@ORA92> select * from tab1
2 /
COL1 COL2 COL3
1 1 A
10 10 B
scott@ORA92> select * from tab2
2 /
COL1 COL2 COL4
1 1 C
20 20 D
scott@ORA92> select * from tab3
2 /
COL1 COL2 COL5
1 1 E
30 30 F
scott@ORA92> select col1, col2, col3, col4, col5
2 from tab1 natural join tab2 natural join tab3
3 /
COL1 COL2 COL3 COL4 COL5
1 1 A C E
scott@ORA92> -
For All Entries with two tables
Hi All,
Can we use FOR ALL ENTRIES with two tables. for example
SELECT * FROM MKPF INTO TABLE T_MKPF
WHERE BUDAT IN S_BUDAT.
SELECT * FROM MARA INTO TABLE T_MARA
WHERE MTART IN S_MTART AND
MAKTL IN S_MAKTL.
SELECT * FROM MSEG INTO TABLE T_MSEG
FOR ALL ENTRIES IN "T_MKPF AND T_MARA"
WHERE MBLNR EQ T_MKPF-MBLNR AND
MATNR EQ T_MARA-MATNR.
can we do it like this or any other way to do this plz tell. I waitting for your responce.
Thanks
JitendraHi,
u cannot do like this....chek some documentation on it..
1. duplicate rows are automatically removed
2. if the itab used in the clause is empty , all the rows in the source table will be selected .
3. performance degradation when using the clause on big tables.
Say for example you have the following abap code:
Select * from mara
For all entries in itab
Where matnr = itab-matnr.
If the actual source of the material list (represented here by itab) is actually another database table, like:
select matnr from mseg
into corresponding fields of table itab
where .
Then you could have used one sql statement that joins both tables.
Select t1.*
From mara t1, mseg t2
Where t1.matnr = t2.matnr
And T2 ..
So what are the drawbacks of using the "for all entires" instead of a join ?
At run time , in order to fulfill the "for all entries " request, the abap engine will generate several sql statements (for detailed information on this refer to note 48230). Regardless of which method the engine uses (union all, "or" or "in" predicates) If the itab is bigger then a few records, the abap engine will break the itab into parts, and rerun an sql statement several times in a loop. This rerun of the same sql statement , each time with different host values, is a source of resource waste because it may lead to re-reading of data pages.
returing to the above example , lets say that our itab contains 500 records and that the abap engine will be forced to run the following sql statement 50 times with a list of 10 values each time.
Select * from mara
Where matnr in ( ...)
Db2 will be able to perform this sql statement cheaply all 50 times, using one of sap standard indexes that contain the matnr column. But in actuality, if you consider the wider picture (all 50 executions of the statement), you will see that some of the data pages, especially the root and middle-tire index pages have been re-read each execution.
Even though db2 has mechanisms like buffer pools and sequential detection to try to minimize the i/o cost of such cases, those mechanisms can only minimize the actual i/o operations , not the cpu cost of re-reading them once they are in memory. Had you coded the join, db2 would have known that you actually need 500 rows from mara, it would have been able to use other access methods, and potentially consume less getpages i/o and cpu.
In other words , when you use the "for all entries " clause instead of coding a join , you are depriving the database of important information needed to select the best access path for your application. Moreover, you are depriving your DBA of the same vital information. When the DBA monitors & tunes the system, he (or she) is less likely to recognize this kind of resource waste. The DBA will see a simple statement that uses an index , he is less likely to realize that this statement is executed in a loop unnecessarily.
Beore using the "for all entries" clause and to evaluate the use of database views as a means to:
a. simplify sql
b. simplify abap code
c. get around open sql limitations.
check the links
http://www.thespot4sap.com/articles/SAPABAPPerformanceTuning_ForAllEntries.asp
The specified item was not found.
Regards,
Nagaraj -
I am trying to develop a query in MS Access 2010 to join two tables using three joins, one of which is a (between) date range. The tables are contained in Access. The reason
the tables are contained in access because they are imported from different ODBC warehouses and the data is formatted for uniformity. I believe this cannot be developed using MS Visual Query Designer. I think writing a query in SQL would be suiting this project.
ABCPART links to XYZPART. ABCSERIAL links to XYZSERIAL. ABCDATE links to (between) XYZDATE1 and ZYZDATE2.
[ABCTABLE]
ABCORDER
ABCPART
ABCSERIAL
ABCDATE
[ZYXTABLE]
XYZORDER
XYZPART
XYZSERIAL
XYZDATE1
XYZDATE2Thank you for the looking at the post. The actual table names are rather ambiguous. I renamed them so it would make more sense. I will explain more and give the actual names. What I do not have is the actual data in the table. That is something I don't have
on this computer. There are no "Null" fields in either of the tables.
This table has many orders (MSORDER) that need to match one order (GLORDER) in GLORDR. This is based on MSPART joined to GLPART, MSSERIAL joined to GLSERIAL, and MSOPNDATE joined if it falls between GLSTARTDATE and GLENDDATE.
[MSORDR]
MSORDER
MSPART
MSSERIAL
MSOPNDATE
11111111
4444444
55555
2/4/2015
22222222
6666666
11111
1/6/2015
33333333
6666666
11111
3/5/2015
This table has one order for every part number and every serial number.
[GLORDR]
GLORDER
GLPART
GLSERIAL
GLSTARTDATE
GLENDDATE
ABC11111
444444
55555
1/2/2015
4/4/2015
ABC22222
666666
11111
1/5/2015
4/10/2015
AAA11111
555555
22222
3/2/2015
4/10/2015
Post Query table
GLORDER
MSORDER
GLSTARTDATE
GLENDDATE
MSOPNDATE
ABC11111
11111111
1/2/2015
4/4/2015
2/4/2015
ABC22222
22222222
1/5/2015
4/10/2015
1/6/2015
ABC22222
33333333
1/5/2015
4/10/2015
3/5/2015
This is the SQL minus the between date join.
SELECT GLORDR.GLORDER, MSORDR.MSORDER, GLORDR.GLSTARTDATE, GLORDR.GLENDDATE, MSORDR.MSOPNDATE
FROM GLORDR INNER JOIN MSORDR ON (GLORDR.GLSERIAL = MSORDR.MSSERIAL) AND (GLORDR.GLPART = MSORDR.MSPART); -
Creation of Library and Report in Report Painter with Z tables.
HI,
When I am creating library in report painter with Z table it is giving the following error message 'Table ZCO_SEMI_FIN_VAL is not installed in Report Writer'.
Can u help me how u install Z table in report painter and create the characteristic and key figure of the Z table in the library.
Regards,
Partha BHi Partha Pratim Bhar,
In order to bring / enable a Z table for you to build a library, you will have to set it at transaction GRCT.
Here you need to configure - table (Z table) , characteristics and Key figures.
You can refer any other tables by SAP in GRCT for reference.
Revert if you require additional help.
Regards,
Subin John -
Construing a report writer with a table of client - Table YSCO_BASE_ALOCAC
I am construing a report writer with a table of client - Table YSCO_BASE_ALOCAC
When I definition the library, the message is show...
Table YSCO_BASE_ALOCAC is not installed in Report Writer.
Message no. GR 493
Diagnosis
The Report Writer can only report on tables if the attributes of these tables that are relevant for reporting are defined in control tables. This is not the case for table YSCO_BASE_ALOCAC.
Where I can to make this configuration?hey thanks again
i tried it it works fine..
WITH e AS
SELECT consultant , client , project
, task , effort ,date_ , billable
FROM trial_3_details
SELECT *
FROM e
PIVOT ( sum (effort)
FOR date_ IN ( '07/22/2013' AS monday ,
'07/23/2013' as tuesday,
'07/24/2013' as wednesday,
'07/25/2013' as thrusday,
'07/26/2013' as friday,
'07/27/2013' as saturday,
'07/28/2013' as sunday
CONSULTANT
CLIENT
PROJECT
TASK
BILLABLE
MONDAY
TUESDAY
WEDNESDAY
THRUSDAY
FRIDAY
SATURDAY
SUNDAY
Syed
Facebook
Security
Privacy Settings
N
Syed
Google
Security
gmail privacy features
Y
8
Patel
Dell
Recruitment
Profile Detailing
Y
Sanjay
Google
Software
Webpage development
Y
John
Dell
Hardware
Processors
Y
Steve
Lenovo
Administration
Attendance
N
Syed
Yahoo
Security
Firewall Check
Y
Sanjay
Google
Software
debugging
N
Steve
Microsoft
Adminstration
Attendance
N
Steve
Yahoo
Adminstration
Attendance
N
One more question how do i automatically set the days instead of explicitly declaring it every time?? and also i want to add one more column
which gives overall week 'effort' of a consultant.. -
Can i use my ipod 4th generation with two computers?
can i use my ipod 4th generation with two computers?
iTunes- How to move the library to an EHD
Recovering your iTunes library from your iPod or iOS device
iTunes- Back up your iTunes library by copying to an external hard drive -
Joining two tables having no common fields using one select query
Hi Experts,
How to join two tables which are NOT having any field in common using only one select query?
Your help will be appreciated.
Thank you.Identify a third table (or more tables) with common fields with your two tables, or change your question either removing JOIN or removing NO COMMON FIELDS, else you wont get many responses and will be left alone in outer space, as suggested by Thomas.
If you acturally require what you written, better execute two select and merge the two internal tables merging every record from first table with every record of second table, til no more memory is available.
Regards,
Raymond -
*& Report ZRAHUL_ALV_SFLIGHT2
REPORT zrahul_alv_sflight2 NO STANDARD PAGE HEADING.
TYPE-POOLS slis.
DATA: fcat TYPE slis_fieldcat_alv,
it_fcat TYPE slis_t_fieldcat_alv,
fcat1 TYPE slis_fieldcat_alv,
it_fcat1 TYPE slis_t_fieldcat_alv,
fcat2 TYPE slis_fieldcat_alv,
it_fcat2 TYPE slis_t_fieldcat_alv,
lout TYPE slis_layout_alv,
head TYPE slis_listheader,
it_head TYPE slis_t_listheader.
TABLES: SFLIGHT, SCURX, SAPLANE.
DATA: BEGIN OF it_sflight OCCURS 0,
carrid TYPE sflight-carrid, "PK
connid TYPE sflight-connid,
fldate TYPE sflight-fldate,
currency TYPE sflight-currency, "FK 1
planetype TYPE sflight-planetype, "FK 2
END OF it_sflight.
DATA: BEGIN OF it_scurx OCCURS 0,
currkey TYPE scurx-currkey, "PK 1
currdec TYPE scurx-currdec,
END OF it_scurx.
DATA: BEGIN OF it_saplane OCCURS 0,
planetype TYPE saplane-planetype, "PK 2
seatsmax TYPE saplane-seatsmax,
tankcap TYPE saplane-tankcap,
weight TYPE saplane-weight,
END OF it_saplane.
SELECTION-SCREEN: BEGIN OF BLOCK blk WITH FRAME TITLE t.
SELECT-OPTIONS: id FOR it_sflight-carrid,
id2 FOR it_sflight-connid.
SELECTION-SCREEN END OF BLOCK blk.
INITIALIZATION.
t = 'enter required criterias'.
lout-zebra = 'X'.
START-OF-SELECTION.
SELECT * FROM sflight INTO CORRESPONDING FIELDS OF TABLE it_sflight
WHERE carrid IN id AND connid IN id2.
END-OF-SELECTION.
****FCAT F0R IT_SFLIGHT
fcat-col_pos = 1.
fcat-tabname = 'IT_SFLIGHT'.
fcat-fieldname = 'CARRID'.
fcat-outputlen = 10.
fcat-seltext_m = 'PLANE ID'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = 2.
fcat-tabname = 'IT_SFLIGHT'.
fcat-fieldname = 'CONNID'.
fcat-outputlen = 10.
fcat-seltext_m = 'CONN ID'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = 3.
fcat-tabname = 'IT_SFLIGHT'.
fcat-fieldname = 'FLDATE'.
fcat-outputlen = 10.
fcat-seltext_m = 'FLDATE'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = 4.
fcat-tabname = 'IT_SFLIGHT'.
fcat-fieldname = 'CURRENCY'.
fcat-outputlen = 10.
fcat-seltext_m = 'CURRENCY'.
APPEND fcat TO it_fcat.
CLEAR fcat.
fcat-col_pos = 5.
fcat-tabname = 'IT_SFLIGHT'.
fcat-fieldname = ';PLANETYPE'.
fcat-outputlen = 10.
fcat-seltext_m = 'PLANETYPE'.
APPEND fcat TO it_fcat.
CLEAR fcat.
*****GRID DISPLAY
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = 'ZRAHUL_ALV_SFLIGHT2'
I_CALLBACK_PF_STATUS_SET = ' '
i_callback_user_command = 'CLICK'
i_callback_top_of_page = 'HEADER'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
i_grid_title = 'GRID 1'
I_GRID_SETTINGS =
is_layout = lout
it_fieldcat = it_fcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_sflight
EXCEPTIONS
PROGRAM_ERROR = 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.
*& Form header
text
FORM header.
CLEAR it_head.
head-typ = 'H'.
head-info = 'KINGFISHER'.
APPEND head TO it_head.
head-typ = 'S'.
head-key = 'KEY'.
head-info = 'AIRLINES'.
APPEND head TO it_head.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_head
i_logo = 'KING_LOGO'
I_END_OF_LIST_GRID =
I_ALV_FORM =
ENDFORM. "header
*& Form CLICK
text
-->OK text
-->SEL text
FORM click USING ok TYPE sy-ucomm
sel TYPE slis_selfield.
CLEAR it_fcat.
CASE ok.
WHEN '&IC1'.
********SAPLANE RELATION
READ TABLE it_sflight INDEX sel-tabindex.
SELECT * FROM saplane INTO CORRESPONDING FIELDS OF TABLE it_saplane WHERE planetype = it_sflight-planetype.
fcat-col_pos = 1.
fcat-tabname = 'IT_SAPLANE'.
fcat-fieldname = 'PLANETYPE'.
fcat-outputlen = 10.
fcat-seltext_m = 'TYPE OF PLANE'.
APPEND fcat TO it_FCAT.
CLEAR fcat.
fcat-col_pos = 2.
fcat-tabname = 'IT_SAPLANE'.
fcat-fieldname = 'SEATSMAX'.
fcat-outputlen = 10.
fcat-seltext_m = 'MAX SEATS'.
APPEND fcat TO it_FCAT.
CLEAR fcat.
fcat-col_pos = 3.
fcat-tabname = 'IT_SAPLANE'.
fcat-fieldname = 'TANKCAP'.
fcat-outputlen = 10.
fcat-seltext_m = 'FUEL TANK CAPACITY'.
APPEND fcat TO it_FCAT.
CLEAR fcat.
fcat-col_pos = 4.
fcat-tabname = 'IT_SAPLANE'.
fcat-fieldname = 'WEIGHT'.
fcat-outputlen = 10.
fcat-seltext_m = 'WEIGHT F PLANE'.
APPEND fcat TO it_FCAT.
CLEAR fcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
i_callback_program = 'ZRAHUL_ALV_SFLIGHT2'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
i_callback_top_of_page = 'HEADER'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
i_grid_title = 'GRID 2'
I_GRID_SETTINGS =
is_layout = LOUT
it_fieldcat = IT_FCAT
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
tables
t_outtab = IT_SAPLANE
EXCEPTIONS
PROGRAM_ERROR = 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.
*******SCURX RELATION
CLEAR: IT_FCAT2,IT_FCAT.
READ TABLE IT_SFLIGHT INDEX SEL-TABINDEX.
SELECT * FROM SCURX INTO CORRESPONDING FIELDS OF TABLE IT_SCURX WHERE CURRKEY = IT_SFLIGHT-CURRENCY.
FCAT2-COL_POS = 1.
FCAT2-TABNAME = 'IT_SCURX'.
FCAT2-FIELDNAME = 'CURRKEY'.
FCAT2-OUTPUTLEN = 15.
FCAT2-SELTEXT_M = 'CURRENCY'.
APPEND FCAT2 TO IT_FCAT2.
CLEAR FCAT2.
FCAT2-COL_POS = 2.
FCAT2-TABNAME = 'IT_SCURX'.
FCAT2-FIELDNAME = 'CURRDEC'.
FCAT2-OUTPUTLEN = 15.
FCAT2-SELTEXT_M = 'CURRENCY DEC'.
APPEND FCAT2 TO IT_FCAT2.
CLEAR FCAT2.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'ZRAHUL_ALV_SFLIGHT2'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = 'HEADER'
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE = 'GRID 3'
I_GRID_SETTINGS =
IS_LAYOUT = LOUT
IT_FIELDCAT = IT_FCAT2
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
I_HTML_HEIGHT_TOP = 0
I_HTML_HEIGHT_END = 0
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
IR_SALV_FULLSCREEN_ADAPTER =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = IT_SCURX
EXCEPTIONS
PROGRAM_ERROR = 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.
ENDCASE.
ENDFORM. "click
this program runs fine when one navigation is used......but when both the foreign keys come in picture then its shows sequencialy...cant we jump directly to the third one which i require....
plz guide me.thank u.in short i want help on table having multiple foreign keys....and how to navigate in this when working on ALV reports.....
its easy when using interactive reports by using sy-cucol and sy-curow.....
reply asap.
thank u in advance. -
Join two tables having time period data
I have two tables like below.
empid
Datefrom
Dateto
salary
123
1/1/2010
12/31/2010
2300
123
1/1/2011
12/31/2013
2400
123
1/1/2014
12/31/9999
2500
second table
empid
Datefrom
Dateto
cc
123
1/1/2010
12/31/2011
c1
123
1/1/2012
12/31/9999
c2
I need to join above two tables such that the below table should be the output:
empid
Datefrom
Dateto
cc
salary
123
1/1/2010
12/31/2010
c1
2300
123
1/1/2011
12/31/2011
c1
2400
123
1/1/2012
12/31/2013
c2
2400
123
1/1/2014
12/31/9999
c2
2500
Can anyone give hint how to write scripted CV to generate the o/p table above?You might just ask: how must an SQL statement look like for that?
From what I understand, you want to find the matching "cc" value for every record in the first table.
Matching means that the time frame specified by "Datefrom" and "Dateto" lies within the time frame in the second table (also limited by "Datefrom" and "Dateto").
I will leave aside any possible problem where "Datefrom" might not be smaller or equal "Dateto" and that any range of validity might overlap.
This is up to your modeling and design to care about.
Given that requirement you could write the query like this:
SELECT ...
FROM
<first_table> T1 outer join <second_table> T2
on T1."Datefrom" >= T2."Datefrom"
and T1."Dateto" <= T2."Dateto"
If that doesn't do it for you, please do as Dubravko wrote and provide the SQL commands to create the tables so that we can work with that easily.
- Lars -
Display columns from two tables without making join
Hi,
I need to perform currency conversion in the report.
For eg:) Whatever the currency in ar_payment_schedules i want to
convert it to INR equivalent.
Following is the query to do this.
select ps.invoice_currency_code Currency_B,
decode(ps.invoice_currency_code, 'INR',ps.amount_due_original,
round(ps.amount_due_original*
ps.exchange_rate,
curr.precision)
from
ar_payment_schedules ps,
fnd_currencies curr
where ps.customer_id = '111'
and curr.currency_code = 'INR'
When i do this in the Administration tool, the answers modules erroring out saying
that no joins between ar_payment_schedules and fnd_currencies. But here join is
not needed becuase fnd_currencies is filtered with INR and will return only
one row. Without joining two tables how can i get the same results in Answers.
thanks,
PrasannaIf it would return only one row then what is the need for the join (is it just for returning the precision?). Cant you just hard code the precision value instead of getting it from the table? Also you are doing a cartesian join, though the filters would take care of the final output this would result in a bad performance as your data starts scaling out. You need to find a key to join these 2 tables. If you do not have one, then just create a view with the cartesian join alone and then use that in your report.
Thanks,
Venkat
http://oraclebizint.wordpress.com -
-1073741819 code using Report Generation with LV 6.1
I'm studing about the Report Generation Functions with LV 6.1, and I'm trying to run some example about it, but the programs sends the next error: "Error -1073741819 ocurred at unknown System error in Font Style.vi> Set report font.vi>Easy text report.vi
>. I'm using Windows XP plataform.
someone knows what can I do?
Thanks for your helpMaybe you already know this but the font settings is a cluster of 4 elements: 2 integers and 2 strings. The 2 integers are character set and weight. They default to -1. The two strings are font name and font size. The default to blank strings. Are you wiring this cluster into your font settings terminal? Do you have -1, -1, Arial, and a number for font size inside the cluster (I use 4 for HTML reports)?
- tbob
Inventor of the WORM Global -
Report Generation MS Word Table Bug
Hi everybody,
I am using Word 2010 and LV2010 and I am unable create a proper table with Word using the Report Generation Toolkit. Excel and HTML work fine, but Word fails. Not even the Examples work as they are supposed to.
When using the attached VI (see screenshot below)
the result appears as follows:
Temperature
Temperature
Temperature
Temperature
Temperature
Data 1
Data 1
Data 1
Data 1
Data 1
Data 2
Data 2
Data 2
Data 2
Data 2
Does anyone have an idea?
Thanks in advance.
ben
Solved!
Go to Solution.
Attachments:
test_table.vi 10 KBOK, if NI won't provide a workaround, I'll create my own:
The problem stems from the fact that the NI Report Toolkit populate a Word table by first creating an empty table of the correct size, then placing the table contents into the copy buffer, then selects the whole table and uses Paste to push the data into the table. The problem is actually in Word, because in Word 2010 it interprets the contents of the copy buffer differently.
The solution is to alter the data that gets pushed into the copy buffer by the NI Report Toolkit. To implement my fix, you will need to alter one VI of the NI Report Toolkit (so you might want to make a backup in case this stops it from working in other previous release of Word).
Open [LabVIEW installation folder]\vi.lib\addons\_office\_wordsub.llb\Word_Insert_Table.vi
There is a nested for loop that interprets the provided string array data and reformats it into a long ASCII string for the copy buffer. It should look like this:
Change the nested loop to look like this:
The changes I've made are twofold:
1. Within the inner loop, replace the "\n" char with a Tab character
2. Just after the inner loop, add a new "concatenate strings" function that adds "\n".
This alters the string that the toolkit places into the copy buffer. You should find that report tables now populate correctly in Word 2010!
This is untested on previous releases of Word, and could possible introduce problems there, so if anyone could test this for me it would be most appreciated
Best of luck!
Thoric (CLA, CLED, CTD and LabVIEW Champion) -
How to deal with two tables in the Data Base
Hi Experts,
IF WE WANT TO GET THE DATA FROM THE TWO TABLES, WHAT QUERY SQL STATEMNET SHOULD HAVE TO WRITE AND ANY CONFIGURATION CHANGES NEED TO BE DONE AND WHAT SETTINGS NEED TO BE DONE IN THE ESR .
PLEASE EXPLAIN ME ON THIS .
THANKS IN ADVANCE.
RAMIf you are using the same database and referencing two tables then you dont need special configuration for it. You use single jdbc adapter. In ESR you create two statment structure one for each table. This is one option. The second option is use join statment and write query and in this case one statment data structure.
Please go through the help sap link for the jdbc document structure.
http://help.sap.com/SAPHELP_NW04s/helpdata/EN/2e/96fd3f2d14e869e10000000a155106/content.htm
The second option can be done using the below structure.
<StatementName>
<anyName action=u201D SQL_QUERYu201D >
<access>SQL-String with optional placeholder(s)</access>
<key>
<placeholder1>value1</placeholder1>
<placeholder2>value2<placeholder2>
</key>
</anyName >
</StatementName> -
XML generation from two tables
Hi,
I need to write an Oracle SP(Id as input) create an XML strucutre out of the records fetched from two tables. There is no Fk relation between the tables.
Table A ---> has one record per interface per id
Table B---> has multiple records per interface per id
Table A
1) Id
2)ErrorCount
3)SuccessCount
4)Total
5)InterfaceName
Table B
1)Id
2)InterfaceName
3)ErrorDetail
4)ErrorMessage
XML Strucutre
<Report>
<TableA>
<Id>
<InterfaceName>
<Success/>
<Total/>
</InterfaceName>
</Id>
</TableA>
<TableB>
<Id>
<InterfaceName>
<ErrorDetail/>
<ErrorMesage/>
</InterfaceName>
</Id>
</TableB>
</Report>
Thanks,
Is
Edited by: Is916 on Sep 16, 2009 2:27 AMThere are several ways to general XML.
Here's just one...
with A as (select 1 as id, 2 as errorcount, 4 as successcount, 6 as total, 'Bob' as interfacename from dual union all
select 2, 1, 4, 5, 'Fred' from dual)
,B as (select 1 as id, 'Bob' as interfacename, 'Error 1' as errordetail, 'Ouch that hurt' as errormessage from dual union all
select 1 as id, 'Bob', 'Error 2', 'Why did this happen' from dual union all
select 2, 'Fred', 'Warning', 'Why worry about it' from dual)
select xmlelement("Report",
A.xml, B.xml
) as xml
from (select xmlelement("TableA",
xmlelement("Id",
xmlelement("Success", successcount),
xmlelement("Total", total)
) as xml
from A where A.id = 1) A
,(select xmlagg(xmlelement("TableB",
xmlelement("Id",
xmlelement("InterfaceName",
xmlelement("ErrorDetail", errordetail),
xmlelement("ErrorMessage", errormessage)
) as xml
from B where B.id = 1) B
<Report>
<TableA>
<Id>
<Success>4</Success>
<Total>6</Total>
</Id>
</TableA>
<TableB>
<Id>
<InterfaceName>
<ErrorDetail>Error 1</ErrorDetail>
<ErrorMessage>Ouch that hurt</ErrorMessage>
</InterfaceName>
</Id>
</TableB>
<TableB>
<Id>
<InterfaceName>
<ErrorDetail>Error2</ErrorDetail>
<ErrorMessage>Why did this happen</ErrorMessage>
</InterfaceName>
</Id>
</TableB>
</Report>
Maybe you are looking for
-
Adding Software Updates to Software Groups After Deployment
Hi all - I went through and created 3 software update groups (for 2013, 2014, and 2015), and then distributed all three of them to a certain collection (and to all DPs). After that point, I then realized I had forgotten a number of updates for each s
-
How to speed up airport making wifi connection after mac wakes up?
Hi, I have the latest 27" iMac (2011) with the highest spec. I could buy from the Apple Store. (except that I don't have SSD). When I wake the Mac from sleep mode, it takes 5 - 10 seconds for airport to find my home WiFi signal. I'm now in a house wh
-
Regarding module pool programming
hi champions, i m using table control in my screen no doubt the horizontal scroll is coming but vertical scroll is not,vud u plz tell me wat sud i do so dat the vertiacal scroll will appear i hv to display the multiple records. in
-
My iPhone 3GS on iOS 5.1 will randomly stop what I'm doing show a black screen then the spinning icon and then it shows my lockscreen. It takes about a minute to do this and it does it about 30 times a day. How do I fix this? It is EXTREMELY ANNOYING
-
Pro Tools won't install. Startup disk full-not true.
I'm trying to install Pro Tools 10.2 on a Mac Book Pro OS X 10.7.4. I'm doing a clean install, but the installation won't complete. It bogs down half way through. I finally have to force quit the installer because it says my startup disk is full.