How to call a procedure from dynamic page?
I am trying to submit a form (dynamic page) to a procedure but keep getting the generic page not found error.
I have the following dynamic page (bind variable works properly):
<HTML>
<HEAD>
<TITLE>Example</TITLE>
</HEAD>
<BODY>
<oracle>
declare
v_job_id number := :job_id;
begin
htp.p(v_job_id);
htp.formOpen('http://mssdiscovery.ssc.nasa.gov:7777/pls/portal/portal_public.buy_off', 'post');
htp.formHidden('JOBID', v_job_id);
htp.formSubmit('submit', 'Buy Off');
htp.formClose;
end;
</oracle>
</BODY>
</HTML>
This form should submit to a procedure called "BUY_OFF", defined in the PORTAL_PUBLIC schema as follows:
Create or Replace PROCEDURE PORTAL_PUBLIC.BUY_OFF
(JOBID IN number)
as
begin
update portal_public.components_jobs_syn
set
status = 'COMPLETE'
where job_id = JOBID;
/* add code to redirect */
exception
when others then
null;
end;
I have granted PORTAL and PUBLIC execute privileges.
I have never been able to submit a form in a dynamic page to a procedure... it never works... someone please help me out! What am I missing?
Nevermind... I changed the submit button name from submit to NULL and it works fine now. I guess the name flipped it out for some reason.
Similar Messages
-
Calling a procedure from Dynamic Page
I am trying to call a procedure from a dynamic page. The procedure displays multi records from a table. I have created a procedure:
PROCEDURE process_student_request( p_primary_request in wwv_utl_api_types.vc_arr,
p_alternate_request in wwv_utl_api_types.vc_arr,
p_action in varchar2,
l_status in out varchar2);
When I hit the submit button on the dynamic page it does not execute the procedure and tries to open a new page. How do I get this to work?
Here is the text of the page:
<HTML>
<HEAD>
<TITLE>Example</TITLE>
</HEAD>
<BODY>
<FORM action="portal30.star_portal.process_student_requests" method="post">
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="2" CELLSPACING="0" class="RegionBorder">
<TR>
<TD valign="top" align="left" width="40%"><FONT class="PortletText1">
<ORACLE>declare
row_num number := 1;
hold_row_num number;
hold_class_cd stars3.req.class_cd%TYPE;
begin
for c1 in (select A.start_yy, A.school, A.student_id, A.class_cd, B.name from stars3.course B, stars3.req A
where A.student_id = portal30.star_portal.get_session_variable('STUDENT_ID') and A.start_yy = '01' and
A.alternate_no = '0' and
B.start_yy = A.start_yy and
B.school = A.school and
B.class_cd = A.class_cd)
loop
hold_class_cd := c1.class_cd;
htp.p(lpad(to_char(row_num),2,'0'));
htp.p('<select name="p_primary_request">');
htp.p('<option value="' || c1.class_cd|| '">' || c1.name || '</option>');
row_num := row_num + 1;
htp.p('<BR>');
end loop;
htp.p('<input type="submit" name="p_action">');
end;
</ORACLE>
</BODY>
</FORM>
</TD>
</TR>
</TABLE>
</HTML>Bob,
You have variables in your procedure like l_status, p_alternate_status which you do not have in the form. Are these IN or OUT variables ?
If these are IN variables, this proc will not work because you do not have any variable in the form. So from where does it get the values? There is not any default declared too. You have to explicitly define IN or OUT variables.
Have you also given execute permission to public ? -
How to call stored procedure from Pro*C
How to call stored procedure from Pro*C ?
my system spec is SuSE Linux 9.1, gcc version : 3.3.3, oracle : 10g
my Pro*C code is the following..
EXEC SQL EXECUTE
begin
test_procedure();
end;
END-EXEC;
the test_procedure() has a simple update statement. and it works well in SQL Plus consol. but in Pro*C, there is a precompile error.
will anybody help me what is the problem ??I'm in the process of moving C files (with embedded SQL, .PC files) from Unix to Linux. One program I was trying to compile had this piece of code that called an Oracle function (a standalone), which compiled on Unix, but gives errors on Linux:
EXEC SQL EXECUTE
BEGIN
:r_stat := TESTSPEC.WEATHER_CHECK();
END;
END-EXEC;
A call similar to this is in another .PC file which compiled on Linux with no problem. Here is what the ".lis" file had:
Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Error at line 193, column 5 in file weather_check.pc
193 BEGIN
193 ....1
193 PCC-S-02346, PL/SQL found semantic errors
Error at line 194, column 8 in file weather_check.pc
194 :r_stat := TESTSPEC.WEATHER_CHECK();
194 .......1
194 PLS-S-00000, Statement ignored
Error at line 194, column 18 in file weather_check.pc
194 :r_stat := TESTSPEC.WEATHER_CHECK();
194 .................1
194 PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
Pro*C/C++: Release 10.2.0.1.0 - Production on Mon Jun 12 09:26:08 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
System default option values taken from: /oracle_client/product/v10r2/precomp/ad
min/pcscfg.cfg
Error at line 194, column 18 in file weather_check.pc
:r_stat := TESTSPEC.WEATHER_CHECK();
.................1
PLS-S-00201, identifier 'TESTSPEC.WEATHER_CHECK' must be declared
Error at line 194, column 8 in file weather_check.pc
:r_stat := TESTSPEC.WEATHER_CHECK();
.......1
PLS-S-00000, Statement ignored
Semantic error at line 193, column 5, file weather_check.pc:
BEGIN
....1
PCC-S-02346, PL/SQL found semantic errors -
How to call stored procedures from EF 6.1.3
Hi
I need to create many reports and I wanna use SPs, with parameters, the question is how to use it from ntity Framework CodeFirst ? I am using EF 6.1.3
I 've found examples using EF but not EF CF, any sample please ?
thanks in advance
Salu2 Sergio TYou create a type to return and pass it as a type...
Like this:
http://stackoverflow.com/questions/20901419/how-to-call-stored-procedure-in-entity-framework-6-code-first
context.Database.SqlQuery<YourEntityType>("storedProcedureName",params);
ps
That was pretty easy to google, by the way.
And... it's not really wpf.
Shrug.
Hope that helps.
Recent Technet articles: Property List Editing;
Dynamic XAML -
How to call one procedure from another procedure
Hi all,
Could anyone give me clue how to call a procedure contains out parameters
from another procedure.
I had following procedures.
1)
create or replace procedure INS_PUR_ORDER
p_poamt in number,
p_podate in date,
p_poid out number
is
begin
select pkseq.nextval into p_poid from dual;
insert into pur_order(poamt,podate,poid)
values (p_poamt,p_podate,p_poid);
end;
2)
create or replace procedure INS_PUR_ORDER_DETAIL
p_pounits in number,
p_poddate in date,
p_poid in number)
is
begin
Insert into pur_order_detail(podid,pounits,poddate,poid)
values(pdseq.nextval,p_pounits,p_poddate,p_poid);
end;
I need to write a 3rd procedure which calls above two procedures.
like
call first procedure ,basing on the return value
i.e if p_poid != 0 then
we need to call second procedure
in the loop.
thanks in advance.
rampa.Not sure what are you doing, you can not assign cursor to another cursor, may be you are looking for this?
SQL> create or replace procedure proc1 ( result out sys_refcursor)
2 is
3
4 begin
5 open result for
6 select 'HELLO WORLD' from dual ;
7 end proc1 ;
8 /
Procedure created.
Elapsed: 00:00:00.01
SQL> create or replace procedure proc2
2 is
3 l_cursor sys_refcursor ;
4 begin
5 l_cursor := proc1 ;
6
7
8 open l_cursor;
9 fetch l_cursor into l_text;
10 dbms_output.put_line(l_text);
11 close l_cursor;
12
13
14 end proc2 ;
15 /
Warning: Procedure created with compilation errors.
Elapsed: 00:00:00.01
SQL> show error;
Errors for PROCEDURE PROC2:
LINE/COL ERROR
5/4 PL/SQL: Statement ignored
5/16 PLS-00306: wrong number or types of arguments
in call to 'PROC1'
6/4 PLS-00201: identifier 'L_TEXT' must be
declared
6/4 PL/SQL: Statement ignored
8/4 PLS-00382: expression is of wrong type
8/4 PL/SQL: SQL Statement ignored
9/4 PL/SQL: SQL Statement ignored
9/24 PLS-00201: identifier 'L_TEXT' must be
declared
10/4 PL/SQL: Statement ignored
10/25 PLS-00201: identifier 'L_TEXT' must be
declared
---- this is the correct waySQL>ed
1 create or replace procedure proc2
2 is
3 l_cursor sys_refcursor ;
4 l_text varchar2(100);
5 begin
---- procedure call
6 proc1(l_cursor);
7 -- open l_cursor;
8 fetch l_cursor into l_text;
9 dbms_output.put_line(l_text);
10 close l_cursor;
11* end proc2 ;
SQL> /
Procedure created.
Elapsed: 00:00:00.01
SQL> set serveroutput on
SQL> execute proc2;
HELLO WORLD
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
SQL> -
How to call a procedure from Shell Script
Friends,
How can i call a procedure from a shell script ? If any one know the answer , let me know immediately .
Thanks in advance .
ChakksWe connect using SQLPlus commands on the Unix server:-
Our code block is below:- We've got DBMS_OUTPUT in the procedure, hence the spooling. You don't need all this, but you do need the sqlplus directory, etc... in your profile.
sqlplus -s <<EOF > ${CREATE_LOG_FLE}
$UserName/$Password@$SID
SET SERVEROUTPUT ON SIZE 1000000;
spool ${CREATE_LOG_FLE}
EXECUTE $STORED_PROC(${Months}, ${DeleteRecords});
EOF
Hope that helps -
How to call a procedure from within another procedure?
What's the syntax to call a procedure from within a procedure.
I have a procedure z(user_id IN number, ....)
then
procedure a (user_id IN number, ....)
procedure b (user_id IN number, ....)
procedure c (user_id IN number, ....)
I want to call procedure a, b, c from inside procedure z.
How would I do that?Same way :
SCOTT@db102 SQL> create or replace procedure a (p1 in varchar2) is
2 begin
3 dbms_output.put_line (p1);
4* end;
SCOTT@db102 SQL> /
Procedure created.
SCOTT@db102 SQL> create or replace procedure z (par1 in number) is
2 begin
3 if par1 != 0 then
4 a ('This is proc a');
5 end if;
6* end;
SCOTT@db102 SQL> /
Procedure created.
SCOTT@db102 SQL> set serveroutput on
SCOTT@db102 SQL> exec z (1);
This is proc a
PL/SQL procedure successfully completed.
SCOTT@db102 SQL> -
How to call a procedure from url
hello,
I'd like to call a procedure from the url. <br>
I've tryed several ways to call that procedure, but none of it worked. <br><br>
so can someone please tell me the correct syntax of such a call?<br>
thanks in advance.Hi ,
I have implemented this in one of my apps in the following way:
- Created a database procedure (called download_file that accepts a parameter). This procedure opens a document stored in the database.
- In a report region, in the Column Link attributes, I set the Link Text to "Download", set Target to "URL" and set URL to "#OWNER#.download_file?p_file=#MYFIELD#"
Hope this helps. -
How to call stored procedure from postgresql to jsp
i'm using a jdeveloper.. and i'm a newbie of jsp.. i just wanna know how to call a stored procedure in jsp?... This is my function in postgres and i don't know how to call it in jsp...
SELECT * from SP_1('2006-01-11') as ( company_code char(5), branch_category char(5), branch_code char(15), day_sales numeric(19,2), month_to_date numeric(19,2), no_of_transaction int8, month_to_date_py numeric(19,2), year_to_date numeric(19,2), year_to_date_py numeric(19,2), remarks text, time_reported text );hi again.. i'm using jsp in jdeveloper, i just wanna know how to declare double in jsp because my module is report and i need to get the average daily sales = 4500/ no. of transaction = 3. This is my code.. Where will i put the code in declaring the double and the average daily sales? Thanks in advance..
<%@ page contentType="text/html;charset=windows-1252" import="java.sql.*,Connect.CRMCon"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>untitled</title>
</head>
<body>
<%
String ave = request.getParameter("ave_daily_sales");
double cashsales = Double.parseDouble(ave);
%>
<%
logparameters data = new logparameters();
data.txtbox = request.getParameter("txtbox");
%>
<table cellspacing="3" cellpadding="2" border="1" width="100%">
<tr>
<td width="5%" bgcolor="#cccccc" height="29">
<DIV align="center">Company Code</DIV>
</td>
<td width="4%" bgcolor="#cccccc" height="29">
<DIV align="center">Branch Category</DIV>
</td>
<td width="6%" bgcolor="#cccccc" height="29">
<DIV align="center">Branch Code</DIV>
</td>
<td width="8%" bgcolor="#cccccc" height="29">
<DIV align="center">Day Sales</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Month to Date</DIV>
</td>
<td width="5%" bgcolor="#cccccc" height="29">
<DIV align="center">No.of Transaction</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Month to Date(PY)</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Ave.Daily Sales to Date</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Year to Date</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Year to Date(PY)</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Remarks</DIV>
</td>
<td width="5%" bgcolor="#cccccc" height="29">
<DIV align="center">Time Reported</DIV>
</td>
</tr>
<%
try
CRMCon ccon = new CRMCon();
Connection con = ccon.getConnection();
String sql = "select * from sp_1('"+data.txtbox+"')";
// String sql = "SELECT * from SP_1('"+ request.getParameter("data.txtbox")+"')" ;
sql += " as (company_code char(5), branch_category char(5) ," ;
sql += "branch_code char(15) , day_sales numeric(19,2)," ;
sql += "month_to_date numeric(19,2), no_of_transaction int8," ;
sql += "month_to_date_py numeric(19,2), year_to_date numeric(19,2)," ;
sql += "year_to_date_py numeric(19,2), remarks text, time_reported text) " ;
//out.println(sql);
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(sql);
while (rs.next())
%>
<tr>
<td width="13%"> <%= rs.getString("company_code") %> </td>
<td width="63%"> <%= rs.getString("branch_category") %> </td>
<td width="24%"> <%= rs.getString("branch_code") %> </td>
<td width="24%"> <%= rs.getString("day_sales") %> </td>
<td width="24%"> <%= rs.getString("month_to_date") %> </td>
<td width="24%"> <%= rs.getString("no_of_transaction") %> </td>
<td width="24%"> <%= rs.getString("month_to_date_py") %> </td>
<td width="24%"> <%= rs.getString("year_to_date") %> </td>
<td width="24%"> <%= rs.getString("year_to_date_py") %> </td>
<td width="24%"> <%= rs.getString("remarks") %> </td>
<td width="24%"> <%= rs.getString("time_reported") %> </td>
</tr>
<%
catch (Exception ex)
out.println("Error:"+ex.getMessage());
%>
</table>
</body>
</html>
<%!
class logparameters
public String txtbox;
%> -
How to call RDF report from JSP page
Dear all,
I want to call a RDF report from JSP page. I am creating the JSP page using j developer 10G.
Can anyone help me out in this case. Is there any tag or procedure or any other way by of that i can perform this work.
please help and send the reply on [email protected],[email protected]
thanks
AshokHi Ashok,
You can use rwservlet - nothing really to do with JDeveloper. Once you have report server up and running (hint: read http://download-uk.oracle.com/docs/cd/B14099_19/bi.1012/b14048/toc.htm), you can call a report like this:
http://server:port/rwservlet?report=my_report.rdf&destype=cache&desformat=html&p_my_parameter=xxx etcHope this helps,
John -
How to call stored procedure in ASP pages
After I migragate MS SQL server database to Oracle 8i database, all the call to stored procedure in ASP has problems. I have been had a problem to find some document about how to call oracle stroed procedure from SQL*plus or using ADO. If anybody can help me to find any resource about it. or better give me some examples, that will be very helpful.
Thanks!
nullIf you have account on Metalink.
Please go there and do a search on ASP.
There you can find, how to call SP from
ASP.
If you have problem finding this let
me know.
I will try to find it -
How to call stored procedures from java program?
I have tried to run a program that calls a stored procedure on MySQL
server version 5.0.17 by using connector/j 5.0, but it always fails on the
statement: con.preparecall() ,
have looked on the internet and found out that people can all mysql
stored procedure all right in their programs, really dont know what's
wrong with this small peiece of code:
import java.sql.*;
public class TestDB {
// procedure being called is:
CREATE PROCEDURE `dbsaystorm`.`getsite` ()
BEGIN
select name from tblsite;
END
public static void main(String[] args) {
try {
//Class.forName("org.gjt.mm.mysql.Driver");
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/dbname",
"user", "pwd");
* executing SQL statement here gives perfect correct results:
// PreparedStatement ps = con.prepareStatement("select name from tblsite");
// ResultSet rs =ps.executeQuery();
// but in stored procedure way...
//it fails here on this prepare call statement:
CallableStatement proc = con.prepareCall("call getsite()");
ResultSet rs =proc.executeQuery();
if (rs == null) return;
while (rs.next()){
System.out.println("site name is: "+ rs.getString(1));
rs.close();
} catch (SQLException e) {e.printStackTrace();}
catch (Exception e) {e.printStackTrace();}
}it always gives this exception:
java.lang.NullPointerException
at com.mysql.jdbc.StringUtils.indexOfIgnoreCaseRespectQuotes(StringUtils.java:959)
at com.mysql.jdbc.DatabaseMetaData.getCallStmtParameterTypes(DatabaseMetaData.java:1280)
at com.mysql.jdbc.DatabaseMetaData.getProcedureColumns(DatabaseMetaData.java:3668)
at com.mysql.jdbc.CallableStatement.determineParameterTypes(CallableStatement.java:638)
at com.mysql.jdbc.CallableStatement.<init>(CallableStatement.java:453)
at com.mysql.jdbc.Connection.parseCallableStatement(Connection.java:4365)
at com.mysql.jdbc.Connection.prepareCall(Connection.java:4439)
at com.mysql.jdbc.Connection.prepareCall(Connection.java:4413)
at saystorm.server.data.database.TestDB.main(TestDB.java:29)
where have I gone wrong?
when I commented out the statement that makes the procedure call and call preparedstatement to execute SQL select statement, it gave perfectly correct result.
it looks like there is no problem with java prog accessing MYSQL server database, but the it seems that it's just java can't call stored procedure stored on the mysql server version 5.
can it or can't it? if it can, how is that accomplished?It is a bug in the driver because it shouldn't be
returning that exception (null pointer) even if you
are doing something wrong.
Are you using the latest version of the driver?
The stored procedure runs when you run it from the
gui/command line using a MySQL tool - correct?
As suggested you should be using the brackets. What
is the data type of the 'name' field?
You could try returning another value like one of the
following
select 1, name from tblsite;
select name, 1 from tblsite;
That might get around the bug
Additionally try just the following...
select 'test' from tblsite;yes, the driver used is in connector/j 5.0--the lastest one, and the
procedure can run correctedly at either command line or GUI mode
with no problem whatsoever, the returned data type is string type,
I have not got the chance to test it again with those values you
suggested, as I have abandoned the laptop I used to write that code
initately. There have been some other really weird cases happened on
that computer. I guess that must be something wrong with the JVM
installed on it, it was upgraded from jre5.0.04 to 06, and to 09.
something within hte JVM must have been messed up(the only reasonable
explanation). Because the same code runs correctly on my new laptop,
using the same environment: jvm 5.0_09, mysql 5.0.18, connector/J 5.0.
that old laptop really was a nightmare. -
Calling portal JavaScript from dynamic pages
Where is the Oracle folder where all the JavaScripts are located? I want to use some of these scripts in my dynamic page.
Thanks,
MarceloBob,
You have variables in your procedure like l_status, p_alternate_status which you do not have in the form. Are these IN or OUT variables ?
If these are IN variables, this proc will not work because you do not have any variable in the form. So from where does it get the values? There is not any default declared too. You have to explicitly define IN or OUT variables.
Have you also given execute permission to public ? -
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 store procedure from an oci program
Hello,
I work on Oracle 8.1.7 under AIX.
I must call from an OCI C++ program a store procedure that have an result set as param out.
I'm not sure how can I call the procedure/function. I want to execute this statement and fetch the results.:
" CALL Department.get_all (:1) " is this OK?
" Call department.GetAll() into :1 "
I have seen some example from an PL/SQL block but that's not ok for me.
what i have done:
i have created an package
create or replace package department as
type cursor_type is ref cursor;
procedure get_emp( i_deptno in number, rs out cursor_type );
procedure get_all( rs out cursor_type );
function GetAll return cursor_type;
end department;
create or replace package body department as
procedure get_emp ( i_deptno in number, rs out cursor_type )
as
begin
open rs for
select empno, ename
from emp
where deptno = i_deptno;
end;
procedure get_all ( rs out cursor_type )
as
begin
open rs for
select empno, ename
from emp;
end;
function GetAll return cursor_type
as
l_cursor cursor_type;
begin
open l_cursor for select ename, empno from emp;
return l_cursor;
end;
end;Hi,
I am new to OCI facing the same problem you have mentioned, If you have found out how to solve it , can you post the answer for the same.
Thanks
Mani
Maybe you are looking for
-
Device won't show up on my desktop
Hi, everyone. I tried connecting my phone and my camera (individually at different times) to my Macbook Pro, but for some reason, neither device shows up on my desktop. I looked at my Finder preferences and "external disks" is checked off to show up
-
F-30 Posting the difference amount a Customer account
Hi Experts, I am a Technincal Person looking for answer on transaction F-30 (Post with clearing for incoming payments). I have a requirement in BDC where I need to post the Difference amount to a Dummy/Default Customer. I have to post the items based
-
Problem while Error Handling thru BAPI_PO_CREATE1
Hi, currently im facing problem while generating error thru BAPI_PO_CREATE1 im calling bapi two times thru loop iteration, as my data is faulty , so for 1st iteration im getting 3 error in it_return structure. now in 2nd iteration im getting (3+3) re
-
How do you I get my iPad to have the same cell phone as my phone?
Under FaceTime and IMessage where it said to be reached at I want my cell phone number there how do I change number?
-
My old PC has taken a fall and I am transferring to a new PC with Windows 7. What do I have to do to install my Adobe Pro Subscription on the new PC?