RFC fetching data from table which is not commited
Hi Experts,
I have a query regarding commit work.Below is the RFC that i have written
FUNCTION ZBAPI_CREATE.
*"*"Local Interface:
*" TABLES
*" IT_ZABAP_RFC STRUCTURE ZBAPI_RFC_STR OPTIONAL
*" RETURN STRUCTURE BAPIRET2 OPTIONAL
CALL FUNCTION 'ZBO_BAPI_CREATE'
TABLES
IT_ZABAP_RFC = IT_ZABAP_RFC
RETURN = return
Break-point.
DATA lt TYPE TABLE OF ZBAPI_RFC_STR_MAIN.
CALL FUNCTION 'ZBAPI_SEARCH_RANGE'
* EXPORTING
* IS_STR =
TABLES
ET_TAB = lt
* RETURN =
ENDFUNCTION.
here in first RFC call i am creating a record in ZTABLE , and then at break-point
i check the ZTABLE where it does not create any record because data is not commited into ZTABLE upto this point, but just after it i have written code for fetching data from ZTABLE but i am able to get this new record in lt.
Can anybody please explain that from where this serach RFC is providing data because inside serach i am simply selecting data from ZTABLE.
Regards,
Abhishek Bajpai
Edited by: ABHISHEK BAJPAI on Jan 28, 2009 1:12 PM
Hi Thomas,
Thanks for reply , i checked in ZTABLE ,before search RFC call data is not there but if i commit explicitly only then it is showing data in ZTABLE. Actually my requirement is different -
I have two RFCs 1. Create 2. Search , Now from web dynpro user will call first Create RFCs but at this point it should not insert record in ZTABLE and just after it user will call another search RFC and in this search he should be able to get these newly created records.
I want to have the functionality which a user gets when working with normal database front end like SQLPLus for Oracle. In these scenarios we see that whenever user does any insert or update the data sits in the table but still it is not committed. So there he fires Select query he sees the inserted data. But if he logs off from SQL PLUS and then logs in again, and fires Select query he does not see the data as it was not committed. I want a similiar functionalty in which if user inserts the data through Create RFC and fires the Select query through Search RFC then he can see the newly Created data also even though this data is not committed.
Although if i call create RFC in update task it will not update ZTABLE but in this situation , if user will call search RFC he will not be able to get newly created records.
So my requirement is that i should be able to get those records which are not commited in ZTABLE .If you have still any doubt regarding my question then please let me know.
Regards,
Abhishek
Similar Messages
-
Delete records from tableA which are not in tableB
Table A contains milions of records which is the best way to delete records from tableA which are not in tableB
delete from tableA where empno not in (select empno from tableb)
or
delete from tableA where empno not exists (select empno from tableb
where b.empno=a.empno)
any helpHi
If you can do this, do with this:
create table tableC
as select a.*
from tableA a,
(select empno from tableA
minus
select empno from tableB) b
where a.empno = b.empno;
drop table tableA;
rename table tableC to tableA;
Ott Karesz
http://www.trendo-kft.hu -
Fetch data from table(ET_) which is exporting parameter of function module
Hi,
I m new to ABAP programming.
I have to develop a smartform that has to be filled in with fields from few tables.
These tables have the naming convention ET_<XXX> (i.e. exporting parameter of function module).
I m not able to directly view its contents in se11 or use select query for it.
I have a report program which i can execute to view these parameter names.
Now, how do i fetch data from these parameters/tables and pass it from my driver program to smartform??
Someone pls guide me...
Thank You.Hi,
I have done that using Field-Symbols.
Thanks,
Preetha -
Hi all,
I am using function module through Call fucntion.
There i am getting <b>Table Name</b> as import Parameter.
Now i need to fetch data from that table (Which name we got througfh function module).
Is there any point to know how can we fetch data from runtime table .
i need some sample code for this.
Thanks inn advance,
Regards,
BhaskarHello Bhaskar,
I don't have an SCM system, so I cannot test out that FM
However, I modified the above code to update the table as well
*& Report ZKRIS_DYNAMIC_TABLE_READ_MOD
REPORT ZKRIS_DYNAMIC_TABLE_READ_MOD LINE-SIZE 256.
DATA : LV_FIELD_DESC TYPE STRING.
DATA : LV_DATA1 TYPE STRING.
DATA : LV_DETAIL(128).
DATA : COMMA TYPE C VALUE ','.
DATA : LV_TNAME LIKE DD02L-TABNAME.
DATA : LV_DBTAB1 LIKE DD02L-TABNAME.
DATA : DREF TYPE REF TO DATA.
DATA : FLAG_MODIFIED. " determines if database needs to be updated
FIELD-SYMBOLS: <ITAB> TYPE ANY TABLE, " used to store dynamic tables
<WA> TYPE ANY, " used to store record data
<WA1> TYPE ANY . " used to store field data
* call Fm /SAPAPO/TS_PA_COPY_TABLE_GET here
LV_DBTAB1 = 'ZGSTSET'. " <-- put your table name here
DATA: IT_FIELDS TYPE X031L OCCURS 0.
DATA: WA_FIELDS LIKE LINE OF IT_FIELDS.
CALL FUNCTION 'DDIF_NAMETAB_GET'
EXPORTING
tabname = LV_DBTAB1
* ALL_TYPES = ' '
* LFIELDNAME = ' '
* GROUP_NAMES = ' '
* UCLEN =
* IMPORTING
* X030L_WA =
* DTELINFO_WA =
* TTYPINFO_WA =
* DDOBJTYPE =
* DFIES_WA =
* LINES_DESCR =
TABLES
X031L_TAB = IT_FIELDS
* DFIES_TAB =
EXCEPTIONS
NOT_FOUND = 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.
* we do not know the sized of the table that must be generated beforehand
* hence we use field symbols to dynamically generate the internal table
CREATE DATA DREF TYPE STANDARD TABLE OF (LV_DBTAB1)
WITH NON-UNIQUE DEFAULT KEY.
ASSIGN DREF->* TO <ITAB> .
* selects all data
SELECT * FROM (LV_DBTAB1) INTO TABLE <ITAB> .
LOOP AT <ITAB> ASSIGNING <WA>.
FLAG_MODIFIED = ''.
LOOP AT IT_FIELDS INTO WA_FIELDS.
ASSIGN COMPONENT WA_FIELDS-FIELDNAME OF STRUCTURE <WA>
TO <WA1>.
IF WA_FIELDS-FIELDNAME = 'FIRSTNAME'. " fieldname in the table you wish to modify
IF <WA1> = 'Kris'. " old value
<WA1> = 'NewName'. " new value
MODIFY TABLE <ITAB> FROM <WA>.
FLAG_MODIFIED = 'X'.
ENDIF.
ENDIF.
WRITE <WA1>. " comment this line to remove the display
ENDLOOP.
IF FLAG_MODIFIED = 'X'. " updates database only if the record was changed
UPDATE (LV_DBTAB1) FROM <WA>.
* note that if the field you choose is a key field, sy-subrc will be set to 4
ENDIF.
* display
NEW-LINE.
ENDLOOP. -
Select query taking 30 sec to fetch data from table containing BLOB column.
Hi Friends,<o:p></o:p>
Please help me...<o:p></o:p>
I have 15 columns in a table, in that 2 columns containing blob (images).<o:p></o:p>
More than 22 lakhs records are in a table.<o:p></o:p>
While i am try to fetch data from this table it nearly takes 25~30 sec to execute that query.<o:p></o:p>
When i deleted the two columns containing blob and i tried its executing fast .<o:p></o:p>
I should not change the table schema.<o:p></o:p>
Views also i created and indexes also there in a table.<o:p></o:p>
How can i improve the query execution speed?.<o:p></o:p>And how large is the size of BLOB data in your table? If it's several giga bytes, then the time is simply required to read the amount of data from disk and to transfer it to the Client.
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Function module to fetch data from table SETLEAVES
Hi All,
We have a requirement to fetch the data from table SETLEAVES based on the setclass,subclass and group. As the table holds hierarchical data, Please let me know a FM which fetches all the hierarchical data from the table SETLEAVES.
Regards
ShivaTry:
exporting
e_class = '0102'
e_setid = setid
e_kokrs = my_kokrs
e_mandt = sy-mandt
e_master_data = 'XXX'
e_structure = 'X X0200'
e_replace_class = space
e_replace_unit = space
e_suffix = space
e_old_line_level = 1 "l_ol_level
tables
t_nodes = it_ceg_nodes
t_values = it_ceg_values
changing
c_info = c_info
c_overwrite = c_overwrite
exceptions
no_controlling_area = 1
no_chart_of_account = 2
different_controlling_areas = 3
different_chart_of_accounts = 4
set_not_found = 5
illegal_field_replacement = 6
illegal_table_replacement = 7
fm_raise = 8
convert_error = 9
no_overwrite_standard_hier = 10
no_bukrs_for_kokrs = 11
others = 12.
Rob -
Issue:
I have SAP BW system and SAP HANA System
SAP BW to SAP HANA connecting through a DB Connection (named HANA)
Whenever I created any Open Hub as Destination like DB Table with the help of DB Connection, table will be created at HANA Schema level ( L_F50800_D )
Executed the Open Hub service without checking DELETING Data from table option
Data loaded with 16 Records from BW to HANA same
Second time again executed from BW to HANA now 32 records came ( it is going to append )
Executed the Open Hub service with checking DELETING Data from table option
Now am getting short Dump DBIF_RSQL_TABLE_KNOWN getting
If checking in SAP BW system tio SAP BW system it is working fine ..
will this option supports through DB Connection or not ?
Please follow the attachemnet along with this discussion and help me to resolve how ?
From
Santhosh KumarHi Ramanjaneyulu ,
First of all thanks for the reply ,
Here the issue is At OH level ( Definition Level - DESTINATION TAB and FIELD DEFINITION )
in that there is check box i have selected already that is what my issue even though selected also
not performing the deletion from target level .
SAP BW - to SAP HANA via DBC connection
1. first time from BW suppose 16 records - Dtp Executed -loaded up to HANA - 16 same
2. second time again executed from BW - now hana side appaended means 16+16 = 32
3. so that i used to select the check box at OH level like Deleting data from table
4. Now excuted the DTP it throws an Short Dump - DBIF_RSQL_TABLE_KNOWN
Now please tell me how to resolve this ? will this option is applicable for HANA mean to say like , deleting data from table option ...
Thanks
Santhosh Kumar -
Fetch data from table and generate attachment than mail it.
Hello Experts,
From couple of day I am searching on Google for a better database procedure that will help me to get data from tables and generate attachment and mail it but i fail.
My Scenario is:
I have a query that will fetch almost 5000 records from database tables. Each record has almost 75 characters
select a.location_code,
a.item_code,
b.description item_desc,
to_char(a.manufact_date,'ddMonyy')mfg,
to_char((a.manufact_date + nvl(b.expiry_period,0)),'ddMonyy')expr,
to_char((a.manufact_date + nvl(b.qurantine_period,0)),'ddMonyy')qrtn,
round(nvl (b.qurantine_period, 0) - (sysdate - a.manufact_date)) days_elapsed,
a.closing_balance_posted quantity
from wms_stock_current_balance_v a, wms_item_setup_mast b
where a.closing_balance > 0
and a.item_code = b.item_code
and a.loc_type in ('RACKING','PICKING','QUICKA','BUNDLED')
and nvl(b.qurantine_period,0) > 0
and round(nvl (b.qurantine_period, 0) - (sysdate - a.manufact_date)) <= 0
order by a.item_code, a.location_code;
Sample data of above query is
LOCATION_CODE
ITEM_CODE
ITEM_DESC
MFG
Expiry
Quarantine
Days Elapse
Quantity
13DL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
14DL0
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
134
14DL2
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
160
14DR2
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
20
14LL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17ER2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17GL2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
17SL0
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
64
18QL0
000000000000000F0487
CLEAR COOL BLACK 05ML
23-Feb-10
3-Apr-14
7-Jun-13
-119
160
19AR5
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
160
19DL1
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
19JR0
000000000000000F0487
CLEAR COOL BLACK 05ML
17-Feb-10
28-Mar-14
1-Jun-13
-125
60
19TL1
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
160
20GR2
000000000000000F0487
CLEAR COOL BLACK 05ML
20-Feb-10
31-Mar-14
4-Jun-13
-122
40
36FL3
000000000000000F0487
CLEAR COOL BLACK 05ML
18-Feb-10
29-Mar-14
2-Jun-13
-124
65
19UR0
000000000000000F0591
COMFORT WHITE 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
1
12SL1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
42
12SR1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
42
14OR1
000000000000000F0593
COMFORT PINK 24ML*300
28-Oct-09
28-Oct-11
1-May-11
-887
8
36EL4
000000000000000F0594
CLEAR HF DECRASE 5M*360
14-Feb-10
14-Feb-11
12-Oct-10
-1088
14
13VL1
000000000000000F0595
CLEAR COM SFT CRE 5*360
8-Feb-10
8-Feb-11
6-Oct-10
-1094
160
14ER0
000000000000000F0595
CLEAR COM SFT CRE 5*360
8-Feb-10
8-Feb-11
6-Oct-10
-1094
105
Database Info
Oracle 10g
Version 10.2.0.1.0Look at the sample code for generating a CSV file that I've just posted in response to a similar question:
Re: How to execute a proc and spool files in a database job
And the use the search button in this forum to find sample code for sending a CLOB as a plain/text e-mail attachment using UTL_SMTP. -
Hi All,
I have to fetch data from t005u for the filed bezei.
based on conditions given below
1) pass kna1-land1 and kna1-regio to t005u-land1 and t005u-bland
and then i want to pass this to an alv filed.
thanks in advance
jayhi jay,
try this code.
select t005u~bezei
kna1~land1
kna1~regio
into table <itab>
from t005u join kna1
on t005u-land1 eq kna1-land1 and
t005u-bland eq kna1-regio
where <condition with selection-screen Parameters>
After fetching the data build the field catelog using <itab> and
pass it in the function module REUSE_ALV_GRID_DISPLAY.
<b><i>Reward points if useful</i></b>
Chandra
Message was edited by:
Chandrasekhar Velpula -
Please let me know how to write the Query to fetch data from tables
Hi Folks,
Please let me know how to get the data from different tables using the functionality SQ03,SQ02 and SQ01 .
Helpful answers will points awarded.
Regards,
Ram.Dear Ram,
Please find the below link which gives in detail with screen shots.
[SAP Query|http://media.techtarget.com/searchSAP/downloads/Teach_yourself_SAP_C20.pdf#search=%22CREATE%20REPORT%20USING%20SQVI%20%2C%20SAP%22]
Thanks
Murtuza -
Send mail by attaching a pdf fetching data from tables.
Dear Team,
I have a requirement to send a mail by attaching a pdf.
Step1 : Getting the data fron tables based on some logic into internal tables. [DONE]
Step2 : Using this internal and making a pdf [At present I am making an excel sheet, But client requires non editable well formatted pdf]
Step3 : Attach this PDF and send it as a mail. [At present I am sending the attched excel but want to send pdf]
Sample code used is
** Body of the mail
WA_TEXT-LINE = 'Note : This is an autogenerated mail. Please do not reply to this mail.'.
APPEND WA_TEXT TO TEXT.
CLEAR WA_TEXT.
* create document from internal table with text
DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
I_TYPE = 'RAW'
I_TEXT = TEXT
I_LENGTH = '12'
I_SUBJECT = I_SUBJECT1 ).
** Excel Attachemnt
*** Preparing the xcel
CONCATENATE 'SNO' 'Request' 'Data1' INTO WA_TEXT-LINE SEPARATED BY CON_TAB.
CONCATENATE CON_CRET WA_TEXT-LINE INTO WA_TEXT-LINE.
APPEND WA_TEXT TO TEXT.
CLEAR WA_TEXT.
CONCATENATE WA_SNO WA_REQUEST WA_DATA1 INTO WA_TEXT-LINE SEPARATED BY CON_TAB.
CONCATENATE CON_CRET WA_TEXT-LINE INTO WA_TEXT.
APPEND WA_TEXT TO TEXT.
CLEAR : WA_TEXT, TEMP_TYPE .
*** Attaching the excel
DATA : COUNTER TYPE I.
DESCRIBE TABLE TEXT LINES COUNTER.
LOOP AT TEXT INTO WA_TEXT.
SIZE = 255 + STRLEN( WA_TEXT-LINE ) + SIZE .
ENDLOOP.
CALL METHOD DOCUMENT->ADD_ATTACHMENT
EXPORTING
I_ATTACHMENT_TYPE = 'XLS'
I_ATTACHMENT_SUBJECT = I_SUBJECT
I_ATTACHMENT_SIZE = SIZE
I_ATT_CONTENT_TEXT = TEXT.
** Semding Mail
CALL METHOD SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).
IF REQUESTER_MAIL IS NOT INITIAL.
* create recipient for cc
RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS(
I_ADDRESS_STRING = REQUESTER_MAIL ).
* add recipient with its respective attributes to send request
CALL METHOD SEND_REQUEST->ADD_RECIPIENT
EXPORTING
I_RECIPIENT = RECIPIENT
I_COPY = 'X'
I_EXPRESS = 'X'.
ENDIF.
SEND_REQUEST->SET_SEND_IMMEDIATELY('X').
* ---------- send document ---------------------------------------
CALL METHOD SEND_REQUEST->SEND(
EXPORTING
I_WITH_ERROR_SCREEN = 'X'
RECEIVING
RESULT = SENT_TO_ALL ).
IF SENT_TO_ALL = 'X'.
WRITE TEXT-003.
ENDIF.
COMMIT WORK.
Please help me in this regard.
Thanks in advance.
SaiHi,
You can convert the data into spool and then pdf,
please go through this link in this data from an internal
table of an script or an smartform is converted into spool
and then sended into mail,
https://wiki.sdn.sap.com/wiki/display/sandbox/ConversionofSpoolRequestDataintoPDFandExcelFormatandSenditintoMail
Hope it helps
Regards
Mansi -
SQL Query to fetch records from tables which have 75+ million records
Hi,
I have the explain plan for a sql stmt.Require your suggestions to improve this.
PLAN_TABLE_OUTPUT
| Id | Operation | Name | Rows | Bytes | Cost |
| 0 | SELECT STATEMENT | | 340 | 175K| 19075 |
| 1 | TEMP TABLE TRANSFORMATION | | | | |
| 2 | LOAD AS SELECT | | | | |
| 3 | SORT GROUP BY | | 32M| 1183M| 799K|
| 4 | TABLE ACCESS FULL | CLM_DETAIL_PRESTG | 135M| 4911M| 464K|
| 5 | LOAD AS SELECT | | | | |
| 6 | TABLE ACCESS FULL | CLM_HEADER_PRESTG | 1 | 274 | 246K|
PLAN_TABLE_OUTPUT
| 7 | LOAD AS SELECT | | | | |
| 8 | SORT UNIQUE | | 744K| 85M| 8100 |
| 9 | TABLE ACCESS FULL | DAILY_PROV_PRESTG | 744K| 85M| 1007 |
| 10 | UNION-ALL | | | | |
| 11 | SORT UNIQUE | | 177 | 97350 | 9539 |
| 12 | HASH JOIN | | 177 | 97350 | 9538 |
| 13 | HASH JOIN OUTER | | 3 | 1518 | 9533 |
| 14 | HASH JOIN | | 1 | 391 | 8966 |
| 15 | TABLE ACCESS BY INDEX ROWID | CLM_DETAIL_PRESTG | 1 | 27 | 3 |
| 16 | NESTED LOOPS | | 1 | 361 | 10 |
| 17 | NESTED LOOPS OUTER | | 1 | 334 | 7 |
PLAN_TABLE_OUTPUT
| 18 | NESTED LOOPS OUTER | | 1 | 291 | 4 |
| 19 | VIEW | | 1 | 259 | 2 |
| 20 | TABLE ACCESS FULL | SYS_TEMP_0FD9D66C9_DA2D01AD | 1 | 269 | 2 |
| 21 | INDEX RANGE SCAN | CLM_PAYMNT_CLMEXT_PRESTG_IDX | 1 | 32 | 2 |
| 22 | TABLE ACCESS BY INDEX ROWID| CLM_PAYMNT_CHKEXT_PRESTG | 1 | 43 | 3 |
| 23 | INDEX RANGE SCAN | CLM_PAYMNT_CHKEXT_PRESTG_IDX | 1 | | 2 |
| 24 | INDEX RANGE SCAN | CLM_DETAIL_PRESTG_IDX | 6 | | 2 |
| 25 | VIEW | | 32M| 934M| 8235 |
| 26 | TABLE ACCESS FULL | SYS_TEMP_0FD9D66C8_DA2D01AD | 32M| 934M| 8235 |
| 27 | VIEW | | 744K| 81M| 550 |
| 28 | TABLE ACCESS FULL | SYS_TEMP_0FD9D66CA_DA2D01AD | 744K| 81M| 550 |
PLAN_TABLE_OUTPUT
| 29 | TABLE ACCESS FULL | CCP_MBRSHP_XREF | 5288 | 227K| 5 |
| 30 | SORT UNIQUE | | 163 | 82804 | 9536 |
| 31 | HASH JOIN | | 163 | 82804 | 9535 |
| 32 | HASH JOIN OUTER | | 3 | 1437 | 9530 |
| 33 | HASH JOIN | | 1 | 364 | 8963 |
| 34 | NESTED LOOPS OUTER | | 1 | 334 | 7 |
| 35 | NESTED LOOPS OUTER | | 1 | 291 | 4 |
| 36 | VIEW | | 1 | 259 | 2 |
| 37 | TABLE ACCESS FULL | SYS_TEMP_0FD9D66C9_DA2D01AD | 1 | 269 | 2 |
| 38 | INDEX RANGE SCAN | CLM_PAYMNT_CLMEXT_PRESTG_IDX | 1 | 32 | 2 |
| 39 | TABLE ACCESS BY INDEX ROWID | CLM_PAYMNT_CHKEXT_PRESTG | 1 | 43 | 3 |
PLAN_TABLE_OUTPUT
| 40 | INDEX RANGE SCAN | CLM_PAYMNT_CHKEXT_PRESTG_IDX | 1 | | 2 |
| 41 | VIEW | | 32M| 934M| 8235 |
| 42 | TABLE ACCESS FULL | SYS_TEMP_0FD9D66C8_DA2D01AD | 32M| 934M| 8235 |
| 43 | VIEW | | 744K| 81M| 550 |
| 44 | TABLE ACCESS FULL | SYS_TEMP_0FD9D66CA_DA2D01AD | 744K| 81M| 550 |
| 45 | TABLE ACCESS FULL | CCP_MBRSHP_XREF | 5288 | 149K| 5 |
The CLM_DETAIL_PRESTG table has 100 million records and the CLM_HEADER_PRESTG table has 75 million records.
Any gussestions on how to getch huge records from tables of this size will help.
Regards,
NarayanWITH CLAIM_DTL
AS ( SELECT
ICN_NUM,
MIN (FIRST_SRVC_DT) AS FIRST_SRVC_DT,
MAX (LAST_SRVC_DT) AS LAST_SRVC_DT,
MIN (PLC_OF_SRVC_CD) AS PLC_OF_SRVC_CD
FROM CCP_STG.CLM_DETAIL_PRESTG CD WHERE ACT_CD <>'D'
GROUP BY ICN_NUM),
CLAIM_HDR
AS (SELECT
ICN_NUM,
SBCR_ID,
MBR_ID,
MBR_FIRST_NAME,
MBR_MI,
MBR_LAST_NAME,
MBR_BIRTH_DATE,
GENDER_TYPE_CD,
SBCR_RLTNSHP_TYPE_CD,
SBCR_FIRST_NAME,
SBCR_MI,
SBCR_LAST_NAME,
SBCR_ADDR_LINE_1,
SBCR_ADDR_LINE2,
SBCR_ADDR_CITY,
SBCR_ADDR_STATE,
SBCR_ZIP_CD,
PRVDR_NUM,
CLM_PRCSSD_DT,
CLM_TYPE_CLASS_CD,
AUTHO_NUM,
TOT_BILLED_AMT,
HCFA_DRG_TYPE_CD,
FCLTY_ADMIT_DT,
ADMIT_TYPE,
DSCHRG_STATUS_CD,
FILE_BILLING_NPI,
CLAIM_LOCATION_CD,
CLM_RELATED_ICN_1,
SBCR_ID||0
|| MBR_ID
|| GENDER_TYPE_CD
|| SBCR_RLTNSHP_TYPE_CD
|| MBR_BIRTH_DATE
AS MBR_ENROLL_ID,
SUBSCR_INSGRP_NM ,
CAC,
PRVDR_PTNT_ACC_ID,
BILL_TYPE,
PAYEE_ASSGN_CODE,
CREAT_RUN_CYC_EXEC_SK,
PRESTG_INSRT_DT
FROM CCP_STG.CLM_HEADER_PRESTG P WHERE ACT_CD <>'D' AND SUBSTR(CLM_PRCSS_TYPE_CD,4,1) NOT IN ('1','2','3','4','5','6') ),
PROV AS ( SELECT DISTINCT
PROV_ID,
PROV_FST_NM,
PROV_MD_NM,
PROV_LST_NM,
PROV_BILL_ADR1,
PROV_BILL_CITY,
PROV_BILL_STATE,
PROV_BILL_ZIP,
CASE WHEN PROV_SEC_ID_QL='E' THEN PROV_SEC_ID
ELSE NULL
END AS PROV_SEC_ID,
PROV_ADR1,
PROV_CITY,
PROV_STATE,
PROV_ZIP
FROM CCP_STG.DAILY_PROV_PRESTG),
MBR_XREF AS (SELECT SUBSTR(MBR_ENROLL_ID,1,17)||DECODE ((SUBSTR(MBR_ENROLL_ID,18,1)),'E','1','S','2','D','3')||SUBSTR(MBR_ENROLL_ID,19) AS MBR_ENROLLL_ID,
NEW_MBR_FLG
FROM CCP_STG.CCP_MBRSHP_XREF)
SELECT DISTINCT CLAIM_HDR.ICN_NUM AS ICN_NUM,
CLAIM_HDR.SBCR_ID AS SBCR_ID,
CLAIM_HDR.MBR_ID AS MBR_ID,
CLAIM_HDR.MBR_FIRST_NAME AS MBR_FIRST_NAME,
CLAIM_HDR.MBR_MI AS MBR_MI,
CLAIM_HDR.MBR_LAST_NAME AS MBR_LAST_NAME,
CLAIM_HDR.MBR_BIRTH_DATE AS MBR_BIRTH_DATE,
CLAIM_HDR.GENDER_TYPE_CD AS GENDER_TYPE_CD,
CLAIM_HDR.SBCR_RLTNSHP_TYPE_CD AS SBCR_RLTNSHP_TYPE_CD,
CLAIM_HDR.SBCR_FIRST_NAME AS SBCR_FIRST_NAME,
CLAIM_HDR.SBCR_MI AS SBCR_MI,
CLAIM_HDR.SBCR_LAST_NAME AS SBCR_LAST_NAME,
CLAIM_HDR.SBCR_ADDR_LINE_1 AS SBCR_ADDR_LINE_1,
CLAIM_HDR.SBCR_ADDR_LINE2 AS SBCR_ADDR_LINE2,
CLAIM_HDR.SBCR_ADDR_CITY AS SBCR_ADDR_CITY,
CLAIM_HDR.SBCR_ADDR_STATE AS SBCR_ADDR_STATE,
CLAIM_HDR.SBCR_ZIP_CD AS SBCR_ZIP_CD,
CLAIM_HDR.PRVDR_NUM AS PRVDR_NUM,
CLAIM_HDR.CLM_PRCSSD_DT AS CLM_PRCSSD_DT,
CLAIM_HDR.CLM_TYPE_CLASS_CD AS CLM_TYPE_CLASS_CD,
CLAIM_HDR.AUTHO_NUM AS AUTHO_NUM,
CLAIM_HDR.TOT_BILLED_AMT AS TOT_BILLED_AMT,
CLAIM_HDR.HCFA_DRG_TYPE_CD AS HCFA_DRG_TYPE_CD,
CLAIM_HDR.FCLTY_ADMIT_DT AS FCLTY_ADMIT_DT,
CLAIM_HDR.ADMIT_TYPE AS ADMIT_TYPE,
CLAIM_HDR.DSCHRG_STATUS_CD AS DSCHRG_STATUS_CD,
CLAIM_HDR.FILE_BILLING_NPI AS FILE_BILLING_NPI,
CLAIM_HDR.CLAIM_LOCATION_CD AS CLAIM_LOCATION_CD,
CLAIM_HDR.CLM_RELATED_ICN_1 AS CLM_RELATED_ICN_1,
CLAIM_HDR.SUBSCR_INSGRP_NM,
CLAIM_HDR.CAC,
CLAIM_HDR.PRVDR_PTNT_ACC_ID,
CLAIM_HDR.BILL_TYPE,
CLAIM_DTL.FIRST_SRVC_DT AS FIRST_SRVC_DT,
CLAIM_DTL.LAST_SRVC_DT AS LAST_SRVC_DT,
CLAIM_DTL.PLC_OF_SRVC_CD AS PLC_OF_SRVC_CD,
PROV.PROV_LST_NM AS BILL_PROV_LST_NM,
PROV.PROV_FST_NM AS BILL_PROV_FST_NM,
PROV.PROV_MD_NM AS BILL_PROV_MID_NM,
PROV.PROV_BILL_ADR1 AS BILL_PROV_ADDR1,
PROV.PROV_BILL_CITY AS BILL_PROV_CITY,
PROV.PROV_BILL_STATE AS BILL_PROV_STATE,
PROV.PROV_BILL_ZIP AS BILL_PROV_ZIP,
PROV.PROV_SEC_ID AS BILL_PROV_EIN,
PROV.PROV_ID AS SERV_FAC_ID ,
PROV.PROV_ADR1 AS SERV_FAC_ADDR1 ,
PROV.PROV_CITY AS SERV_FAC_CITY ,
PROV.PROV_STATE AS SERV_FAC_STATE ,
PROV.PROV_ZIP AS SERV_FAC_ZIP ,
CHK_PAYMNT.CLM_PMT_PAYEE_ADDR_LINE_1,
CHK_PAYMNT.CLM_PMT_PAYEE_ADDR_LINE_2,
CHK_PAYMNT.CLM_PMT_PAYEE_CITY,
CHK_PAYMNT.CLM_PMT_PAYEE_STATE_CD,
CHK_PAYMNT.CLM_PMT_PAYEE_POSTAL_CD,
CLAIM_HDR.CREAT_RUN_CYC_EXEC_SK
FROM CLAIM_DTL,(select * FROM CCP_STG.CLM_DETAIL_PRESTG WHERE ACT_CD <>'D') CLM_DETAIL_PRESTG, CLAIM_HDR,CCP_STG.MBR_XREF,PROV,CCP_STG.CLM_PAYMNT_CLMEXT_PRESTG CLM_PAYMNT,CCP_STG.CLM_PAYMNT_CHKEXT_PRESTG CHK_PAYMNT
WHERE
CLAIM_HDR.ICN_NUM = CLM_DETAIL_PRESTG.ICN_NUM
AND CLAIM_HDR.ICN_NUM = CLAIM_DTL.ICN_NUM
AND CLAIM_HDR.ICN_NUM=CLM_PAYMNT.ICN_NUM(+)
AND CLM_PAYMNT.CLM_PMT_CHCK_ACCT=CHK_PAYMNT.CLM_PMT_CHCK_ACCT
AND CLM_PAYMNT.CLM_PMT_CHCK_NUM=CHK_PAYMNT.CLM_PMT_CHCK_NUM
AND CLAIM_HDR.MBR_ENROLL_ID = MBR_XREF.MBR_ENROLLL_ID
AND CLM_DETAIL_PRESTG.FIRST_SRVC_DT >= 20110101
AND MBR_XREF.NEW_MBR_FLG = 'Y'
AND PROV.PROV_ID(+)=SUBSTR(CLAIM_HDR.PRVDR_NUM,6)
AND MOD(SUBSTR(CLAIM_HDR.ICN_NUM,14,2),2)=0
UNION ALL
SELECT DISTINCT CLAIM_HDR.ICN_NUM AS ICN_NUM,
CLAIM_HDR.SBCR_ID AS SBCR_ID,
CLAIM_HDR.MBR_ID AS MBR_ID,
CLAIM_HDR.MBR_FIRST_NAME AS MBR_FIRST_NAME,
CLAIM_HDR.MBR_MI AS MBR_MI,
CLAIM_HDR.MBR_LAST_NAME AS MBR_LAST_NAME,
CLAIM_HDR.MBR_BIRTH_DATE AS MBR_BIRTH_DATE,
CLAIM_HDR.GENDER_TYPE_CD AS GENDER_TYPE_CD,
CLAIM_HDR.SBCR_RLTNSHP_TYPE_CD AS SBCR_RLTNSHP_TYPE_CD,
CLAIM_HDR.SBCR_FIRST_NAME AS SBCR_FIRST_NAME,
CLAIM_HDR.SBCR_MI AS SBCR_MI,
CLAIM_HDR.SBCR_LAST_NAME AS SBCR_LAST_NAME,
CLAIM_HDR.SBCR_ADDR_LINE_1 AS SBCR_ADDR_LINE_1,
CLAIM_HDR.SBCR_ADDR_LINE2 AS SBCR_ADDR_LINE2,
CLAIM_HDR.SBCR_ADDR_CITY AS SBCR_ADDR_CITY,
CLAIM_HDR.SBCR_ADDR_STATE AS SBCR_ADDR_STATE,
CLAIM_HDR.SBCR_ZIP_CD AS SBCR_ZIP_CD,
CLAIM_HDR.PRVDR_NUM AS PRVDR_NUM,
CLAIM_HDR.CLM_PRCSSD_DT AS CLM_PRCSSD_DT,
CLAIM_HDR.CLM_TYPE_CLASS_CD AS CLM_TYPE_CLASS_CD,
CLAIM_HDR.AUTHO_NUM AS AUTHO_NUM,
CLAIM_HDR.TOT_BILLED_AMT AS TOT_BILLED_AMT,
CLAIM_HDR.HCFA_DRG_TYPE_CD AS HCFA_DRG_TYPE_CD,
CLAIM_HDR.FCLTY_ADMIT_DT AS FCLTY_ADMIT_DT,
CLAIM_HDR.ADMIT_TYPE AS ADMIT_TYPE,
CLAIM_HDR.DSCHRG_STATUS_CD AS DSCHRG_STATUS_CD,
CLAIM_HDR.FILE_BILLING_NPI AS FILE_BILLING_NPI,
CLAIM_HDR.CLAIM_LOCATION_CD AS CLAIM_LOCATION_CD,
CLAIM_HDR.CLM_RELATED_ICN_1 AS CLM_RELATED_ICN_1,
CLAIM_HDR.SUBSCR_INSGRP_NM,
CLAIM_HDR.CAC,
CLAIM_HDR.PRVDR_PTNT_ACC_ID,
CLAIM_HDR.BILL_TYPE,
CLAIM_DTL.FIRST_SRVC_DT AS FIRST_SRVC_DT,
CLAIM_DTL.LAST_SRVC_DT AS LAST_SRVC_DT,
CLAIM_DTL.PLC_OF_SRVC_CD AS PLC_OF_SRVC_CD,
PROV.PROV_LST_NM AS BILL_PROV_LST_NM,
PROV.PROV_FST_NM AS BILL_PROV_FST_NM,
PROV.PROV_MD_NM AS BILL_PROV_MID_NM,
PROV.PROV_BILL_ADR1 AS BILL_PROV_ADDR1,
PROV.PROV_BILL_CITY AS BILL_PROV_CITY,
PROV.PROV_BILL_STATE AS BILL_PROV_STATE,
PROV.PROV_BILL_ZIP AS BILL_PROV_ZIP,
PROV.PROV_SEC_ID AS BILL_PROV_EIN,
PROV.PROV_ID AS SERV_FAC_ID ,
PROV.PROV_ADR1 AS SERV_FAC_ADDR1 ,
PROV.PROV_CITY AS SERV_FAC_CITY ,
PROV.PROV_STATE AS SERV_FAC_STATE ,
PROV.PROV_ZIP AS SERV_FAC_ZIP ,
CHK_PAYMNT.CLM_PMT_PAYEE_ADDR_LINE_1,
CHK_PAYMNT.CLM_PMT_PAYEE_ADDR_LINE_2,
CHK_PAYMNT.CLM_PMT_PAYEE_CITY,
CHK_PAYMNT.CLM_PMT_PAYEE_STATE_CD,
CHK_PAYMNT.CLM_PMT_PAYEE_POSTAL_CD,
CLAIM_HDR.CREAT_RUN_CYC_EXEC_SK
FROM CLAIM_DTL, CLAIM_HDR,MBR_XREF,PROV,CCP_STG.CLM_PAYMNT_CLMEXT_PRESTG CLM_PAYMNT,CCP_STG.CLM_PAYMNT_CHKEXT_PRESTG CHK_PAYMNT
WHERE CLAIM_HDR.ICN_NUM = CLAIM_DTL.ICN_NUM
AND CLAIM_HDR.ICN_NUM=CLM_PAYMNT.ICN_NUM(+)
AND CLM_PAYMNT.CLM_PMT_CHCK_ACCT=CHK_PAYMNT.CLM_PMT_CHCK_ACCT
AND CLM_PAYMNT.CLM_PMT_CHCK_NUM=CHK_PAYMNT.CLM_PMT_CHCK_NUM
AND CLAIM_HDR.MBR_ENROLL_ID = MBR_XREF.MBR_ENROLLL_ID
-- AND TRUNC(CLAIM_HDR.PRESTG_INSRT_DT) = TRUNC(SYSDATE)
AND CLAIM_HDR.CREAT_RUN_CYC_EXEC_SK = 123638.000000000000000
AND MBR_XREF.NEW_MBR_FLG = 'N'
AND PROV.PROV_ID(+)=SUBSTR(CLAIM_HDR.PRVDR_NUM,6)
AND MOD(SUBSTR(CLAIM_HDR.ICN_NUM,14,2),2)=0; -
Can not insert/update data from table which is created from view
Hi all
I'm using Oracle database 11g
I've created table from view as the following command:
Create table table_new as select * from View_Old
I can insert/update data into table_new by command line.
But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)
Anybody tell me, what's happend? cause?
Thankyou
thiensu
Edited by: user8248216 on May 5, 2011 8:54 PM
Edited by: user8248216 on May 5, 2011 8:55 PMI can insert/update data into table_new by command line.
But I can not Insert/update data of table_new by SI Oject Browser tool or Oracle SQL Developer tool .(read only)so what is wrong with the GUI tools & why posting to DATABASE forum when that works OK? -
Can not delete data from table which is queried in my stored procedure
Hi,
Anyone knows how to fix it:
I have a table. In a stored procedure, I have a simple query running on this table.
When I want to delete one record from that table, I got error message:
ORA-04091: table *** is mutating, trigger/function may not see it.
Thanks first.Rick, the only time you should get a mutating table error is when a trigger is involved. FK problems have separate error codes (and would be a different problem than the one that started this thread). Using a DBA id check all the tables subject to DML by your function and by whatever calls your function for triggers. Only the owner or a DBA can see the existence of triggers on a non-owned table. This has caused some of the developers I work with to think tables that had triggers do not have them since they do not work under the owning or a DBA ID.
By your description of what you are trying to do in the function we do that all the time without problem.
How large is the function? How/When is it called?
Mark D Powell -
Function module to fetch data from table
Hi All,
I want to get the entries from the table 'arfcsstate' for a particular date. Is there a function module to get the same.
Thanks in advance.
Regards,
AnjuHi,
You can use select query
Select * from arfcsstate into <Internal table name>
where date <give ur condition.>
if date is in selection screen than write
date in s_date.
Thanx
Ankur Sharma
Maybe you are looking for
-
Ipod continuously turns on then off and makes clicking sound
Just today, after plugging my ipod into my computer and transferring voice memos, I unplugged my ipod and as soon as I did that, it shut down and began its continuous loop of turning on and off. It never fully boots up. Can anyone help me out with wh
-
Album art and info in visualizer
Hi Just wanted to ask if anyone knew of a way to keep the album artwork and information on the screen when you've got the visualizer on in iTunes. I like that it's there at the start of the song but it would be nice to have the option to have it ther
-
Best practices for referencing external video across multiple computers
I have made a .swf that references an external .f4v . The swf plays fine on my own computer, but does not play on a colleagues computer, or another computer which we tested. The file is not for upload to web , it is for local playback. I assume th
-
Error in executing Flight Demo
Hi all I am getting an error while trying to execute the Flight demo.the error is as follows:- The following error text was processed in the system IXI : An exception that could not be caught occurred. The error occurred on the application server SAP
-
Not sure if this will be helpful to some readers, however, after loading 2.2, I found that Safari was 'stuck': ie; I could not log on to the Internet, though other downloads worked, such as 'Mail', 'YouTube', etc. I 'restored factory settings', then