Select query written on view giving dump
Hi All,
I have written the following query on COAS view in my code:
SELECT aufnr bukrs INTO TABLE gt_aufnr
FROM coas
WHERE
aufnr IN r_aufrm AND
auart IN s_auart AND
autyp = c_autyp_01 AND
kokrs = c_kokrs_mbca.
When records in range r_aufrm are too many like 6000 or so it gives me a run time error on this query - DBIF_RSQL_INVALID_RSQL. Error description says size of select query is large.
Question : Is this bug coming because I am using the view. If i select the records on table AUFK (only table on which the view is created), will it rectify the problem?? I am asking this because it's in production and I cant make any change and test then and there.
Note: the range r_aufrm contains two types of records for AUFNR - 1. with sign GE and others with sign LE. So I cannot use for all entries. If I still can, please tell me how?
Thanks a looot!
Waiting for the response,
Navita
Thanks All!!
I think, this range limit has caused the problem. Range limit is 999 records.
Just one question I have. At runtime when I check the number of entries in r_aufrm in the query, I get 6000 entries. So, does it allow 6000 records to enter the range variable even if it has a limit of 999. Is it the case that, in select query only it will throw a dump if records in range exceed 999??
SELECT aufnr bukrs INTO TABLE gt_aufnr
FROM coas
WHERE
aufnr IN r_aufrm AND
auart IN s_auart AND
autyp = c_autyp_01 AND
kokrs = c_kokrs_mbca.
Please clear my doubt.
Thanks a lot for ur help!!!!
Navita
Similar Messages
-
Select query in materialized view with two dblinks
Hi All,
We have oracle 10g On windows.
We are trying to create materialized view. Scenario is we have base table on other database and we are creating mview on different database.
Basa database have two schema's and i am selecting records from that two schema's using two private db links.
But when i am tryin gto create mview its not getting created. After 15 hrs. its still showing creation command and not finished.
Query is :-
Is it good practice to have two db links in select query of materialized view.Billy Verreynne wrote:
Chanchal Wankhade wrote:
Is it good practice to have two db links in select query of materialized view.Same db link being used twice, or two different db links?
If the former, you ideally want the local Oracle db to send the join to the remote database, and for the remote database to drive the join between those 2 tables. There is a hint (<i>driving_site</i>) that can be used - or the join query can be defined on the remote database as a view, and the local materialised view can then use that remote view.
If you have 2 different db links and joining across these - usually a bad idea to perform distributed database joins. There are lots of limitations as to how the tables can be joined. Worse case, full table scans of both remote tables, pulling all the rows from the 2 remote database tables to the local database, and joining these on the local database.
I have seen some severe performance issues in the past as a result of distributed joins. I'll rather use 2 materialised views for pulling both distributed tables's data locally, and then do the join on local data (using indexes, partition pruning, etc)Hi Billy,
My scenario is i have two database database A and database B. Database A is having two schema's SCOTT AND HR. SCOTT schema have select privileges on HR schema.
DB LINK is between Database B to Database A. name is db.link.B.A.oracle.com.
What if i priovide while creating materialized view, the schema name before the table name in database B for this particuler table so it will pick up the table from that schema using same DB LINK(db.link.B.A.oracle.com.) that i am using to fetch records from SCOTT schema.
Above schnario is like two base schema's and one db link using two schema. -
Can I write a SELECT query on maintenance view?
Hi,
Can we write a select query on maint. view? If not what are the views on which we can write the select queries?hi,
you can write select query for maintenance view, database view and projection view but not helpview as it is only intended for f4 help.
reward if helpful
prasanth -
View and the query for the view giving different datasets
I have a view created with the below syntax.
CREATE OR REPLACE FORCE VIEW vw_name (/*column names*/ )
AS SELECT /*column names*/ from tables
When I execute the query with which the view is constructed , I m getting different data set which contains 4690 rows
and when I exeute the view I m getting dataset which contains only 4657 rows.
Can you please explain why the differnce in count when the source for both is the same.Can you please explain why the differnce in count when the source for both is the same.Answer should be one of the following
1. The two query are not same
2. The table data has been modified
3. You are seeing at the wrong thing (manual error) -
Hi,
We have a select query written as below:
SELECT counter
stokz
pernr
workdate
rnplnr
catshours
FROM catsps
INTO TABLE t_catsps
WHERE pernr IN r_pernr
AND workdate IN s_wrkdt
AND rnplnr IN s_ntwrk
AND belnr IN s_docno
AND transfer NE 'X'.
Here, the range which we are using has a record of more than 16000. At this particular portion of the code the program dumps. I suspect it is due to the excessive data records in the ranges option. Is there any remedy for this situation. Please help!Hi,
check the inetrnal table strcure field are of same type of catsps table field which you are fetching
Or try to USe into corresponding fields of table t_catsps.
"check the inetrnal table strcure field are of same
"type of catsps table field which you are fetching
SELECT counter
stokz
pernr
workdate
rnplnr
catshours
FROM catsps
INTO TABLE t_catsps 'Or try to USe into corresponding fields of table t_catsps
WHERE pernr IN r_pernr
AND workdate IN s_wrkdt
AND rnplnr IN s_ntwrk "check rnplnr and s_ntwrk are of same type
AND belnr IN s_docno "Check belnr and s_docno are of same type
AND transfer NE 'X'.
"hadle sy-subrc
prabhudas
Edited by: Rob Burbank on Sep 22, 2010 9:32 AM -
Can we write a select query for maintenace view.
If no why please explain.
What is the purpose of maintenace viewgoto to table maintainance generator of maintainance view...
in there in menu environment-->modification--->source code or events...
main purpose of maintainance view is to update the multiple (related)table at a time (ex mara and makt tables).... -
Adding one more table to the select statement joining 4 tables gives dump
Hi All,
There is a select statement using which four tables namely VBAK,VBAP,LIPS and LIKPUK(view) are joined(inner join).Here, date and time fields are selected from LIPS and used.
My requirement is to consider the Date (LIKP - WADAT_IST) instead of LIPS-ERDAT and time(LIKP-SPE_WAUHR_IST) is to be used instead of LIPS-erzet.
Neither LIPS nor LIKPUK contains time(SPE_WAUHR_IST) field. And, I cannot remove LIPS table or LIKPUK view as each contains a unique field which is used in the report.
When I tried to join LIPS in the select query, it is going to dump.
Can someone suggest a good approach ?
Thanks,
PavanThank you for the detailed explanation of the dump.
The dump details together with your code lead to the answer: 42.
Regards,
Clemens -
Select query for sales order for particular customer oder text and storage
Hi All,
I am trying to retriev customer order text and customer storage bin from the following select query, but it's giving huge number of records, I want to restrict the number of records.
Select customer order text, customer storage bin
Select STXHTDOBJECT, STXHTDID
Where TDOBJECT = VBBP
TDID = Y001
TDID = Y007
Please let me know how to restirct the number of records.
Thanks,
RanjanTry using the FM 'READ_TEXT'.
NAME will be the order number concatenated with the item number.
And you have the ID and OBJECT. You may also need to use the LANGUAGE.
Message was edited by:
Matt Nagel -
Select query giving Time out dump
Hi All,
I have written a select query on a table in BW system.The code for the same is attached below.The table contains some 6,00,000 records.This query is giving a time out error.Kindly look into the query and advice ways to make it work.Thanks.
IF NOT lt_temp[] IS INITIAL.
SELECT /bic/zprrmatnr objvers /bic/zprclwynr /bic/zprrmdlr
FROM /bic/pzprrmatnr
INTO CORRESPONDING FIELDS OF TABLE lt_zprrmatnr
FOR ALL ENTRIES IN lt_temp
WHERE /bic/zprclwynr = lt_temp-temp
AND objvers = 'A'.
ENDIF.
Thanks and Regards,
FaisalNot only is it BW, it is also a customer table. Have a look here on how to research yourself:
Please Read before Posting in the Performance and Tuning Forum
Thomas -
Hi all,
tables: ikpf,iseg.
TYPES: BEGIN OF i_ikpf,
werks TYPE ikpf-werks, "Plant
lgort TYPE ikpf-lgort, "Storage location
iblnr TYPE ikpf-iblnr, "Physical Inventory Document
gjahr TYPE ikpf-gjahr, "Fiscal Year
zldat TYPE ikpf-zldat, "Last Count Date
sobkz TYPE ikpf-sobkz,
bldat TYPE ikpf-bldat,
gidat TYPE ikpf-gidat,
budat TYPE ikpf-budat,
END OF i_ikpf.
DATA: it_ikpf TYPE STANDARD TABLE OF i_ikpf ,
wa_ikpf TYPE i_ikpf .
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR iseg-matnr,
s_werks FOR ikpf-werks,
s_lgort FOR ikpf-lgort,
s_iblnr FOR ikpf-iblnr,
s_gjahr FOR ikpf-gjahr,
s_zldat FOR ikpf-zldat,
s_abcin FOR iseg-abcin.
SELECTION-SCREEN: END OF BLOCK b1 .
SELECT iblnr gjahr werks lgort sobkz bldat gidat zldat budat
from ikpf
INTO TABLE it_ikpf
WHERE werks IN s_werks and
lgort IN s_lgort and
iblnr IN s_iblnr and
gjahr IN s_gjahr and
zldat IN s_zldat.
select query is giving dump as " data could not be placed in an output area"
thanks in advance,When selecting the fields, order of fields selection and fields in internal table should be same.
Check the below code
tables: ikpf,iseg.
TYPES: BEGIN OF i_ikpf,
iblnr TYPE ikpf-iblnr, "Physical Inventory Document
gjahr TYPE ikpf-gjahr, "Fiscal Year
werks TYPE ikpf-werks, "Plant
lgort TYPE ikpf-lgort, "Storage location
sobkz TYPE ikpf-sobkz,
bldat TYPE ikpf-bldat,
gidat TYPE ikpf-gidat,
zldat TYPE ikpf-zldat, "Last Count Date
budat TYPE ikpf-budat,
END OF i_ikpf.
DATA: it_ikpf TYPE STANDARD TABLE OF i_ikpf ,
wa_ikpf TYPE i_ikpf .
SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
SELECT-OPTIONS : s_matnr FOR iseg-matnr,
s_werks FOR ikpf-werks,
s_lgort FOR ikpf-lgort,
s_iblnr FOR ikpf-iblnr,
s_gjahr FOR ikpf-gjahr,
s_zldat FOR ikpf-zldat,
s_abcin FOR iseg-abcin.
SELECTION-SCREEN: END OF BLOCK b1 .
SELECT iblnr
gjahr
werks
lgort
sobkz
bldat
gidat
zldat
budat
from ikpf
INTO TABLE it_ikpf
WHERE werks IN s_werks and
lgort IN s_lgort and
iblnr IN s_iblnr and
gjahr IN s_gjahr and
zldat IN s_zldat.
Other wise use "INTO CORRESPONDING FIELDS" while selecting.
Hope this helps u. -
Decode statement in Select line of a View Object Query
I attempted to create a view object in expert mode with a customized query.
The query had a decode statement in the select line of the query. The view
object compiled correctly but gave an error when run.
ex: select .... decode(CrpSchools.SCHOOLS_ID,null,CrpCustSchools.SCHOOL_NAME,CrpSchools.SCHOOL_NAME) SCHOOL_VALUE, ...
from ....
where ....
The error was that school_value does not exist in the statement. I got the error when
doing a vo.executeQuery().
When I removed the decode statement everything worked correctly. Does anyone know if
the decode statement cannont be used in the select line of a query in a view object?
Or maybe I was linking the query column (SCHOOLS_ID) up to the view attribute (SCHOOL_VALUE) incorrectly in the
Attribute Mappings tab of the VO wizard?There should be no problem using a DECODE() statement, provided that you've aliases the column as you have done.
At design time, if you click on the (Test) button, does your query test ok?
Are you by chance applying a custom where clause at runtime?
If so, are you saying:
setWhereClause("yourtable.column_alias = ?";
or are you doing:
setWhereClause("column_alias = ?";
for an expert-mode query, you'll need to use the latter syntax. -
How to create a triangle view with a select query?
I need help to build a select query that will create a triangle view.
Below is the table I have to query
*{color:#ff0000}INITIAL TABLE{color}*
*{color:#008000}AMOUNT | TRANSACTION_DATE | OPEN_DATE | TYPE{color}*
5 | 30-JAN-09 | 10-JAN-09 | A
10 | 12-JAN - 09 | 30-NOV-08 | A
20 | 30 - DEC - 08 | 15-OCT-08 | A
10 | 30 - DEC - 08 | 8 - OCT - 08 | A
*{color:#ff0000}THE FINAL TABLE I HAVE TO CREATE:{color}*
DEV_PERIOD - TO_CHAR(TRUNC(TRANSACTION_DATE,'Q'),'YYYY-Q') AS DEV_PERIOD
OPEN PERIOD - TO_CHAR(TRUNC(OPEN_DATE,'Q'),'YYYY-Q') AS OPEN_PERIOD
{color:#008000}*SUM of AMOUNT | DEV_PERIOD | OPEN_PERIOD | TYPE*{color}
5 | 2009 - 1 | 2009 - 1 | A
40 | 2009 - 1 | 2008 - 4 | A
30 | 2008 - 4 | 2008 - 4 | A
{color:#ff0000}*This is another view of the table (The triangle view)*{color}
| Dev_Period 2008- 1 | 2008 - 2| 2008 -3 | 2008 - 4 | 2009 -1 |
Open_Period |
2008 - 1..................... 0.......... 0............ 0........... 0.......... 0
2008 - 2 ..................................0............ 0........... 0.......... 0
2008 - 3................................................. 0........... 0.......... 0
2008 - 4 ..............................................................30......... 40
2009 - 1 .............................................................................5
Any ideas will be appreaciated.
Thank you!I think the first thing you need to do is look up "pivot query" in this newsgroup. And how complicated your query gets to be will depend on your database version (11 natively supports pivot queries). You have a variable number of columns in your result set (depending on how many quarters you have in your data.
I think once you get the columns sorted out, working out the numbers to put in each column will be relatively easy.
Jon -
Select query to read data from a view
Hi friends,
We have been using a query to read data from a custom view which used to work perfectly. Now the program sits at that select query forever. We are able to extract same data from se16. Not sure what could be the problem.
Thanks in advance.Dev
Have a look at the Table Index for the tables involved in the View... I think there is some change in the Indexes.. (Add / Remove / Change)
Thanks
Amol Lohade -
I am getting dump error while running one report in one select query
Hi,
While running a report program, I am getting a dump error in one select query. So could you please correct the select query so that I can't face the dump error.
SELECT vbeln parvw kunnr INTO CORRESPONDING FIELDS OF TABLE l_t_vbpa
FROM vbpa
FOR ALL ENTRIES IN l_t_backorder_item
WHERE vbeln = l_t_backorder_item-vbeln AND
( ( parvw = c_we AND kunnr IN rng_shipto ) OR ( parvw = c_ag AND
kunnr IN rng_soldto ) ) .
<removed by moderator>
Best Regards,
BDP
Edited by: Thomas Zloch on Apr 30, 2010 12:31 PMHi Bansidhar,
It would be helpful if you could tell what type of dump it is.
If it is a timeout you should check whether l_t_backorder_item is empty - in this case ALL document numbers are selected. f you get the timeout with a populated table consider converting the l_t_backorder_item table into one ore more ranges tables - the select with ranges tables is way quicker than 'for all entries'. But take care the ranges table has not to many entries - the SAP SQL converter puts this into one huge SQL statement and this might become too big to be handled by the database (depends on the actual underlying database).
I would also consider splitting the SELECT into two (2nd one with 'appending into table') to make the code easier to understand It also helps the database system determining a strategy for the select.
Regards,
Gerd Rother -
(view hint or Query writing method) using views in Select Query
Need Assistance,
Hi all,
My database having many views. while i am joining the views in a select query increase the cost of the querys due to the complex joins in the conditions.
While checking the select query with views individualy taking less cost.
Does any hint or query writing method is availabe to avoid the merging of the execution plan of the views?
I have browsed many related to the mentioned issues,couldn't found any thing that helps me.
Please help me on this issue,it will be very much helpfull for me.
Thanks,
SenthurPlease read the two threads linked to in the FAQ: {message:id=9360003} and post the relevant details they request, so that people can help you better with your issue.
We cannot help if you just say "my query is slow what do I do to fix it" as we cannot see your queries, your data, or any other information we would need to help. If the answer was that simple, it would be built into oracle so that the optimiser would fix it for you.
Maybe you are looking for
-
Personally, I feel this is morally wrong. I have no problem with Apple offering the iCloud service, but it's quite another thing to force me to use iCloud for my own info. Whatever convenience or advantage this is to Apple is easily outweighed by a
-
Adobe Photoshop CS6 Installation Failed?
I have recently been trying to download Photshop CS6 but the Installation Fails and a Window pops up telling me that: " A Conflicting or Prerelease version of Adobe Photoshop CS6 exists on this computer. The conflicting version before installing
-
IMovie file won't open in quicktime, Everything is updated!
It is a 29 min. .mp4 file that should be compatible with quicktime but only getting error messages. Once it played 4 min of it and that was it. Trying to export the video to an SD Card or Disc. Is there something I need to do when 'sharing' the file
-
Consignment Pick-up order - confirmed inventory qty
Greetings, We are using the SD customer consignment model, using sales order types, consignment fill up orders ZKB (copy of KB), consignment issue ZKE (copy of KE), consignment return ZKR (copy of KR) and consignment pick-up ZKA (copy of KA). We have
-
Premiere is very slow to export when title is added
Hello. I have a 60 second piece of media that is the header for all my exports. It consists of 30 seconds of bars/tone, 27 secs of a moving clock and then 3 secs of black. It was supplied as MXF OP1a and is 376 MB. On each export I overlay text to th