How to call discoverviewer in PL/SQL?
Hi friends,
Because discover can not meet our business need,So,I build a Concurrent Program which invoke PL/SQL code for preparing datas in table xx_datas.
This table has a column REQUEST_ID,so,all the datas in this request will share the same request_id.The user can choice request_id using a selectbox in the discoverviewer,however,this method is not good for users must do 2 steps.
So,if the pl/sql can invoke discoverviewer and pass parameter to it,it will help me.
Out of curiosity, what is the PL/SQL routine doing (or what is the business need that Discoverer can not meet)?
From your description, it sounds like you are preprocessing data, then accessing that data with Viewer. Depending on the preprocessing/business need, there may be a creative solution that one of the other readers has hit upon.
I can think of a few ways to have pl/sql invoke Viewer, but they are not trivial to implement.
Similar Messages
-
Need urgent help - how to call a procedure from sql returning a rowset
Hello,
I need to send a SQL Query from a VB application to let it execute on the oracle DB. This query needs to call a procedure/function, which returns a resultsets, so that i can to a (Where x in ( <call procedure> )). Would result in Where x in (50,100,3094).
Is this possible in oracle, and how?
Thanks.
Daniel MeyerHi Daniel,
I had a similiar problem yesterday.
Thanks to the nice people in this forum I was able to figured that out.
So here is a PL/SQL Oracle 9i code for your reference.
You can create and test it using the SQL Plus console.
I used this stored procedure in my VB .NET and worked fine!
I am enclosing the VB code in this reply as well.
One last note: in order to test it in the VS .NET, don't forget to download the Oracle ODP driver for .NET
Good luck!
Amintas
create or replace package pkg_emp
AS
type rc_emp is ref cursor;
end;
create or replace
procedure SP_GetEmpData(v_empno IN emp.empno%Type,
v_ename IN emp.ename%Type,
emp_cur OUT pkg_emp.rc_emp)
is
begin
if v_empno is not null and v_ename is null then
OPEN emp_cur for
select empno,ename,sal
from emp
where empno=v_empno;
elsif v_ename is not null and v_empno is null then
OPEN emp_cur for
select empno,ename,sal
from emp
where ename like v_ename ||'%';
end if;
end;
/* Testing the stored procedure */
/*#1 */
var myresultset refcursor;
execute SP_GetEmpData(7900,null,:myresultset);
print myresultset;
/*#2 */
var myresultset refcursor;
execute SP_GetEmpData(null,'A',:myresultset);
print myresultset;
-x-x-x-x-x-x-x-x-x VB .NET CODE x-x-x-x-x-x-x-xx-x-
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProcurar.Click
Dim dr As Oracle.DataAccess.Client.OracleDataReader
Try
If txtEmpNo.Text <> "" Then
dr = GetData(CInt(Val(txtEmpNo.Text)), "")
Else
dr = GetData(0, UCase(txtEname.Text))
End If
txtEmpNo.Text = ""
txtEname.Text = ""
Catch ex As Exception
Response.Write(ex)
End Try
drgTest.DataSource = dr
drgTest.DataBind()
End Sub
Private Function GetData(ByVal v_empno As Integer, ByVal v_ename As String) As Oracle.DataAccess.Client.OracleDataReader
Dim cn As New Oracle.DataAccess.Client.OracleConnection(ConfigurationSettings.AppSettings("ConnectionString"))
Dim cmd As New Oracle.DataAccess.Client.OracleCommand
Dim dr As Oracle.DataAccess.Client.OracleDataReader
cmd.Connection = cn
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "SP_GetEmpData"
cmd.Parameters.Add("v_empno", Oracle.DataAccess.Client.OracleDbType.Int32).Value = IIf(v_empno = 0, System.DBNull.Value, v_empno)
cmd.Parameters.Add("v_ename", Oracle.DataAccess.Client.OracleDbType.Varchar2, 40).Value = IIf(v_ename = "", System.DBNull.Value, v_ename)
cmd.Parameters.Add("rc_emp", Oracle.DataAccess.Client.OracleDbType.RefCursor).Direction = ParameterDirection.Output
Try
cn.Open()
dr = cmd.ExecuteReader(CommandBehavior.CloseConnection)
Catch ex As Exception
Throw ex
Exit Function
End Try
Return dr
End Function -
How to Call a Procedure from SQL ?
Hi All,
I've a procedure defined like the below taking IN/OUT parameters as table type.
PROCEDURE "SAP_HANA_DEMO"."usersCreateMethod" (IN row "SAP_HANA_DEMO"."User.Details",
OUT error "SAP_HANA_DEMO"."EPM.Procedures.tt_errors")
Now, how do i call it from SQL ?
I'm trying to call it like
CALL "SAP_HANA_DEMO"."usersCreateMethod"('my_global_table','?');
It says
Could not execute 'CALL "SAP_HANA_DEMO"."sap.hana.democontent.epm.Procedures::usersCreateMethod"('my_global_table','?')'
SAP DBTech JDBC: [1288]: expression cannot be used as an assignment target: '?': line 1 col 97 (at pos 96)
Thanks & Regards
SakthivelHi ,
You should call like this
Define a variable of your table type.
Define ErrorMessage SAP_HANA_DEMO"."EPM.Procedures.tt_errors"
CALL "SAP_HANA_DEMO"."usersCreateMethod"('my_global_table',ErrorMessage);
Regards,
Krishna Tangudu -
Hi all, i have the following function..........
create or replace function proj_budget_importance
(p_budget in NUMBER)
RETURN VARCHAR2
IS proj_importance NUMBER (8,2);
BEGIN
IF p_budget > 250000 THEN
proj_importance := 'High';
ELSIF p_budget <250000 THEN
proj_importance := 'Normal';
END IF;
RETURN proj_importance;
END;
but i dont know how to call it in the sql query :-(
SELECT proj_id,
proj_name,
proj_budget,
proj_ou_id,
proj_budget_importance???????????
FROM project;
can someone show me please TA!!Your function is invalid:
proj_importance NUMBER (8,2);
BEGIN
IF p_budget > 250000 THEN
proj_importance := 'High';
ELSIF p_budget <250000 THEN
proj_importance := 'Normal';
END IF;
RETURN proj_importance;
END;
and never run :).
create or replace function proj_budget_importance
(p_budget in NUMBER)
RETURN VARCHAR2
IS proj_importance Varchar2(32);
BEGIN
IF p_budget > 250000 THEN
proj_importance := 'High';
ELSIF p_budget <250000 THEN
proj_importance := 'Normal';
END IF;
RETURN proj_importance;
END;
select proj_budget_importance(100000) from dual;
'Normal' -
How to call a SQL function from an XSL expression
Hi
In R12, in Payroll Deposit adivce/Check writer, We need to sort the earnings tag <AC_Earnings> in to two different categories as regular and other earnings. In the DB and form level of element defintiion we have a DFF which differentiates between the two kinds of earnings. But the seeded XML that is gerneated by the check writer does not have this field.
The seeded template displays all the earnings in one column. How can we achieve this in the template without modifying the seeded XML.
The one approach i have is to write a function and based on the return value sort the data. For this I need to know :
1) How to call a SQL function from an XSL expression that is allowed in BI template.
If anyone ahs faced similar requirements please share your approach.
Thanks
SrimathiThank u..
but i'd seen that link wen i searched in google..
Is it possible without using any 3rd party JARs and all?
and more importantly plz tell me what should be preferred way to call a javascript function?
Do it using addLoadEvent() or Windows.Load etc
OR
Call it thru Xsl? (I donno how to do dis)
Thanks in Advance..
Edited by: ranjjose on Jun 3, 2008 8:21 AM -
How to call javascript function from PL/SQL procedure
Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?
Hi,
I have a requirement to call Javascript function inside a After Submit Process.
clear requirement below:
1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
2. user clicks on "save files" button
3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
Hope this clarify U.
Krishna. -
How to call a sql stored procedure in java...... HELP
Hi I am making an application for taking backup in sql automatically so i have created a dts package which is called by a stored procedure. Now the problem is that how to call that stored procedure in a Java program so that after running my java program i get my database backup.
Please please solve my problem.
thanks in advance.
If possible please send the code.
Message was edited by:
Andy_Davis
Message was edited by:
Andy_DavisHi... I am trying to create a dts package which is called by a stored procedure... How can i do this? IF possible can you please send me the code as well..
Thanks a ton...
Susan_Davis -
How to call pl/sql stored procedure in JDBC query dialogbox
Hi,
how to call pl/sql stored procedure in JDBC query dialogbox(reports 9i) .
Cheers,
Raghuplease refer : Re: problem If you have more doubts, please ask in that question.
-
How to call PL-SQL/stored procedure in Creator
Anybody can tell how to call PL-SQL/Stored procedures inside creator...
Hi!!!
You can see this topic http://forum.sun.com/jive/thread.jspa?threadID=106046
There is how to call oracle stored procedures. Also I put a lot of links in these topic doing reference stored procedures. I have one that it tells specially how to call oracle stored procedures from java, is in spanish but you can understand the code.;-)
http://yoprogramador.vampisol.com/index.php?title=pl_sql_oracle_desde_java&more=1&c=1&tb=1&pb=1
Byeee -
How to call pl/sql procedure/function from XML
Hi,
I have a requirement to call pl/sql function/procedure from the RTF template. How can I do this?Hi,
I have got the same requirement. We need to call the store PL/SQL procedure from the XML template to generate the fixedwidth files. Could you tell me if you are able to call PL/SQL procedure from XML template?
Thanks,
Ram -
How to call PL/SQL procedure from PERL
I have a requirement to create a PERL wrapper for few PL/SQL procedure.
Can any one tell me how to call the procedures from PERL ?
Thanks in advance.
....sriniA quick Google search shows:
http://www.saturn5.com/~jwb/dbi-examples.html#ora_sp -
How to call PL/SQL function in processRequest
Hi,
I am trying to execute a function called xxhr_trg_evaluation_pkg.xx_get_class_desc(1);
how i can execute the above function inside the processRequest and pass the return value into a String variable.
Thanks in advance
Regards....AshrafAshraf,
The following code will help you how to call function or procedure in processRequest.
processRequest Code:
public void processRequest(OAPageContext pageContext, OAWebBean webBean){
OAApplicationModule oaam = pageContext.getApplicationModule(webBean);
OADBTransaction dbtrans;
OADBTransaction txn = (OADBTransaction)oaam.getOADBTransaction();
//statement which have similar execute statement like pl/sql in toad
CallableStatement cs =txn.createCallableStatement("begin :1:=xxhr_trg_evaluation_pkg.xx_get_class_desc(:2);end;",0);
//variable going to hold the return value
String outputVal="";
//pass input value to the callable statement
try{
cs.setString(2,1+"");
catch(Exception e){
try{
cs.execute();
outputVal=cs.getString(1);
catch(Exception e){
try{
cs.close();
catch(Exception e){
//if have done any update/insert/etc means do the commit from here also else you haven't given commit in the function by using the following syntax
dbtrans.commit();
Thanks,
SAN -
How to call SQL Script in DBMS_SCHEDULER
How to call SQL Scripts in DBMS_SCHEDULER?
Things I got working
1) Successfully created and tested a PL/SQL that was created under SQL Workshop->SQL Scripts (I named it 'TEST'). I was able to run this no problem.
2) Successfully created a DBMS_SCHEDULER that runs every minutes. (See below)
begin
dbms_scheduler.create_job(
job_name => 'myjob',
job_type => 'plsql_block',
job_action => 'null;',
start_date => '19-JUL-11 03.10.00 PM', /* Remember to use the DB time, not your local time if not specifying a timezone */
repeat_interval => 'freq=minutely',
enabled => true);
end;The problem i am having is to make the PL/SQL script (named 'TEST') runs every minute. Its probably very easy to do that but i dont seems like finding any examples online.
I tried replacing the job_action attribute to " job_action => 'begin TEST; END;', " However, that did not work.
I am stuck here for couple hours already, any clues would be great :)
Thanks in advance
John
Application Express 4.1.0.00.32
Edited by: John Lau on Aug 14, 2012 12:47 PM
Edited by: John Lau on Aug 14, 2012 12:48 PMThe PL/SQL is pretty long, I would like to call it from a different location rather then putting the whole coding as part of the argument. Sounds like I should be looking into procedure package in database?
I will do some more research on procedure package, how to create one and how to call from it.
Thanks
John -
How to call a sql server stored procedure from oracle
Hi all,
Please anybody tell me how to call a sql server stored procedure from oracle.
I've made an hsodbc connection and i can do insert, update, fetch data in sql server from oracle. But calling SP gives error. when I tried an SP at oracle that has line like
"dbo"."CreateReceipt"@hsa
where CreateReceipt is the SP of sql server and hsa is the DSN, it gives the error that "dbo"."CreateReceipt" should be declared.
my database version is 10g
Please help me how can i call it... I need to pass some parameters too to the SP
thanking youhi,
thank you for the response.
when i call the sp using DBMS_HS_PASSTHROUGH, without parameters it works successfully, but with parameters it gives the following error
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Generic Connectivity Using ODBC][Microsoft][ODBC SQL Server Driver]Invalid parameter number[Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index (SQL State: S1093; SQL Code: 0)
my code is,
declare
c INTEGER;
nr INTEGER;
begin
c := DBMS_HS_PASSTHROUGH.OPEN_CURSOR@hsa;
DBMS_HS_PASSTHROUGH.PARSE@hsa(c, 'Create_Receipt(?,?)');
DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,1,'abc');
DBMS_HS_PASSTHROUGH.BIND_VARIABLE@hsa(c,2,'xyz');
nr:=DBMS_HS_PASSTHROUGH.EXECUTE_NON_QUERY@hsa(c);
DBMS_HS_PASSTHROUGH.CLOSE_CURSOR@hsa(c);
end;
Create_Receipt is the sp which requires two parameters.
please give me a solution
thanking you
sreejith -
How to call a procedure in place of a SQL
Hi
Can any one tell me how to call a procedure in place of a SQL from Bi publisher
Thanks
Ranga
Edited by: user13274784 on Jul 22, 2010 9:47 AMOne way would be to use pipelined table functions. Call the procedure within a function and return data in the form of a table.
Search the forum.
Check this out: http://winrichman.blogspot.com/search/label/pipelined
http://bipublisher.blogspot.com/2007/09/plsql-taking-it-to-next-level.html
BI publisher to use Stored Procedure
Edited by: BIPuser on Jul 22, 2010 10:22 AM
Maybe you are looking for
-
HI Im really struggling with this!!!! I have my header set up and directly underneath I have a slideshow. I want to anchor my :contact me" page to come in just under the slideshow. I cant figure this out for the life ofe me. Any help will be greatful
-
I recently bought a new computer because my old one crashed. All that I have that is usable is the hard drive. Thank God. However, I cannot uninstall and deactivate my PS elements 11 from that computer to put in on my new one. I've call several numbe
-
When I have an event logged that I need to allow is it best practice to clone only the offending rule module and change the rules in that module as needed or should I also clone the policy and then clone the rules? This is new rollout just so you kno
-
Are there updates for photoshop elements 2.0 for Windows 7?
I want use my photoshop elements 2.0 on my Window s 7 computer. Are there updates for version 2.0?
-
Cannot start Elements - msg "Elements has stopped working"
THis is the detail: roblem signature: Problem Event Name: APPCRASH Application Name: Photoshop Elements 10.0.exe Application Version: 10.0.0.0 Application Timestamp: 4e70bafc Fault Module Name: S