Converting cursor to ref cursor in Report builder pl/sql
Hi,
I am trying to use dynamic sql in My report 's pl/sql code.
I can not use execute Immediate statement since this feature is not suppoerted at client side and i am doing the coding In my local mchine and running the report loaclly.......???
Another way to use dynamic sql is by using dbms_sql package.
Using dbms_sql to run a sql will give me a normal cursor as an output.
Since in report builder pl/sql only ref cursor is allowed as a return type from a function........the problem i m facing is conversion of the cursor to ref cursor......
in oracle 11g we have a built in function in dbms_sql package that can be used for the conversion....
i m using oracle 10 g where the above mentioned feature is not available............
Please give some way to resolve this issue............!!!!!!!!!!!!
Thanks in Advance.....!!!!!!!
Abhishant
You may use some stored procedures that will take full advantage of dynamic SQL. Make a stored proc that inserts rows in a global temporary table. You will call that stored proc in the afterpform trigger. And you will have the report querry select from the temporary table populated by the stored proc.
I did some things like that.
HTH
Similar Messages
-
How to Execute sql query in PL/SQL ( a variable) with out using Cursor or REF cursor
Hi
I am building a dynamic query based on some conditions
as an example
v_query varchar2(2000);
x1 varchar2(20);
y1 varchar2(20);
z1 varchar2(20);
v_query := ' Select x,y,z into x1,y1,z1 From ... ';
Is there any way to execute the query with out using cursor or ref cursor..
Thanks
ArunBoth Tod and Eric provided valid responses given the format of the queory you supplied. Howver, if you want to use dynamic sql in either way, you need to be absolutely certain that your query will always only return a single row (e.g. SELECT COUNT(*) FROM mytable), because if it retuns more than one, your procedure will break unless you have an exception handler to handle either TOO_MANY_ROWS or OTHERS.
If you want to pull in a lot of data without walking a cursor, you should look at the BULK COLLECT options. -
Help with Oracle Report Builder and SQL Server2000
Hey guys,
I just installed it Oracle Developer Suite10g with Report Builder and I am trying to use Report builder and wants to connect with SQL Server 2000. The problem that I am running in to is SQL Server 2000 i have is Window Authentication so Does not required to enter user name and password. So how can i connect my report builder to SQL server or is it possible to connect Report builder to SQL server?
Also, I want to create small practice version of database in Oracle how do i do it? what i mean by that is I installed trial version or Oracle developer 10g from www.oracle.com and now trying to get some knowledge with oracle. Could any one can give me some direction in this matter please.
Thank You
KeyHave a look at the reports help for the purpose header and trailer sections. Here is an exert:
"Report sectioning enables you to define multiple layouts in the same report, each with a different target audience, output format, page layout, page size, or orientation. You can define up to three report sections, each with a body area and a margin area: the names of the sections are Header, Main, and Trailer. By default, a report is defined in the Main section. In the other sections, you can define different layouts, rather than creating multiple separate reports. If you wish, you can use the margin and body of the Header and Trailer sections to create a Header and Trailer page for your reports." -
Cursor difference (REF Cursor & Sys_Refcursor)
Hi,
Is there any difference between REF Cursor and SYS_Refcursor?
I see some packages using sys_refcursor and some using REF Cursor.
Package 1 (Spec):
PROCEDURE s_demo1 (
ret_rset OUT sys_refcursor
Package 2 (Spec):
TYPE cur_set IS REF CURSOR;
PROCEDURE s_test1 (out_data OUT cur_set);
PROCEDURE s_test2 (out_data OUT cur_set);I am going through this link (http://sql-plsql.blogspot.com/2007/05/oracle-plsql-ref-cursors.html) but didn't find the answer.DomBrooks wrote:
John - don't get me wrong, I'm not suggesting that as soon as something like SYS_REFCURSOR comes along, everything should get rewritten. It's just I still see new packages written on 11g by, say mainly C# or java developers, which use this old style.
But.... are you saying that you can't do this?
CREATE OR REPLACE PACKAGE old_package AS
TYPE pkg_cur IS REF CURSOR;
FUNCTION foo(p_id IN NUMBER) RETURN sys_refcursor;
END;
CREATE OR REPLACE PACKAGE BODY old_package AS
FUNCTION foo(p_id IN NUMBER) RETURN sys_refcursor IS
l_cur sys_refcursor;
BEGIN
OPEN l_CUR FOR SELECT * FROM dual WHERE 1 = p_id;
RETURN l_cur;
END;
END;
Absolutely, I can even declare pkg_cursor as a sys_refcursor and all of the old calls will still work since sys_refcursor is just a ref cursor in disguise. What I cannot do is drop the declaration in the package spec since the outside callers rely on it, so since sys_refcusor is just a ref cursor in disguise, why use it?
In fact, in OHOME/rdbms/admin/stdspec.sql which is the declarations for the package standard sys_refcursor is declared as:
/* Adding a generic weak ref cursor type */
type sys_refcursor is ref cursor;Since things declared in standard package (like data types, operators, all of the named exceptions etc.) are "globally" available without using the package name, sys_refcursor just provides a method to save a few keystrokes everywhere. It is no different functionally than a package declared ref cursor. The main difference is that you cannot create a strongly typed sys_refcursor, if you want/need one, you need to use a ref cursor.
I do tend to use sys_refcursor in new code, but it took me a while to switch because there is not much real benefit as far as I can see.
John
Edited by: John Spencer on Nov 17, 2010 4:11 PM -
Why do I get the following error message when trying to use Report Builder in sql server 2012?
sukai
Hi sukai,
The issue is due to one or more of the files listed in the application manifest cannot be found on the server. We can upload all the deployment’s dependents files, and try again. And frequently this means that the application is somehow corrupted, or that
the ClickOnce store is corrupted. Please refer to the following thread to fix the issue.
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/47c9f7c6-00ed-4980-9667-5c176ad7116a/ssrs-report-builder-application-cannot-be-started-contact-application-vendor
According to your screenshot, you are using Chrome. Please use IE browser try it again. SSRS not all report functionality is supported by all browsers. Please refer to the similar thread below:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/ef9cb3f2-2acd-4947-b1fe-4724c51c61a2/unable-to-start-report-builder?forum=sqlreportingservices
Regards,
Alisa Tang
Alisa Tang
TechNet Community Support -
Report Builder beyond SQL Server 2014?
Where can I find details of the Microsoft Roadmap for the future plans for Report Builder?
Will Report Builder continue to be supported? Or will it be replaced by other tools?
ThanksHi Wolley66,
For the
document of Documentation for SQL Server 2014 Tools and Add-in Components section, we can know that Report Builder is still supported in SQL Server 2014. If you want to download Microsoft® SQL Server® 2014 Report Builder tool, we can refer to the following
link:
http://www.microsoft.com/en-in/download/details.aspx?id=42301
If you have any concern and requirement about Report Builder in Microsoft Roadmap, please submit a feedback at
https://connect.microsoft.com/SQLServer/Feedback. Connect site is a connection point between you and Microsoft, and ultimately the larger community. Your feedback enables Microsoft to make software
and services the best that they can be, and you can learn about and contribute to exciting projects.
Regards,
Katherine Xiong
Katherine Xiong
TechNet Community Support -
Ordering Columns in SSRS Report Builder for SQL Server 2012
I have my report displaying the correct information, however the columns are arranged in alphabetical order of the column group members. I want to arrange them in a different order. How do I do that?
The following may help, but don't use it if it doesn't: One variable in my data set is the desired column order (call it 'column rank'. It runs from 1,...,10). If I make that the column group, the columns ARE arranged in the correct order but now the labels
are '1','2', etc. I.e. not the labels I want.
Many thanks.
P.S. First time using RS so please excuse terminological errors. Obviously I have used the docs. and Google to try and find the answer to this.
-AHi achalk,
Per my understanding that you want to specify the order of the column group to a special order, right?
I have tested on my local environment and you can using an expression to acheive this, detail information below for your reference:
for example you now have the order like below:
Column group:
test1 test2 test3 test4
You can use the expression with switch functionn to specify order value based on the value in the column group :
select the sorting in the "group properties" of the column group and add the expresion in the "Sort by"
=switch(Fields!columngroupfield.Value="test1",1,
Fields!columngroupfield.Value="test3",2,
Fields!columngroupfield.Value="test4",3,
Fields!columngroupfield.Value="test2",4)
Then you will got the order like below:
test1 test3 test4 test2
If you still have any problem, please feel free to ask.
Regards
Vicky Liu
If you have any feedback on our support, please click
here.
Vicky Liu
TechNet Community Support -
Reg. Converting a package level cursor into a Ref cursor
Hi Guru's,
I am in need of converting a package level cursor which contains "FOR UPDATE OF" clause into a Ref cursor where the query will be dynamically built in with the needed table name and other parameters.
Using that cursor many Update statement's were performed with "WHERE CURRENT OF" clause included in it.
Now I changed my cursor into Ref cursor, but when i compile the cursor that is built dynamical is not identified, since i am getting error.
Can any one tell me how to proceed in order to implement it?
Do I need only go for dynamic bulding of the whole procedure.
With Best Regards,
Vijayasekaran.NMay be you can work it around with ROWID. Like this
Say this is your actual code.
declare
cursor c
is
select *
from t
for update of name;
lno t.no%type;
lname t.name%type;
begin
open c;
loop
fetch c into lno, lname;
exit when c%notfound;
update t set name = lno||lname
where current of c;
end loop;
close c;
end;
/With refcursor you can do this.
declare
type rc is ref cursor;
c rc;
lno t.no%type;
lname t.name%type;
lrowid rowid;
begin
open c for 'select rowid rid, t.*
from t
for update of name';
loop
fetch c into lrowid,lno, lname;
exit when c%notfound;
update t set name = lno||lname
where rowid = lrowid;
end loop;
close c;
end;
/Edited by: Karthick_Arp on Dec 26, 2008 2:00 AM -
How to convert the varray to ref cursor
Hi,
Is there any way to convert varray to ref cursor....
i dont want to use any table or record as an ref cursor..
i just want to create a procedure which returns a ref cursor..
below is the sample procedure for it..
create or replace procedure FETCH_DATA1
tab_name in varchar2,
p_recordset1 OUT fetch_data_pak.ref_cursor
AS
type v_array1 is varray(1000) of t_transaction%rowtype;
v_array2 v_array1;
cursor s1 is select * from t_transaction where lastupdate_date > '08-Aug-09';
begin
open s1;
fetch s1 bulk collect into v_array2 limit 100;
close s1;
select * from table(cast (v_array2 as p_recordset1));
end FETCH_DATA1;
I need to convert the varray to ref cursor.....Why put it into a varray at all?
You can just open the ref cursor for that select you are desiring.
And if you need to limit it to returning just the first 100 (as your code seems to imply), wrap it and filter on rownum.
Something similar to this:
create or replace procedure FETCH_DATA1
tab_name in varchar2,
p_recordset1 OUT fetch_data_pak.ref_cursor
AS
begin
open p_recordset1 for
select /*+ first_rows(100) */ * from (
select * from t_transaction
where lastupdate_date > to_date('08-08-2009','DD-MM-YYYY')
--order by something
where rownum <= 100;
end FETCH_DATA1;And note, that you really should have an order by when you wish to limit yourself to "first 100 rows" - otherwise it will be "random 100 rows".
That goes for your cursor solution as well...
Edited by: Kim Berg Hansen on Nov 28, 2011 10:25 AM
Added explicit date conversion - it is bad practice not to explicitly convert dates ;-) -
What are the advantages to using a REF cursor
When would I want to use a REF cursor?
REF CURSORs are not cursors, they're references to cursors. This means they're dynamic. So you can completely change the query executed by the cursor.
For example you can use a REF CURSOR to select from one of a number of tables (depending on an input parameter or other sort of flag). The results are fetched into the same resultset holder and hence you only need a single lot of code to process the results.
Also you can also pass a REF CURSOR as a argument to other PL/SQL procedures and functions.
rgds, APC -
Service Pack 3 appears to have broken the Report Builder click once installation
We are running SQL Server reporting services on SQL Server 2008 R2. Recently we installed the service pack 3 and we now get the following error when a user clicks the Report Builder link:
Application validation did not succeed. Unable to continue.
And from the Log:
ERROR DETAILS
Following errors were detected during this operation.
* [10/14/2014 9:04:32 AM] System.Deployment.Application.InvalidDeploymentException (HashValidation)
- File, Microsoft.ReportingServices.ComponentLibrary.Controls.dll, has a different computed hash than specified in manifest.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, Hash hash)
at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, HashCollection hashCollection)
at System.Deployment.Application.ComponentVerifier.VerifyComponents()
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification
notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
I'm at a bit of a loss of what to do since all recommended solutions I've found are for installing the latest service pack or cumulative update (from threads several years old). By installing service pack 3 we are at the latest upgrade path for 2008
R2 and ironically enough, this is what appears to have broken the click once installer.Hi Matt,
This is an known issue in SSRS 2008 R2 SP3. For this issue, Microsoft has published an article addressing this issue. It is not planning to release a fix for this defect. But there's workarounds for this issue. Please refer to the link below:
Report Builder of SQL Server 2008 R2 Service Pack 3 does not launch.
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Issue With Report Builder After Installing SP3 for SQL 2008 R2
Hello. We are experiencing an issue with Report Builder 3.0 since installing SP3 for SQL 2008 R2 over the weekend. You can no longer launch Report Builder from the Reporting Services URL (http://dicomweb/ReportServer/ReportBuilder/ReportBuilder_3_0_0_0.application
Server : Microsoft-HTTPAPI/2.0
X-AspNet-Version: 2.0.50727
Application url :
http://dicomweb/ReportServer/ReportBuilder/RptBuilder_3/MSReportBuilder.exe.manifest
Server : Microsoft-HTTPAPI/2.0
X-AspNet-Version: 2.0.50727
IDENTITIES
Deployment Identity : ReportBuilder_3_0_0_0.application, Version=10.50.6000.34, Culture=neutral, PublicKeyToken=c3bce3770c238a49, processorArchitecture=x86
Application Identity : MSReportBuilder.exe, Version=10.50.6000.34, Culture=neutral, PublicKeyToken=c3bce3770c238a49, processorArchitecture=x86, type=win32
APPLICATION SUMMARY
* Online only application.
* Trust url parameter is set.
ERROR SUMMARY
Below is a summary of the errors, details of these errors are listed later in the log.
* Activation of
http://dicomweb/ReportServer/ReportBuilder/ReportBuilder_3_0_0_0.application resulted in exception. Following failure messages were detected:
+ File, Microsoft.ReportingServices.ComponentLibrary.Controls.dll, has a different computed hash than specified in manifest.
COMPONENT STORE TRANSACTION FAILURE SUMMARY
No transaction error was detected.
WARNINGS
There were no warnings during this operation.
OPERATION PROGRESS STATUS
* [10/15/2014 9:35:56 AM] : Activation of
http://dicomweb/ReportServer/ReportBuilder/ReportBuilder_3_0_0_0.application has started.
* [10/15/2014 9:36:29 AM] : Processing of deployment manifest has successfully completed.
* [10/15/2014 9:36:29 AM] : Installation of the application has started.
* [10/15/2014 9:36:31 AM] : Processing of application manifest has successfully completed.
* [10/15/2014 9:36:35 AM] : Found compatible runtime version 2.0.50727.
* [10/15/2014 9:36:35 AM] : Detecting dependent assembly Sentinel.v3.5Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=msil using Sentinel.v3.5Client, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a,
processorArchitecture=msil.
* [10/15/2014 9:36:35 AM] : Detecting dependent assembly System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=msil using System.Data.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089,
processorArchitecture=msil.
* [10/15/2014 9:36:35 AM] : Request of trust and detection of platform is complete.
ERROR DETAILS
Following errors were detected during this operation.
* [10/15/2014 9:36:43 AM] System.Deployment.Application.InvalidDeploymentException (HashValidation)
- File, Microsoft.ReportingServices.ComponentLibrary.Controls.dll, has a different computed hash than specified in manifest.
- Source: System.Deployment
- Stack trace:
at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, Hash hash)
at System.Deployment.Application.ComponentVerifier.VerifyFileHash(String filePath, HashCollection hashCollection)
at System.Deployment.Application.ComponentVerifier.VerifyComponents()
at System.Deployment.Application.DownloadManager.DownloadDependencies(SubscriptionState subState, AssemblyManifest deployManifest, AssemblyManifest appManifest, Uri sourceUriBase, String targetDirectory, String group, IDownloadNotification
notification, DownloadOptions options)
at System.Deployment.Application.ApplicationActivator.DownloadApplication(SubscriptionState subState, ActivationDescription actDesc, Int64 transactionId, TempDirectory& downloadTemp)
at System.Deployment.Application.ApplicationActivator.InstallApplication(SubscriptionState& subState, ActivationDescription actDesc)
at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
COMPONENT STORE TRANSACTION DETAILS
No transaction information is available.Hi DMcGarveyt,
This is an known issue in SSRS 2008 R2 SP3. For this issue, Microsoft has published an article addressing this issue. It is not planning to release a fix for this defect. But there's workarounds for this issue. Please refer to the link below:
Report Builder of SQL Server 2008 R2 Service Pack 3 does not launch.
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Migrate VS SSDT Reporting Project to SQL Server Report Builder?
In the past, I have developed SSRS reports using Visual Studio (BIDS/SSDT). Unfortunately, a company server migration has made it impossible for me to deploy my reporting projects using that devlopment environment, so it appears I have to resort to Report
Builder now.
I see that the SQL Server Reporting Services web app has an "Upload File" menu item. However, it's not clear to me how these would then be translated into a Report Builder project. I've heard that the SSRS project-building
capabilities of Visual Studio go considerably beynd those of the Report Builder in SQL Server.
What I'd like to know is: Can I develop a Reporting Services project in Visual Studio and then migrate it to Report Builder via upload? If so, what are the steps to accomplish this, and what, if any, are the drawbacks?
- Mark Z.Hi Mark Zudeck,
As per my understanding, you developed SSRS reports with report designer, now you could not deploy the reports to report manager, and you want to open the projects with report builder. If that is the case, please refer to the following steps:
On the Start menu, click All Programs, and then click Microsoft SQL Server Report Builder.
To create a new report, click the SQL Server icon in the upper left-hand corner of Report Builder, and then click New.
To open an existing report stored on your local machine or a report server, click the SQL Server icon in the upper left-hand corner, and then click Open.
If you don’t see the report server in the list of existing servers, close the Open Report dialog box and then click Connect at the bottom of Report Builder to connect to the server.
For detail information about Report Builder, please refer to the following document:
https://msdn.microsoft.com/en-us/library/ms159221.aspx
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
If you have any feedback on our support, please click
here.
Wendy Fu
TechNet Community Support -
Report builder TfrmconfiguredHSDRS error
I am getting an error when I try to create a RDS Server on my laptop version of report builder. The error is in a pop up window and says: Object: TfrmconfiguredHSDRS Exception: List index out of bounds (2) See error log for stack trace.
I have uninstalled and reinstalled to no avail. I have a desktop running same op sys and CF versions and all is well. Compared the CF settings for RDS with the laptop and no difference.
Any idea what to do to get past this?
Thanks!
DaveHi nikp11,
According to your description, you recently updated SQL Server 2008 R2 to SP3, Report Builder doesn’t work since then the error occurs: "Application validation did not succeed. Unable to continue".
This is an known issue in SSRS 2008 R2 SP3 that Microsoft has published an article addressing this issue. It is not planning to release a fix for this issue. But we could implement one of the following workarounds:
Install and run Report Builder 3.0 of SQL Server 2008 R2 RTM.
Install and run Report Builder of SQL Server 2014.
Uninstall Service Pack 3 then uninstall Service Pack 2 and then reinstall Service Pack 3.
Reference:
Report Builder of SQL Server 2008 R2 Service Pack 3 does not launch
Thank you for your understanding.
Best Regards,
Wendy Fu -
Hi All,
I applied SQL server 2008 R2 SP3 recently but report builder doesn't work since then
When click on report builder gives error like 'Application validation did not succeed. Unable to continue.
and when I try to see details the error summary like following:
+File, Microsfot.ReportingServices.ComponentLibrary.Controls.dll, has a different computed hash than specified in manifest.
this is urgent.
Please reply me asap.
thanks a lot in advance.
Regards,
Nik
Regards, NamanHi nikp11,
According to your description, you recently updated SQL Server 2008 R2 to SP3, Report Builder doesn’t work since then the error occurs: "Application validation did not succeed. Unable to continue".
This is an known issue in SSRS 2008 R2 SP3 that Microsoft has published an article addressing this issue. It is not planning to release a fix for this issue. But we could implement one of the following workarounds:
Install and run Report Builder 3.0 of SQL Server 2008 R2 RTM.
Install and run Report Builder of SQL Server 2014.
Uninstall Service Pack 3 then uninstall Service Pack 2 and then reinstall Service Pack 3.
Reference:
Report Builder of SQL Server 2008 R2 Service Pack 3 does not launch
Thank you for your understanding.
Best Regards,
Wendy Fu
Maybe you are looking for
-
Required Creation of button using images.....
Hi, I have three images left , right and center and i hav to create my own commandButton using these images. The left image is single and no repeat is applied to it and as with the right image but the center image has a repeat property which repeats
-
Quick mask mode problem in Photoshop CS6 64bit
Hi, I have recently installed Photoshop CS6 after previous happy experience with CS3. The software appears to be seizing up when editing a selection in quick mask mode (image or layer mask) under the following conditions: - 64 bit mode - image > scre
-
Need help in AP module...
Hi Dears, I know the functionally Oracle 11i (11.5.10.2) PO module . I also work as a PO Functional in my organization. Now, I wish to learn to AP (payables) module functionally to complete the P2P cycle. Anyone can give me any link, document or manu
-
I have a run accross a problem when trying to manually mount cdroms. I have tried is xfce4's terminal and in straight command line. After doing su of course. # mount -t iso9660 -o ro /dev/cdrom0 /mnt/cdrom mount: wrong fs type, bad option, bad superb
-
I have a datagrid that is bound to an array collection. Is there a simpler way to modify the properties in the datagrid and have the datagrid change to reflect the changes.. This is my current code to alter on property and get the datagrid display to