I wrote a stored procedure in Oracle 11g. It has 4 input parameters and 60 output parameters. It executes successfully and returns output using GUI in Oracle SQL developer tool.
But problem is in SSRS I connect with Oracle as ODP.NET Data Source. Test connection succeeds in shared data set properties.
When I select the specific stored procedure and pass 4 input parameters which are VARCHAR2 Data types
it shows an error:
You have to use the output parameters as well when you call the procedure.
PS: I don't like the idea of having 60 output parameters. I'd use a record or a collection (or both).
Related
I need to use the stored procedure stage.
Currently I'm making just for an example for how to use it right.
CREATE OR REPLACE PROCEDURE "STG"."TRUNC_TEST"
AS
BEGIN
execute immediate 'truncate table TESTSP';
END;
That's my example of simple stored procedure.
My job design probably seen like this
Oracle Connector 1=>Transformer=>Oracle Connector 2=>Stored Procedure Stage
Oracle Connector 1 do Select, Oracle Connector 2 do Insert to TESTSP
My settings in the stored procedure stage
General : I've already put all the credential , with Transaction ISO as None
Syntax
Procedure Name : TRUNC_TEST
Procedure Type : Transform (i've also tried to change it to Target)
Database Procedure Type : Stored Procedure
Generate procedure call (checked)
Parameters
Empty
Error Codes
Empty
NLS Map
Project Default UTF-8
Advanced
Execution mode :Default(Sequential)
Combinability : Default
Configuration file : default
In the Input tabs
General
Execute Procedure for each row (checked)
Transaction size : 0
Partitioning
Collector type Auto
Columns
Just brought all the columns from Oracle connector 2
Advanced
Default
The job showing green line and success, but the SP isn't working. It should've been truncate the TESTSP table, but when I do a select *, the data is still there.
Maybe my stored procedure is wrong since I'm still learning how to make it? Or maybe there is something wrong with my 'Settings' in the stored procedure stage?
Every time you are running your job, you are just creating or replacing the SP definition.
You will have to call the SP in order to execute it.
That is the reason you are able to execute it outside.
I suggest you to create a generic SP in your database which will accept table name as parameter.
Once this is created, use SP stage to invoke the SP with column you want to truncate.
You can also use after SQL option in oracle connector to avoid extra SP stage.
I have a security procedure that has to be called just before a select from source table. Without this procedure no rows are returned.
The problem is that I have checked several ways to call this procedure just before Source Qualifier:
Pre-sql into the Source Qualifier As a Stored procedure
Pre-load source
Put several sql sentences in the sql query propertie in Source Qualifier (added 2014-11-08)
Always seems that Powercenter opens a new oracle connection, where security procedure takes no effect.
What could be the correct way to put both process together and use the same Oracle session?
Note added 2014-11-08:
I have tried also to put 2 sentences in the SQL Query of the Source Qualifier:
call procedure('param');
SELECT field1, field2, field.... from VI_ETL...;
and I get error ORA-24333 Zero Interaction Count, perharps because first item is not a SELECT statement that returns rows?
Try using SQL Query on Source Qualifier to invoke a series of statements - the security Stored Procedure being the first one.
I have several reports, and on each one of them i have a few tables included.
Lets say 3 tables, tableA, tableB and tableC.
I want to use the following Oracle Function to filter the result set passing also a report parameter:
AND function(tableB.field1, tableB.field2, tableB.field3, {?report_parameter}) = 'S'
Facts to be aware of:
Oracle Functions can only be used on SQL Expressions and/or SQL Commands in Crystal Reports.
SQL Expressions cannot contain report parameters (so, not an option).
Crystal Reports lets you replace a report table with a SQL Command, but does not let you replace several tables to a single SQL Command.
We do not want to re-build all the reports all over again.
We do not want to replace a single table to a SQL Command because it affects performance in a high level since Crystal does not transform the tables and the SQL Command on a single query when executing the report.
This Oracle Function selects data from other tables and therefore can not be rewritten on a Report Custom Function.
The {?report_parameter} is an information that only the application knows. It is filled by the application before exporting the report to the user.
What could I do to work around this?
No knowing exactly why your function requires tables and parameter, I can only give you vague, untested options. None of the options are ideal:
rewrite your Oracle function as 'Custom Function' (CF); reference CF in record-selection formula; filter will be applied WhileReadingRecords (i.e. the function will not be sent to the database)
rewrite your function as a stored procedure that accepts one parameter, but returns a record set (the parameter will be recognized by Crystal Reports); join the other tables to the stored procedure. The stored procedure will need to be written in a manner that will support Crystal Reports' data needs (using result from a stored procedure with parameters as value for gauge chart - crystal reports in asp.net application)
I have an oracle stored procedure that accepts a value list through ref cursor. This oracle database is set up as a Linked Server in a separate SQL Server 2008 instance.
How can I use this procedure from within SQL, passing a table, rows, or a table-valued parameter?
I know this question was asked long ago, but for people Googling and come across this post...
It sounds like you need to do a openquery.
This basically sends the 'select...' part (could be a stored procedure exec) command to the linked server and waits for the response.
SELECT * FROM OPENQUERY(Your_Linked_Server_Name , 'select * from TableName where RecordID = 4')
I had to change the SQL stored procedure to ORacle stored procddure.I am able to successfully execute my modified stored procedure in oracle.
But unable to obtain the query result in CF for the Oracle stored-Procedure.I have used <cfquery>.
Any suggestions or tips to for using an Oracle stored proc/CF-8?
Think you need cfstoredproc, not cfquery.
See manual page for more details.
It does really depend on how it reacts, i'd test your stored proc in oracle sql+plus first, to make sure it returns data, then try it via cfquery or stored procedure...