473,387 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Oracle Stored Procedure

What is the correct syntax for calling an oracle stored procedure and
getting a retrun value? I created a simple procedure on my oracle database
for testing and yes I know I could do this in a function but I have a more
complex procedure that I have created for the creation of reports. I'm
trying to use ora_parse and ora_bind without much luck. Any help would be
much appreaciated.

Thanks

CREATE OR REPLACE PROCEDURE P_PHP_PROC_CALL (
p_survey_code IN VARCHAR2,
p_request_id OUT NUMBER
)
AS
BEGIN

IF p_survey_code = 'XYZ' THEN
p_request_id := 12345;
END IF;
END;
/
Oct 17 '05 #1
2 2132
On Mon, 17 Oct 2005 13:38:02 -0400, "paddy_nyr" <mp****@yahoo.com> wrote:
What is the correct syntax for calling an oracle stored procedure and
getting a retrun value? I created a simple procedure on my oracle database
for testing and yes I know I could do this in a function but I have a more
complex procedure that I have created for the creation of reports. I'm
trying to use ora_parse and ora_bind without much luck.


Don't use them, they're the (very) old API.

There's an example of calling a stored procedure on the OCI8 manual page.

If you're using ADODB then see http://phplens.com/lens/adodb/docs-oracle.htm
--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Oct 17 '05 #2
paddy_nyr wrote:
What is the correct syntax for calling an oracle stored procedure and
getting a retrun value? I created a simple procedure on my oracle database
for testing and yes I know I could do this in a function but I have a more
complex procedure that I have created for the creation of reports. I'm
trying to use ora_parse and ora_bind without much luck. Any help would be
much appreaciated.

Thanks

CREATE OR REPLACE PROCEDURE P_PHP_PROC_CALL (
p_survey_code IN VARCHAR2,
p_request_id OUT NUMBER
)
AS
BEGIN

IF p_survey_code = 'XYZ' THEN
p_request_id := 12345;
END IF;
END;
/


If you can rewrite your code as a function you could simply
do a "select P_PHP_PROC_CALL(...) from dual"

Dual is a table available to every user for the specific
purpose of calling functions, that is, if you don't use
the functions in any "real" select with real tables.

The typical example is "select sysdate from dual".

Lots of Greetings!
Volker
Nov 2 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: kristoff plasun | last post by:
I have a problem with a C++ DCOM application that prints Crystal Reports with data from Oracle. The SQL query is relatively complex but when the report is printed from the Crystal Reports...
0
by: Chan | last post by:
Hi, I am trying to send set of rows from my c# web service to Oracle stored procedure. I think I can get this done using OpenXML in SQL Server. How to implement this in Oracle Stored...
1
by: robin via SQLMonster.com | last post by:
I've tried several different way to execute a oracle stored procedure from a DTS package but to no avail. I have a Linked Server setup which does bring back Oracle tables from the server when I...
11
by: jrefactors | last post by:
I want to know the differences between SQL Server 2000 stored procedures and oracle stored procedures? Do they have different syntax? The concept should be the same that the stored procedures...
0
by: totierne | last post by:
comp.databases.ms-access, I want to know how to use Oracle views with session variables in Access. The parameterised views in access, are migrated to views with per session variables. The...
0
by: Chan | last post by:
Hi, I am trying to send set of rows from my c# web service to Oracle stored procedure. I think I can get this done using OpenXML in SQL Server. How to implement this in Oracle Stored...
1
by: Chad | last post by:
Hi, I am a SQL Server programmer using Oracle for the first time. In our .NET client apps which use a SQL Server back end, we would use Stored Procedure exclusively for all database access for...
0
by: Tom | last post by:
Looking for some help with stored procedure call issues. Conceptually, I need to pass a data structure as the sole parameter to the Oracle stored procedure. Sounds simple enough....but how? ...
14
by: jehugaleahsa | last post by:
Hello: I am working with Oracle .NET Stored Procedures. I would like to know how to return the results of a SELECT statement. I have tried returning a OracleRefCursor and a DataTable, but...
23
by: Gloops | last post by:
Hello everybody, Is anyone able to give me some indications about how to develop an Access interface for an Oracle database ? I dispose of Access 2003 (11.6566.8107) SP2, Oracle 9i 9.2.0.1.0...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.