Oralce 9i cursor report
I have created a procedure based refcursor report in Oracle 9i Reports.
First i created a package in oracle9i, next i created a refcursor based
on
database procedure. I saw the data in the datamodel. I created layout
for
that data model. I saved this file as .JSP and .RDF and they work fine.
I
then closed the JSP and RDF files.
When I reopened JSP file to check my report I am getting an error
message
"REP-002:unable to retrieve a string from the Report Builder message
file." and i found i lost my layout and fields in data model. Again i
recreated layout and data model report is working fine and saved. Again
reopend the JSP file i found my report lost layout and data model.
But i saved same file in RDF but that is wroking fine. Even i close
and reopen the RDF file.
I will appreciate any help.
Regards.
sqlldr is an OS executable. So by default, it takes from the directories from PATH. If your 10G version path is preceding the 9i path, the former would take precedence. If you want to run 9i version of sqlloader, you can either give the complete path, OR edit the PATH environment variable.
Similar Messages
-
Dynamic Ref Cursor report in 6i
Hello,
I apologise that this question is so similar to many in this forum, but I haven't found a solution to my problem yet.
I've created a ref cursor query because I need to include a variable p_orgs in my WHERE clause, like so:
where e.org_id in ('||p_orgs||')
I've constructed the report as mentioned on this page:
www.dulcian.com
FAQs - SQL & PL/SQL FAQs - FAQ ID# 5:
"How can you use 'dynamic' ref cursors in Oracle Reports 3.0 / 6i?"
(Thanks to Zlatko Sirotic for the information).
I get a compile error when compiling the package body that holds my ref cursor open statement:
Error 103 Encountered the symbol ''select'' when expecting one of the following:
Select
Is there any way around this problem?
If I was to upgrade to Reports 9i would it work?
Many thanks,
HazelHello,
Just a remark : you don't need to use a Ref Cursor if you just want to use a "dynamic where clause".
You can use a lexical reference :
You can find examples at :
http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwwhthow/whatare/dmobj/sq_a_lexical_references.htm
(This page is about Reports 10.1.2 but Lexical references are identical in Reports 6i and Reports 10.1.2)
Regards -
PSB module of Oralce financial standard reports
Hello all,
How I can know which tables and views are used in standard reports of "Public Sector Budgeting" module of Oracle Financial?
From
Chirag PatelHello all,
How I can know which tables and views are used in standard reports of "Public Sector Budgeting" module of Oracle Financial?
From
Chirag Patel -
Hi All
we are planning to create a D2K report using
ref cursor the problem for me is that i want to know
whether it is feasible for creating a report which
contains around 5 complicated queries and number of
formula columns etc.can you please give me points
how to go about or if it is not feasible can you
give me the reasons for that.Hello,
Ref Cursor queries are useful in sharing queries across reports, and exploiting commonality between them. You can segregate your individual queries into ref cursors and combine them in your data model. You can also create formula columns based on data fetched by the ref cursor, since Reports treats any data fetched from the data source in a generic manner.
Please take a look at the 'Building a Paper Report with Ref Cursors' section of the 'Building Reports' manual on OTN at http://otn.oracle.com/products/reports/htdocs/getstart/docs/B10310_01/orbr_refcur.htm#1009556 for further details on building and using ref cursor reports.
Thanks,
The Oracle Reports Team. -
Cannot figure out why "ORA-01000 Maximum open cursors" is shown...
Hello there ...
I am programming a PL/SQL Code that is throwing 0RA-01000 Maximum Open Cursors Exceeded.
Having already read quite a lot about ORA-01000 errors, I know I should be closing cursors, and have already tried setting OPEN_CURSORS parameter to a high number (1000).
I declared a lot of procedures in my pl/sql, each of which uses one cursor since i am working with a non-Oracle table linked by ODBC ... and each procedure sometimes does thousands of inserts -- but all WITHIN the explicit cursors. The explicit cursors are not declared within each loop.
I already checked the code many times, and made sure all open cursors are closed. In addition, I also verified the numberopen cursors generated by the PL/SQL by running the following SQL after every procedure i run... and outputting it... and it appears the value just keeps on increasing, even though I had explicitly closed all the cursors in all the earlier procedures.
What is funny is that the most number of cursors reported by the code below only hits 150+ cursors. Nowhere near the 1000 open_cursors limit per session.
select a.value into strtxt --, b.name
from v$mystat a, v$statname b
where a.statistic# = b.statistic#
and a.statistic#= 3;When I run the procedures separately though, all the procedures run smoothly (even when I had not yet updated the open_cursors parameter).
I was thinking of the following, but maybe you have some other ideas?
Does this have anything to do with my procedures not being stored procedures?
Or should i be committing records within my procedures instead of out of it?
I really have run into a wall and would really appreciate any tips or helps on this. Thanks in advance!
My basic pl/sql code looks like below. I did not give the actual details cause it will be too long (up to 5000 lines).
DECLARE
PROCEDURE proc1
IS
CURSOR cur_hca
is
select ...from..where;
TYPE cur_hca_fetch
Is TABLE OF cur_hca%ROWTYPE
INDEX BY PLS_INTEGER;
temp_collect cur_hca_fetch;
BEGIN
open cur_hca; --cur_hca is the cursor name.
--i use exactly the same cursor name in the other procedures
loop
fetch cur_hca bulk collect into temp_collect LIMIT 1000;
exit when temp_collect.count=0
for indx in 1 .. temp_collect.count
loop
...run some sql
end loop;
end loop;
close cur_hca;
END proc1;
PROCEDURE proc2 --almost the same as above the only changes are the query for the
-- cursor and the sql that happens for each record
IS
BEGIN
open cur_hca; --cur_hca is my cursor name
loop
end loop;
close cur_hca;
END proc2;
... up to 40 other very similar procedures
BEGIN
proc1;
commit;
select a.value into strtxt
from v$mystat a, v$statname b
where a.statistic# = b.statistic#
and a.statistic#= 3;
DBMS_OUTPUT.PUT_LINE('Number of Cursors After STATUSproc1: ' || strtxt);
proc2;
commit;
select a.value into strtxt
from v$mystat a, v$statname b
where a.statistic# = b.statistic#
and a.statistic#= 3;
DBMS_OUTPUT.PUT_LINE('Number of Cursors After STATUSproc2: ' || strtxt);
... 40 other procedures
END;Edited by: user4872285 on May 6, 2013 6:49 PM
Edited by: user4872285 on May 6, 2013 7:01 PM
Edited by: user4872285 on May 6, 2013 8:02 PM
Edited by: user4872285 on May 6, 2013 8:03 PMPL/SQL code usually leaks reference cursors and DBMS_SQL cursors - as the ref cursor/DBMS_SQL interface used has a global (session static) scope.
PL/SQL has an intelligent garbage collector that will close local implicit and explicit cursors, when the cursor variable goes out of scope.
If you define an explicit cursor globally (package interface), then it can only be opened once. The 2nd attempt results in a ORA-06511: PL/SQL: cursor already open exception. So code cannot leak explicit cursors as code cannot reopen an existing opened explicit cursor.
I have never seen Oracle leaking cursors internally. So I would be hesitant to call what you are seeing, a bug. If your code is using explicit cursors (even static/global ones), your code cannot leak these cursors, even if your code does not close them. Worse case - the cursor remains open, however new copies cannot be created while it is open.
So I think your are looking at the wrong thing - explicit cursors. These are not the cursors that are leaking in my view (simply because code cannot reuse and open an already opened explicit cursor). Here is an example:
SQL> show parameter cursors
NAME TYPE VALUE
open_cursors integer 300
session_cached_cursors integer 50
// procedure that seems to "leak" an explicit cursor handle
// as it does not explicitly closes the handle
SQL> create or replace procedure CursorUse is
2 cursor c is select e.* from emp e;
3 empRow emp%RowType;
4 begin
5 open c;
6 fetch c into empRow;
7 --// not closing explicit cursor handle
8 --// and going out-of-scope
9 end;
10 /
Procedure created.
// current session stats
SQL> select b.name, a.value from v$mystat a, v$statname b where a.statistic# = b.statistic# and b.name like '%open%cursor%';
NAME VALUE
opened cursors cumulative 91
opened cursors current 2
// execute proc that "leaks" a cursor, 10000 times
SQL> begin
2 for i in 1..10000 loop
3 CursorUse;
4 end loop;
5 end;
6 /
PL/SQL procedure successfully completed.
// no errors due to cursor leakage
// session stats: no cursor leakage occurred as
// PL/SQL's garbage collector cleaned (and closed)
// cursor handles when these became out-of-scope
SQL> select b.name, a.value from v$mystat a, v$statname b where a.statistic# = b.statistic# and b.name like '%open%cursor%';
NAME VALUE
opened cursors cumulative 10,095
opened cursors current 2
SQL> So the cursor leakage you are seeing is caused by something else... so what else is part of the code, or the session, that you have not yet mentioned? -
Chinese Character in PDF format for Oracle Reports 11g
Hello Everyone,
Currently we have a Report that need to be display chinese character in PDF format.
We followed the steps specified in the "Oralce Fusion Middleware Publishing Reports to the Web with Oracle Reports Services"
documentation but things doesn't work. We also installed Adobe Acrobat Reader 9 and Asian Font Pack 9 on the server side
and even on the client/user/development side and followed the steps in the documentation, but no effect at all. Or we even
tried "Arial Unicode MS", same thing no effect.
For sure, we may miss something during PDF aliasing or PDF subsetting setup.
Anyone out there who has the same experience and able to resolve the issue that currently using the Oralce Fusion Middleware Reports 11g?
Doesn't matter if it does not related to chinese character, as long as it relates to this issue like japanese or arabic characters in PDF.
If its ok, kindly provide the steps how you do it.
Your help is highly appreciated.
Regards and Thank you very much!I am now facing exactly the same problem as user449955 (Eric's). Dear Eric, how about your situation? If you have resolved this problem, may I ask for your solution?
In my case, using either font aliasing or font subsetting doesn't work at all (displaying "garbage" characters instead of Chinese characters). The setting in my uifont.ali is as follows:
If using font aliasing:
[PDF]
.....ZHT16HKSCS = "MSungStd-Light-Acro"
If using font subsetting (the REPORTS_PATH already includes "C:\Windows\Fonts"):
[PDF:Subset]
"Courier New" = "mingliu.ttc,2"
For both cases, the report server's NLS_LANG already set to "TRADITIONAL CHINESE_HONG KONG.ZHT16HKSCS" (I am in fact located at Hong Kong). For font aliasing, the client side already has Asian Adobe Reader with Asian font pack installed.
By the way, I noticed that the WebLogic EM is configuring/updating the uifont.ali file at "<instance home>\config\FRComponent\frcommon\tools\common" directory, but the Oracle Reports 11g's documentation sometimes advise to refer to another uifont.ali file located at "<instance home>\config\FRComponent\frcommon\guicommon\tk\admin" directory. Which one of the uifont.ali files is the one used by the Oracle Reporting Service?
My report server's platform is Windows 7 Enterprise (64-bit) and the Reports version is 11.1.1.3.
Anyone can help to advise?
Thank you very much.
Regards -
9ias reports format problem PDF - HTML - HTMLCSS
I have a report to be printed in PDF Or HTML or HTMLCSS format. I am using Oralce 9ias and Reports 9i. PDF output is OK. But the same output in HTML and HTMLCSS are not coming properly.
For e.g. I have a field with size as 150. I am setting Vertical elasticity of the field as expand. But in HTMLCSS if the field size is 150 it merging and not displaying properly. In HTMl it is coming properly. But the date fields i display gets wrapped into two lines.
Is it a bug or any solution present for thisHi Srinivasan
Reports PDF output is high fidelity offering from Oracle Reports. I recommend you to use it as much as possible.
Regarding HTML/CSS, I feeling is that is not currently possible to format the way you say you want to. If this issue is very critical to your business, I suggest you to contact Oracle Support.
Regards
Sripathy -
Oracle Forms and Report.....After next WHAT in ORACLE
Hye Everybody..
I am looking for some body help for GOOD FUTURE IN ORACLE .i have 6+ exp in Oralce Forms and Reports.Now i want to upgrade my skills.So which is the BEST track/Way for me In ORACLE.Bcos i confused.What to do..SO please help me to build the future in ORACLE..
Thank you For read my MSG...1 Ebusiness Suite /ERP. Learn AOL /Forms /Reports Customization
2 Oracle Apex is similar to Forms/Reports and there is currently lot of conversion from Forms/Reports to Apex -
Converting Reports 9i from RDF to JSP
Hi,
I'm going to migrate an existing very complex report from 6i to 9i. (matrix report and using ref-cursors)
The customer wants to run a paper and a web-layout.
If I open the RDF-file from 6i everything is fine. Even if I reopen this file after saving and closing it in the 9i environment I have no problem. But just when I save the RDF as a JSP-file the Report builder is not able to re-open it anymore.
After a while the rwbuilder tells me:
REP-0002: Unable to retrieve a string from the Report Builder message file.
After this the Report Builder just disappears.
If I use the Converter via menu "Tools/File Conversion" the Report Builder can load the new JSP-File but the entire Paper Layout and the
Data sources are missing. The whole code is in the Web-Layout.
I need the paper layout to create PDF-files. The web-layout is needed to create Excel-Sheets.
Can anybody help me? - Is really urgent.
Thanks in advance.
Detlef KuhfahlHello Detlef,
Some issues involving ref cursor reports stored in the XML/JSP/HTML report format have been addressed in the latest 9.0.2.3 Reports Patch (Patch number 3129219). You can download this patchset from http://metalink.oracle.com. Please verify whether it addresses your problem.
Thanks,
The Oracle Reports Team. -
Please help!!! Report Services
Hi,
I am very new to Oracle Report.
I have installed Oracle 9iAS in D:\Oralce folder and Reports developer on d:\OracleReports folder.
I have created a report in JSP format and is placed in D:\OracleReports\Reports folder. Now I want to run this report using a URL, how do I do it and where shall I keep this JPS file in D:\Oracle? Will I need Report Services for this? Is it installed as a part of Report developer or Oracle 9iAS? I my case HTTP Server was installed with Oracle 9iAS but Services was installed with Report Developer. So am confused.
I have been trying this since 15 days in vain. Please revert back.
Regards
ArchanaRDF reports OR
JSP reports with paperlayout (optionally can contain weblayout also)
( To be safe you can create your report with paperlayout + weblayout in reports wizard)
1) Put the report anywhere in file system in an accessible place
2) Start reports server/ reports services
3) Run this url
http://host:port/reports/rwservlet?report=<full path name of report>userid=scott/tiger@dbdestype=cache+desformat=htmlcss+server=server_name
This is one of the easiest ways.
For details you can refer "publising reports to web" document for details
html - http://download.oracle.com/docs/html/A92102_01/toc.htm
pdf - http://download.oracle.com/docs/pdf/A92102_01.pdf (5MB)
All links - http://otn.oracle.com/documentation/reports_dev.html
In your case please refer chapter 2, 3 and 8. This servlet run can produce all output formats html, htmlcss, pdf,rtf etc
JSP reports with only weblayout
This can be used only for JSP run (ie output will be html)
1) For this you will need to know how to deploy an application in an Application server (especially Oracle 9iAS). You will need to package your application (jsps, html, servlets etc) in a .war or .ear file. Any good J2EE book should explain this ear packaging. Oracle 9i JDeveloper should have some wizards for making this easier. For Oracle 9iAS there will be some application server specific files (orion-web.xml and orion-application.xml for which only little modification will be required.)
2) While deploying the application the reports specific stuff to do will be to add the rwrun.jar and zrclient.jar libraries to application path in orion-web.xml file
<library path="$OHOME/reports/jlib/rwrun.jar"/>
<library path="$OHOME/jlib/zrclient.jar"/>
3) There should be a default reports demo in standard 9iAS installations . You can find that in
$OHOME/j2ee/home/applications/reports.ear
which contains a simple reports jsp report. You can open the ear file (using winzip), the enclosed .war file (using winzip) and see the structure of the application [ Maybe even tweak it to create your application ]
4) After .ear file creation you will have to deploy your application in Application server (using Enterprise Manager
or JDeveloper)
Once this is done you can run using this url
http://host:port/<appName>/test.jsp?otherParams ...
Thanks,
The Oracle Reports Team. -
How can we increse this coding Part
Hi there
I came across some coding to improve .while looking the progam it is unique .some say it is correct as per the Sap point of view .but some dosent.
Please verify is this the correct way for coding .
IF NOT skont IS INITIAL.
IF NOT aksaldo IS INITIAL.
IF NOT summen IS INITIAL.
LOOP AT organ.
CLEAR: f_bwkey, f_bklas, f_bwtty, f_bwtar, sum.
SELECT bwkey bklas bwtty bwtar SUM( salk3 ) FROM mbew
INTO (f_bwkey, f_bklas, f_bwtty, f_bwtar, sum)
WHERE bwkey EQ organ-bwkey
AND matnr IN matnr
AND bklas IN ibklas
AND bwtar IN bwtar
GROUP BY bwkey bklas bwtty bwtar.
CHECK NOT sum IS INITIAL.
MOVE f_bwkey TO xmbew-bwkey.
MOVE f_bklas TO xmbew-bklas.
MOVE f_bwtty TO xmbew-bwtty.
MOVE f_bwtar TO xmbew-bwtar.
MOVE sum TO xmbew-salk3.
COLLECT xmbew.
ENDSELECT.
CLEAR: f_bwkey, f_bklas, f_bwtty, f_bwtar, sum.
SELECT bwkey bklas bwtty bwtar SUM( salk3 ) FROM ebew
INTO (f_bwkey, f_bklas, f_bwtty, f_bwtar, sum)
WHERE bwkey EQ organ-bwkey
AND matnr IN matnr
AND bklas IN ibklas
AND bwtar IN bwtar
GROUP BY bwkey bklas bwtty bwtar.
CHECK NOT sum IS INITIAL.
MOVE f_bwkey TO xmbew-bwkey.
MOVE f_bklas TO xmbew-bklas.
MOVE f_bwtty TO xmbew-bwtty.
MOVE f_bwtar TO xmbew-bwtar.
MOVE sum TO xmbew-salk3.
COLLECT xmbew.
ENDSELECT.
CLEAR: f_bwkey, f_bklas, f_bwtty, f_bwtar, sum.
SELECT bwkey bklas bwtty bwtar SUM( salk3 ) FROM qbew
INTO (f_bwkey, f_bklas, f_bwtty, f_bwtar, sum)
WHERE bwkey EQ organ-bwkey
AND matnr IN matnr
AND bklas IN ibklas
AND bwtar IN bwtar
GROUP BY bwkey bklas bwtty bwtar.
CHECK NOT sum IS INITIAL.
MOVE f_bwkey TO xmbew-bwkey.
MOVE f_bklas TO xmbew-bklas.
MOVE f_bwtty TO xmbew-bwtty.
MOVE f_bwtar TO xmbew-bwtar.
MOVE sum TO xmbew-salk3.
COLLECT xmbew.
ENDSELECT.
consider valuated subcontractor stocks from OBEW "n497391
CLEAR: f_bwkey, f_bklas, f_bwtty, f_bwtar, sum. "n497391
SELECT bwkey bklas bwtty bwtar SUM( salk3 ) "n497391
FROM obew "n497391
INTO (f_bwkey, f_bklas, f_bwtty, f_bwtar, sum) "n497391
WHERE bwkey EQ organ-bwkey "n497391
AND matnr IN matnr "n497391
AND bklas IN ibklas "n497391
AND bwtar IN bwtar "n497391
GROUP BY bwkey bklas bwtty bwtar. "n497391
CHECK NOT sum IS INITIAL. "n497391
MOVE f_bwkey TO xmbew-bwkey. "n497391
MOVE f_bklas TO xmbew-bklas. "n497391
MOVE f_bwtty TO xmbew-bwtty. "n497391
MOVE f_bwtar TO xmbew-bwtar. "n497391
MOVE sum TO xmbew-salk3. "n497391
COLLECT xmbew. "n497391
ENDSELECT. "n497391
ENDLOOP.
ELSEIF summen IS INITIAL.
CLEAR xmbew. "388498
SELECT mandt matnr bwkey bwtar lvorm lbkum salk3
vprsv verpr stprs peinh bklas salkv lfgja lfmon
bwtty pstat vksal eklas qklas
FROM mbew INTO CORRESPONDING FIELDS OF xmbew
FOR ALL ENTRIES IN organ WHERE bwkey EQ organ-bwkey
AND matnr IN matnr
AND bklas IN ibklas
AND bwtar IN bwtar.
APPEND xmbew.
ENDSELECT.
Begin of Optima APP 037
IF NOT xmbew IS INITIAL.
Start of Insert E_FIR.018 PRADHSA1
SELECT matnr werks prctr
FROM marc
INTO TABLE i_marc
FOR ALL ENTRIES IN xmbew
WHERE matnr = xmbew-matnr
AND werks = xmbew-bwkey.
End of Insert E_FIR.018 PRADHSA1
ENDIF.
Begin of Optima APP 037
CLEAR xmbew. "388498
SELECT mandt matnr bwkey bwtar lbkum salk3
vprsv verpr stprs peinh bklas salkv lfgja lfmon
bwtty vksal sobkz vbeln posnr
FROM ebew INTO CORRESPONDING FIELDS OF xmbew
FOR ALL ENTRIES IN organ WHERE bwkey EQ organ-bwkey
AND matnr IN matnr
AND bklas IN ibklas
AND bwtar IN bwtar.
xmbew-no_sum = 'X'.
APPEND xmbew.
ENDSELECT.
CLEAR xmbew. "388498
SELECT mandt matnr bwkey bwtar lbkum salk3
vprsv verpr stprs peinh bklas salkv lfgja lfmon
bwtty vksal sobkz pspnr
FROM qbew INTO CORRESPONDING FIELDS OF xmbew
FOR ALL ENTRIES IN organ WHERE bwkey EQ organ-bwkey
AND matnr IN matnr
AND bklas IN ibklas
AND bwtar IN bwtar.
xmbew-no_sum = 'X'.
APPEND xmbew.
ENDSELECT.
consider valuated subcontractor stocks from OBEW "n497391
CLEAR xmbew. "n497391
SELECT mandt matnr bwkey bwtar lbkum salk3 "n497391
vprsv verpr stprs peinh bklas salkv "n497391
lfgja lfmon bwtty vksal sobkz lifnr "n497391
FROM obew INTO CORRESPONDING FIELDS OF xmbew "n497391
FOR ALL ENTRIES IN organ "n497391
WHERE bwkey EQ organ-bwkey "n497391
AND matnr IN matnr "n497391
AND bklas IN ibklas "n497391
AND bwtar IN bwtar. "n497391
xmbew-no_sum = 'X'. "n497391
APPEND xmbew. "n497391
ENDSELECT. "n497391
ENDIF.
Thanks in advance
RajaHi Raj,
1) Avoid select statements inside a loop which will effect the performance of your program
2) First get all the required data from tables mbew, ebew, qbew, obew, qbew, obew in to separate internal tables using for all entries from internal table organ instead of using select----endselect in a loop
3) use nested loops instead of select------endselect but use parallel cursor method in nested loop to improve performance.
The below example shows how to improve performance if we use nested loop using parallel cursor method
Nested Loop using Parallel Cursor:
REPORT zparallel_cursor2.
TABLES:
likp,
lips.
DATA:
t_likp TYPE TABLE OF likp,
t_lips TYPE TABLE OF lips.
DATA:
w_runtime1 TYPE i,
w_runtime2 TYPE i,
w_index LIKE sy-index.
START-OF-SELECTION.
SELECT *
FROM likp
INTO TABLE t_likp.
SELECT *
FROM lips
INTO TABLE t_lips.
GET RUN TIME FIELD w_runtime1.
SORT t_likp BY vbeln.
SORT t_lips BY vbeln.
LOOP AT t_likp INTO likp.
LOOP AT t_lips INTO lips FROM w_index.
IF likp-vbeln NE lips-vbeln.
w_index = sy-tabix.
EXIT.
ENDIF.
ENDLOOP.
ENDLOOP.
GET RUN TIME FIELD w_runtime2.
w_runtime2 = w_runtime2 - w_runtime1.
WRITE w_runtime2.
Thanks,
Naveen Kumar. -
Hye Everybody..
I am looking for some body help for GOOD FUTURE IN ORACLE .i have 6+ exp in Oralce Forms and Reports.Now i want to upgrade my skills.So which is the BEST track/Way for me In ORACLE.Bcos i confused.What to do..SO please help me to build the future in ORACLE..
Thank you For read my MSG...By default the other session has to wait (no error message):
From SQL Reference SELECT section: http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#SQLRF01702
>
NOWAIT | WAIT
The NOWAIT and WAIT clauses let you tell the database how to proceed if the SELECT statement attempts to lock a row that is locked by another user.
Specify NOWAIT to return control to you immediately if a lock exists.
Specify WAIT to instruct the database to wait integer seconds for the row to become available and then return control to you.
If you specify neither WAIT nor NOWAIT, then the database waits until the row is available and then returns the results of the SELECT statement.
>
Edited by: P. Forstmann on 7 janv. 2010 09:00
Edited by: P. Forstmann on 7 janv. 2010 09:01 -
Query to get rows betwen x and y + table total row count
Hi,
I try get rows between e.g. 100 and 150 when I sort by some column
My query is now like this
SELECT *
FROM
(SELECT a.*,
row_number() OVER (ORDER BY OWNER ASC) rn,
COUNT(1) over() mrn
FROM (SELECT * FROM all_objects) a
WHERE ROWNUM BETWEEN least(100,mrn) AND 150It is not very fast if I run that kind select from big table
Any tips to optimize this query?
Regards,
JariHi,
I'm so bad with SQL :(
Here is sample where I need that kind query.
http://actionet.homelinux.net/htmldb/f?p=100:504
It looks standard Apex report but it is not.
It is just test to use query to output html using htp package
I send parameter start row, max rows, column I like order by.
Now I do query for cursor
/* Report query */
l_sql := '
SELECT * FROM(
SELECT a.*, row_number() OVER (ORDER BY '
|| l_sort_col
|| ' '
|| l_sort_ord
|| ') rn, COUNT(1) over() mrn
FROM(' || l_sql || ') a
) WHERE rn BETWEEN LEAST(' || l_start_row || ',mrn) AND ' || l_last_row
;Then I loop cursor and output html.
You can order report by click heading and there is that pagination
I did not know that I could find examples by "pagination query" =), thanks for that tip for both of you.
I know Apex have reports ,
but I need have features that Apex templates can not provide at least yet.
So I have study that generating html tables using custom package instead Apex report should be best approach to get layouts I need.
Regards,
Jari
Edited by: jarola on Jan 21, 2011 10:38 PM -
Duplicate data in historical log when changing time
Having changed the time on the computer which the Lookout Timeserver uses to synchronize its clock, my Hypertrends show that the Citadel database has two sets of data for logged objects during the overlapped time period. The Hypertrend cursor reports values for the data that was written to the database first. Unfortunately, I am most interested in the data that was recorded second. Querying the Citadel database using Excel and Microsoft Query results in null values for the overlapped time period. Is there any way to extract the second set of data for this time period other than visually recording points off the Hypertrend graph?
Remzi,
I am currently using Lookout 4.0.1 build 61 along with LabView 7.0 and MAX 3.0.1. I do not currently have the DSC software required for viewing historical data in MAX, but is there any evidence it would extract data any differently than the hypertrend cursor or Microsoft Query used with Excel? The only evidence I have that the two sets of data reside in the Citadel database is that both traces are recorded in the hypertrend viewer.
Mark Nornberg -
Performanc issue...help..
Hi all
i want to increase performance in one Existing program..this program is working fine but performance is very poor. we r indexing the required filed.
but i find some nested select loop inside this program...
pls ,,suggest me how can i avoid this kind of nested select loop. instead of loop statement can i user read statement for avoiding the nested loop???
pls check the below code.
if any problem within this logice then change the code.
thanks in advance.
Indu
SORT it_but000 BY partner.
LOOP AT it_ever INTO wa_ever.
LOOP AT it_fkkvkp INTO wa_fkkvkp WHERE vkont = wa_ever-vkonto.
READ TABLE it_but000 INTO wa_but000 WITH KEY partner = wa_fkkvkp-gpart
BINARY SEARCH.
IF sy-subrc = 0.
IF wa_but000-name_org1 IS INITIAL.
CONCATENATE wa_but000-name_first
wa_but000-name_last
INTO wa_final-cust_name SEPARATED BY space.
CONDENSE wa_final-cust_name.
ELSE.
wa_final-cust_name = wa_but000-name_org1.
ENDIF.
wa_final-gpart = wa_fkkvkp-gpart.
MODIFY it_final FROM wa_final TRANSPORTING cust_name gpart WHERE vertrag = wa_ever-vertrag.
ENDIF.
ENDLOOP.
ENDLOOP.
LOOP AT it_isu_data.
LOOP AT it_iflot WHERE tplnr = it_isu_data-tplnr.
wa_final-s_o_code = it_iflot-zwst_wtr.
MODIFY it_final FROM wa_final TRANSPORTING s_o_code
WHERE vertrag = it_isu_data-vertrag.
CLEAR wa_final-s_o_code.
ENDLOOP.
LOOP AT it_final INTO wa_final.
LOOP AT it_erch WHERE vertrag = wa_final-vertrag.
IF it_erch-vertrag = wa_final-vertrag.
SELECT SINGLE tariftyp
branche
FROM eanlh
INTO (l_tariftyp, l_branche)
WHERE ab <= it_erch-erdat AND bis > it_erch-erdat
AND anlage = wa_final-anlage.
IF sy-subrc = 0.
wa_final-t_type = l_tariftyp.
IF l_tariftyp IS NOT INITIAL.
SELECT SINGLE ttypbez
FROM ettat
INTO l_ttypbez
WHERE spras = sy-langu
AND tariftyp = l_tariftyp.
wa_final-c_description = l_ttypbez.
ENDIF.
MODIFY it_final FROM wa_final TRANSPORTING c_description t_type. "sic_code
ENDIF.
CLEAR it_erch.
ENDLOOP.
CLEAR: wa_final, l_tariftyp, l_ttypbez, l_branche.
ENDLOOP.
DATA : it_egerh TYPE STANDARD TABLE OF ty_egerh,
wa_egerh TYPE ty_egerh.
LOOP AT it_final INTO wa_final.
LOOP AT it_erch WHERE vertrag = wa_final-vertrag.
wa_comb-equnr = wa_final-equnr.
wa_comb-erdat = it_erch-erdat.
APPEND wa_comb TO it_comb.
CLEAR wa_comb.
CLEAR it_erch.
ENDLOOP.
CLEAR wa_final.
ENDLOOP.
IF it_final[] IS NOT INITIAL.
SELECT anlage
logikzw
bis
preiskla
FROM easts
INTO TABLE it_easts
FOR ALL ENTRIES IN it_final
WHERE anlage = it_final-anlage.
IF sy-subrc = 0.
LOOP AT it_final INTO wa_final.
LOOP AT it_easts INTO wa_easts WHERE anlage = wa_final-anlage.
wa_final-m_size = wa_easts-preiskla.
MODIFY it_final FROM wa_final TRANSPORTING m_size WHERE anlage = wa_final-anlage.
ENDLOOP.
ENDLOOP.Hi Indu,
if u got Nested Loops then use PARALLEL CURSOR METHOD .
The performance will be very good.
Nested Loops This is one of the fear factors for all the ABAP developers as this consumes lot of program execution time. If the number of entries in the internal tables is huge, then the situation would be too worse. The solution for this is to use parallel cursor method whenever there is a need for Nested Loop.
Program using Normal Nested Loop:
REPORT ZNORMAL_NESTEDLOOP.
TABLES:
likp,
lips.
Data:
t_likp type table of likp,
t_lips type TABLE OF lips.
data:
W_RUNTIME1 TYPE I,
W_RUNTIME2 TYPE I.
START-OF-SELECTION.
select *
from likp
into table t_likp.
select *
from lips
into table t_lips.
get RUN TIME FIELD w_runtime1.
loop at t_likp into likp.
loop at t_lips into lips where vbeln eq likp-vbeln.
endloop.
endloop.
get RUN TIME FIELD w_runtime2.
w_runtime2 = w_runtime2 - w_runtime1.
write w_runtime2.
Nested Loop using Parallel Cursor:
REPORT zparallel_cursor2.
TABLES:
likp,
lips.
DATA:
t_likp TYPE TABLE OF likp,
t_lips TYPE TABLE OF lips.
DATA:
w_runtime1 TYPE i,
w_runtime2 TYPE i,
w_index LIKE sy-index.
START-OF-SELECTION.
SELECT *
FROM likp
INTO TABLE t_likp.
SELECT *
FROM lips
INTO TABLE t_lips.
GET RUN TIME FIELD w_runtime1.
SORT t_likp BY vbeln.
SORT t_lips BY vbeln.
LOOP AT t_likp INTO likp.
LOOP AT t_lips INTO lips FROM w_index.
IF likp-vbeln NE lips-vbeln.
w_index = sy-tabix.
EXIT.
ENDIF.
ENDLOOP.
ENDLOOP.
GET RUN TIME FIELD w_runtime2.
w_runtime2 = w_runtime2 - w_runtime1.
WRITE w_runtime2.
Analysis report: Runtime in microseconds:
Iteration No ...... Normal Nested Loop ..... Using Parallel Cursor
1...................... 34,796,147 .........................63,829
2 ..................... 38,534,583 ......................... 56,894
3 ..................... 34,103,426 ......................... 50,510
Please check this link
http://www.****************/Tutorials/ABAP/ParallelCursor.htm
reward if helpful
raam.
Maybe you are looking for
-
Verizon - CDMA and overseas use with a different GSM iPhone
I would love to make the switch from AT&T to Verizon. Problem being, as many have noted, that the Verizon phone only supports CDMA. I live overseas 6 months out of the year and have currently been using my unlocked 3G iPhone and have had no problems
-
My last question for now!
Hello there, its me again, I managed to do the next two questions on my own!! :-) I'm on the last one now, I have a solution but I feel like I'm missing the point with my code as I have had to retype similar code 3 or more times and some lines aren't
-
I am unable to send an editable PDF from my iPad to a PC.
Any suggestions? It works fine when I send it to my Mac. Does Adobe Reader need to be updated on the PCs?
-
Photoshop CC - Can't sync settings between computers
Hi! I have Photoshop CC both on my desktop computer and on my laptop. Now I want to sync the settings to my laptop. But it doesn't work. Here is a screendump from my desktop computer: As you can see I'm logged in to my account. But shouldn't I also b
-
Final render coming out with a stutter
Hello, I have a simple render consisting of one comp that has 2 jpeg images moving right to left between two keyframes(easy ease). That comp is nested over a .mov of a moving background. When I RAM preview the motion looks fine, but as the images m