Can i call a stored procedure from OracleDashboardPrompt?
Hi,
Can i call a stored procedure from OracleDashboardPrompt once i click the Go button in OBIEE?The input parameters to the procedure are the one that i have given in DashboardPrompt.and based on the result of the procedure(either 0 or 1),i have to display reports.Can anyone help me.
Thanks in Advance...
Please find below the possible approach to the scenario:
1.Create a prompt for the column which you need as input to store proc and create a presentation variable for that .
2.Create a dummy report with 1 column which will have the above created presentation variable as filter(We can design this reports in such a way like the first column will get filtered based on the presentation variable)
3.Create a second column and in the column definition we can add a code like
evaluate('StoreProc(%1)','@{firstcolumn}')
4.We can hide the first column in the report and only show the output of store proc to the end user
Hope this helps :)
Similar Messages
-
Can we call a stored procedure from a Trigger
Hello Everyone,
I need some help in writing the triggers in Oracle 10g Database.
Can we call a stored procedure from a trigger?Can we call a stored procedure from a trigger? Yes. Why did you think we couldn't?
Cheers, APC -
Can I call a stored procedure from EJB?
Hi,
Can I call a regular (non-Java) stored procedure from an enterprise Java bean? Transaction is managed by the ejb application server.
Thank you for your response.
CThi, i saw your question in the forum....have you got a response
since mars because i 've the same problem...
thanks in advance
cheers
jp -
Calling a stored procedure from within a ViewObject
Is it possible to make stored procedure call from within a BC4J ViewObject? Basically something like this:
select * from table(f1(3)); where f1 is a table function. Using Oracle's pipelined table functions?
If not, is it possible to call a stored procedure from Java and have the returned results be put back into a BC4J RowSet.
In addition, is there a way to create a JDBC Resultset from a BC4J RowSet?
We need to be able to dynamically create our SQL statements (the entire SQL, not just the where clause) but are required to have these sql statements generated/executed from within a pl/sql stored procedure in the database.Is it possible to make stored procedure call from within a BC4J ViewObject? Basically something like this:
select * from table(f1(3)); where f1 is a table function. Using Oracle's pipelined table functions?
Yes. Using our expert-mode query feature this is possible.
is it possible to call a stored procedure from Java and have the returned results be put back into a BC4J RowSet.
Yes. See this article about basing a view object on a REF CURSOR:
http://radio.weblogs.com/0118231/2003/03/03.html
In addition, is there a way to create a JDBC Resultset from a BC4J RowSet?
No. Not directly. What's the business requirement here so I can understand better?
We need to be able to dynamically create our SQL statements (the entire SQL, not just the where clause) but are required to have these sql statements generated/executed from within a pl/sql stored procedure in the database.
REF CURSOR would work fine, or if it's just the statement that needs to be generated dynamically, you could fetch the text of the SQL statement from the stored procedure, then use createViewObjectFromQueryStmt(). Although this has runtime overhead involved with describing the query.
The REF CURSOR based approach is probably best for this. -
Calling a stored procedure from a url
I am needing to call a stored procedure from a url string (or
anchor) understand that from training to be as follows:
http://host:port/pls/dad/package.procedure?query_string
With that in mind, I am getting an error as follows:
Not Found
The requested URL /pls/portal30/at_hrfm.checkshow.showcheck was
not found on this server.
Here is a sample of my url
http://servername:port/pls/portal30/at_hrfm.checkshow.showcheck
I can see servername:port/pls/portal30, it is just the
procedure I am having a problem with.
Here is a sample of my source code that is created under the
at_hrfm schema (I also tried under portal30 schema).
package body checkshow as
procedure showcheck as
begin
htp.htmlOpen;
htp.headOpen;
htp.title('My Check');
htp.comment ('This should be your Check');
htp.bodyOpen;
htp.header (1,'Check');
htp.print ('checkdate');
htp.bodyClose;
htp.headClose;
htp.htmlClose;
end;
end;I think I figured this out. I don't think the grant to ANONYMOUS is going to work with production XE and the online documentation is in need of an update. It appears that production XE has been locked down and you will need to specify the name of each stored procedure you wish to allow to be executed by adding it to the WWV_FLOW_EPG_INCLUDE_MOD_LOCAL function. This is spelled out in more technical detail here: http://download.oracle.com/docs/cd/B25329_01/doc/appdev.102/b25309/adm_wrkspc.htm#BEJCGJFJ
Another alternative that would work involves creating a separate DAD. Using the DAD approach with my schema made all of my stored procedures callable from a web browser, so I rejected this approach. To make this usable (secure) I would have needed to create and maintain a separate database user for the DAD and then only granted it execute for the stored procedures I wanted to be callable from a URL.
Finally I read about using an on-demand procedure and having it invoke the desired stored procedure. While I didn't try this out, it sounds like another good approach because it maintains session security. If it can be used to return an image I do not know.
- Jim -
Calling Oracle Stored Procedure from BC4J JSP App
I am on an extremely tight deadline and am trying to get my JSP application to use an Oracle Stored Procedure. I need to take some input from the user and send these values as parameters. Has anyone worked with Stored Procedures in JDev3.1? Please reply with some sample code if possible.
Thanks.Hi,
Someone posted a similar request the other day. Here is my response to them:
Basically, you need to create a custom method from your JSP's ViewObject, which calls the stored procedure. You can then call the ViewObject's custom method from the JSP client.
Here is how I have done it:
1. Choose the ViewObject that your JSP is based on and choose 'Edit' from the context menu.
2. On the Java tab of the ViewObject wizard, choose Generate Java File checkbox for the View Object Class and click the Finish button. A file is created under the ViewObject node in the Navigator named 'viewobjectImpl.java'.
3. Open the viewobjectImpl.java file in the code editor and create a method to call your stored procedure (see sample code below).
4. Compile the VOImpl.java file.
5. Choose the view object again, and choose Edit again from the context menu.
6. On the Client Methods tab, you should now see your method appear in the Available field. Select it and shuttle it to the Selected field.
7. Click Finish to leave the VO wizard, and rebuild your Business Components project.
8. In your JSP, call the custom method (see sample code below).
sample code for custom method calling a stored procedure from VOImpl.java file:
public int getTotalHits(String mon, String year) {
CallableStatement stmt = null;
int total;
// the call to the PL/SQL stored proc
String totalhits = "{? = call walkthru.total_hits(?,?)}";
// use the AM conxn 2 call storedproc
stmt = getDBTransaction().createCallableStatement(totalhits, 1);
try
// Bind the Statement Parameters and //Execute this Statement
stmt.registerOutParameter(1,Types.INTEGER);
stmt.setString(2,mon); stmt.setString(3,year);
stmt.execute();
total = stmt.getInt(1);
catch (Exception ex)
throw new oracle.jbo.JboException(ex);
finally
try
stmt.close();
catch (Exception nex)
return total;
sample render code for calling custom method from JSP custom bean:
public void render() {
int totalhits;
try
Row[] rows;
// Retrieve all records by default, the qView variable is defined in the base class
qView.setRangeSize(-1);
qView.first();
rows = qView.getAllRowsInRange();
// instantiate a view object for our exported method
// and call the stored procedure to get the total
ViewObject vo = qView.getViewObject();
wtQueryView theView = (wtQueryView) vo;
totalhits = theView.getTotalHits(session.getValue("m").toString(),session.getValue("y").toString());
out.println(totalhits);
} catch(Exception ex)
throw new RuntimeException(ex.getMessage());
} -
Calling packaged stored procedure from Java
Hi All,
I'm trying to call a stored procedure from Java but I'm having
problems with registrating the output parameter. I'm getting
the error: Conflicting parameters.: sqltype=2003
This is the stored procedure which is located in a package in
the Oracle database:
package Pack_GetAgencyInformation as
Type InfoType is record ( agen_code varchar(3), agen_designation
varchar(30), agen_adresse varchar(60), agen_tel varchar(12) );
function GetAgencyInformation( P_AGENCE VARCHAR )
return Pack_GetAgencyInformation.InfoType
end Pack_GetAgencyInformation;
This is the Java source from where I'm calling the procedure:
//DriverManager.registerDriver (new
oracle.jdbc.driver.OracleDriver());
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection
("jdbc:oracle:thin:@164.48.69.125:1521:ventes", "system", "*****
// @machineName:port:SID,
userid, password
CallableStatement cs = conn.prepareCall("{ ? = call
Pack_GetAgencyInformation.GetAgencyInformation( ? )}");
try {
cs.registerOutParameter( 1,
oracle.jdbc.driver.OracleTypes.ARRAY);
} catch (SQLException e) {
e.printStackTrace();
cs.setString(2, "001" );
//ResultSet rset = cs.executeQuery();
The stacktrace:
java.sql.SQLException: Parametertypen conflicteren.:
sqlType=2003
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:168)
at oracle.jdbc.dbaccess.DBError.throwSqlException
(DBError.java:210)
at
oracle.jdbc.driver.OracleCallableStatement.registerOutParameter
(OracleCallableStatement.java:220)
at
oracle.jdbc.driver.OracleCallableStatement.registerOutParameter
(OracleCallableStatement.java:350)
at dbAccess.main(dbAccess.java:25)
I think it has to do with the type InfoType which is created in
the Stored Procedure. I'm absolute no Oracle expert and I
prefer not to make changes to the Oracle database. So any
solution in Java is welcome!
BR, H.RietmanI managed to get it to work only by changing the stored
procedure. I have changed the return type record to a Ref
Cursor type (had to change alot of code for this). It seams
that Oracle JDBC drivers DON'T support the Record type as a
return type.
So the next question is: is it possible to typecast a record
type to a ref cursor type in Oracle. In this way I can easily
change the return type for the stored procedures.
/Harald -
How to call a stored procedure from WorkShop
Hello Everyone .. I'm quite new with WebLogic 8.1 & WorkShop, so please bare with
me .. Today I'm simply trying to find out how to call a stored procedure from
within workshop, using any of the DB Controls .. I see workshop provides a way
create a Java Control, Rowset Control, but it wont easily allow for a stored procedured
to be entered in place of the inline query .. Perhaps I've over looked it. Any
advise on the best way to tackle this task will be appreciated.
AtahualpaAtahualpa--
Maybe this will help:
http://edocs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/database/conStoredProcedures.html
Eddie
Atahualpa wrote:
Hello Everyone .. I'm quite new with WebLogic 8.1 & WorkShop, so please bare with
me .. Today I'm simply trying to find out how to call a stored procedure from
within workshop, using any of the DB Controls .. I see workshop provides a way
create a Java Control, Rowset Control, but it wont easily allow for a stored procedured
to be entered in place of the inline query .. Perhaps I've over looked it. Any
advise on the best way to tackle this task will be appreciated.
Atahualpa -
Calling Oracle Stored Procedure from Weblogic.
Hi All,
I am using Oracle 11g R2 and weblogic 10.3.5.0
Do you know if it is possible to call a stored procedure from Weblogic.
Basically, what I would like to do is to call the following procedure : EXEC DBMS_SESSION.SET_IDENTIFIER('provider_a') when my application connects to my database, "provider_a" being the user used to connect to the oracle schema.
Thanks.Up !
Thanks. -
Calling invalid stored procedure from java
Will the stored procedure which is invalid get re-compiled automatically when called from a java program?
1.a stored procedure is invalid (oracle 9i)
2.calling the stored procedure from a java program
3.what will happen a.oracle recompiles the stored procedure
b.returns an sql exception
what happens,kindly help
drop your mail to [email protected]
Keep Smiling and Mailing,
Vijay Anand Natesan.thank you ..Kindly let me know if any of your friends have tried this
-
Calling a stored procedure from Reports
I am trying to call a stored procedure using oracle reports in the afterparameter code. My code is:
v_ain := sp_get_ain(:P_session_id);
Can someone help me out by telling what is wrong. I keep getting an error stating that sp_get_ain needs to be declared.?!I am creating a function and a stored procedure and calling them
in afterparameter report trigger.
-------------------Create function ----------------
create or replace function get_name( emp_id number) return varchar2 is
v_name varchar2(20);
begin
select name into v_name
from sample_table
where employ_id = emp_id ;
return(v_name); ---------This is the way to return value from function.
exception
when no_data_found then
return('Name not found.');
when others then
return('Other error found.');
end ;
==================================================================================
------------------------Create procedure ------------------------------------
create or replace procedure get_name( emp_id number, return_name out varchar2) is
v_name varchar2(20);
begin
select name into v_name
from sample_table
where employ_id = emp_id ;
return_name := v_name ; --Assign out parameter value from procedure.
exception
when no_data_found then
return_name := 'Name not found.';
when others then
return_name := 'Other error found.';
end ;
============================================================================
-----------------Call function and procedure from report ---------------------
In formula column or any report trigger you can use this code.
v_function_return_name varchar2(20);
v_procedure_return_name varchar2(20);
v_employ_id number(10);
begin
v_employ_id := 101 ;
v_function_return_name := get_name(v_employ_id ); --- call function
get_name(v_employ_id , v_procedure_return_name ); -- call procedure
end;
Here v_function_return_name has same value as v_procedure_return_name,
these are the values returned from function and procedure.
--Anita -
Can we call a stored procedure in a select statement
Hi All
I want to call a stored procedure inside a select statement is this possible.
Regards
SravzYou can create a pipelined function which gathers the data from your stored procedure and then use that in a select statement or directly write your script in any function or pipelined function. ;)
There is no way you can call any stored procedure in a SELECT statement directly - i guess.
Regards.
Satyaki De. -
How to call multiple stored procedure from same DB Adapter
Hi,
I want to invoke 3 stored procedures from my message flow in BUS . I created a DB adapter and invoked 1 successfully . Now I don't to configure 2 other DB adapters for calling other 2 stored procedures . I want some how to be able to call the other 2 from the first DB adapter only . Somehow I need the flexibility to have procedure names as the operation names in 1 wsdl and be able to configure this in JDeveloper for this at time of DB adapter configuration . I am using 11G . Is it possible ?You can probably create a DB adapter with operation type selected as Execute Pure SQL and write SQL code to invoke the stored procedures depending on the procedure name (which you can get as one of the parameters of DB Adapter).
However, Even if you were able to do it, the DB Adapter schemas are generated based on stored procedure parameter list and types. If you use Execute Pure SQL type of DB Adapter the schema will be generated based on the parameters which you are using in your custom SQL code within DB Adapter. Which means that if you want to add a new stored procedure as target which has a different name and different parameters then you will need to regenerate the DB adapter and update your custom SQL code. This also means that you will need to do regression testing interfaces to all stored procedures whenever there is any change in this DBAdapter.
Now, my question is why do you want to invoke multiple stored procedures from same DB adapter?
This is not a good way to design integration solutions and makes your services resistance to change as it will take more time to change and test.
If all that you want is to have a web service which can have different operations for different stored procedures then you should create three business services and create a wrapper proxy service which has one operation for each stored procedure, within the proxy transform and call the correct backend service (you can use operational branch). This way you have a modular code where each module (read interface to one stored procedure) can be independently modified and tested. -
Calling PLSQL Stored Procedure From HTML Form Submit Button
Hi there,
I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work.
Lets call them class_number, term, conf These three variables will be passed and the data will be deleted and the person will see a confirmation screen once the delete query has been executed.
So ideally I would want: ZWGKERCF.P_confdelete(class_number, term, conf) and then the stored procedure would handle the rest!
Seems pretty simple but I am not sure how to make this happen... My thoughts were:
Pass the data to this html form (the three fields I need) in hidden variables. Then somehow pass these using POST method to the procedure and read using GET?
Can someone clarify what the best way to do this is? I have a feeling its something small I am missing - but I would really like some expert insight :-)
Thanks so much in advance!
- Jeff795018 wrote:
I am having a little difficulty with calling a stored procedure using an html form button. Here is the code I have right now...
HTP.PRINT('<form action=ZWGKERCF.P_confdelete>');
HTP.PRINT('<input type=''submit'' value='' Yes '' onClick=''document.getElementById("mypopup").style.display="none"''>');
HTP.PRINT('</form></div>');Here is the issue - I need to find a way to pass variables to this stored procedure so it know what data to operate on. This stored procedure will delete data for a specific database record and I must pass three variables to this procedure to make it work. The browser generates a POST or a GET for that form action, that includes all the fields defined in that form. Let's say you define HTML text input fields name and surname for the form. The URL generated for that form's submission will be:
http://../ZWGKERCF.P_confdelete?name=value1&surname=value2The browser therefore submits the values of the form as part of the URL.
The web server receives this. It sees that the base URL (aka location) is serviced by Oracle's mod_plsql. It passes the URL to this module. This module builds a PL/SQL block and makes the call to Oracle. If we ignore the additional calls it makes (setting up an OWA environment for that Oracle session), this is how the call to Oracle basically looks like:
begin
ZWGKERCF.P_confdelete( name=> :value1, surname => :value2 );
end;Thus the PL/SQL web enabled procedure gets all the input fields from the HTML form, via its parameter signature. As you can define parameter values with defaults, you can support variable parameter calls. For example, let's say our procedure also have a birthDate parameter that is default null. The above call will still work (from a HTML form that does not have a date field). And so will the following URL and call that includes a birth date:
URL:
http://../ZWGKERCF.P_confdelete?name=value1&surname=value2&birthdate=2000/01/01
PL/SQL call:
begin
ZWGKERCF.P_confdelete( name=> :value1, surname => :value2, birthdate => :value3 );
end;There is also another call method you can use - the flexible 2 parameter interface. In this case the PL/SQL procedure name in the URL is suffixed with an exclamation mark. This instructs the mod_plsql module to put all input field names it received from the web browser into a string array. And put all the values for those fields in another string array. Then it calls your procedure with these arrays as input.
Your procedure therefore has a fixed parameter signature. Two parameters only. Both are string arrays.
The advantage of this method is that your procedure can dynamically deal with the web browser's input - any number of fields. The procedure's signature no longer needs to match the HTML form's signature.
You can also defined RESTful mod_plsql calls to PL/SQL. In which case the call format from the web browser looks different and is handled differently by mod_plsql.
All this (and more) is detailed in the Oracle manuals dealing with mod_plsql - have a search via http://tahiti.oracle.com (Oracle Documentation Portal) for the relevant manuals for the Oracle version you are using.
Alternatively, simply download and install Oracle Apex (Application Express). This is a web development and run-time framework and do all the complexities for you - including web state management, optimistic locking, security and so on. -
Calling Remote Stored Procedure from Pocket PC
Hi all,
I have finished building an application based on IBM's SMF framework which conforms to the OSGI standards. Currently, I am having a problem with connecting to the main server DB which resides on a Websphere server. Basically, user will enter information on their pocket pc and then save it to a local DB2e database. I thought about going with the synchronization solution with the DB2 Sync server, but really all the user is trying to do is updating records in the main server database tables and there's really no need to sync anything back from the server to the pocket pc. So, I m thinking maybe I should try to invoke a stored procedure that resides on the main DB server from my device, passing in parameters through a WLAN connection.
My question now is:
1. user should be connecting through a WLAN connection and my company have set up a login that prompts the user to login everytime they try to access anything on the server. It won't be nice if the user will hv to do that every single time. Is there a way that I can log the user in programmatically so they do not have to do it with a separate log in window?
2. Is calling a remote stored procedure a bad idea?
3. If the network goes down, then there's no way the users can update anything to the main server DB. So, the changes will be saved locally and once the network goes back up, the user should be able to update those changes back to the server. I am just wondering if it's bad to do a loop and send those updates to the server by calling the stored procedures repeatedly passing in diff. parameters? what safeguards do I need to put in? like what exceptions should I expect to catch? also, I would like to be able to track those updates that failed, how do I do that?
Any help will be appreciated. I tried to find resources online, but to no avail. I am not sure if I am overly complicated things. Please advice! Thanks alot everyone!The error message is:
ORA-04067: not executed, stored procedure "schema.P$PROC@remote_db" does not exist
Maybe you are looking for
-
HT6154 Having SERIOUS problems with iOS 7.1 on my iPhone 4S!!!!
I am having SERIOUS problems here. Let me give you a rundown: I have to reboot my phone (or turn it off and on again) to see the correct battery percentage (but I'll address that in a second), and once I reboot it or bring it back up again, it has to
-
Is there a way to recover deleted video files from the finder folder
I recently and mistakenly deleted video files that were in my Finder folder,don't know why they were in there but that's another question, in doing this it also deleted them from IMovie and I have lost them unless someone out there know's different,
-
HP ENVY 4500 Printer "Error. Cannot connect to Server"
Hey everybody, I work in IT and have a client that recently purchased a HP Envy 4500 all-in-one. She called me to install it for her and I got it set up with no problems. After a few days she told me that her printer wouldn't scan. It was giving her
-
Is it possible to read native encodings without using native2ascii
Hi All, I have a text file containing japanese characters saved in a UTF8 format. I can read this into my java application after converting it using the native2ascii tool. However i'm wondering whether i can read this directly into my java applicatio
-
Which iView should be used for displaying XML forms?
Hi All, I have created 3 xml forms. 1.Edit form 2.RenderList form 3.Show form So How do I embedd them into iViews? Thanks in advance, Jasmine.