473,382 Members | 1,464 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,382 software developers and data experts.

PLS-00201 error from PHP

I'm having problems running an Oracle stored procedure
that returns a cursor to from a web front end. The problem
occurs both with PHP and ASP.NET.

The error is the familiar
"PLS-00201:identifier' <User>.<Procedure Name> ' must be declared"

Note: the procedure runs fine from sql*plus, so I know the spec
and body are ok.

The package spec and body are as follows:
Expand|Select|Wrap|Line Numbers
  1. CREATE OR REPLACE PACKAGE tag_data 
  2. AS
  3.     PROCEDURE tag_GetAll(rst OUT SYS_REFCURSOR);
  4. END tag_data;
  5.  
  6. CREATE OR REPLACE PACKAGE BODY tag_data 
  7. AS
  8.    PROCEDURE tag_GetAll(rst OUT SYS_REFCURSOR)
  9.    AS
  10.    BEGIN
  11.     OPEN rst FOR SELECT * FROM Tag;
  12.    END;
  13.  END tag_data;
As I noted, The procedure runs fine from sql*plus.
For instance, via this sequence of commands:
Expand|Select|Wrap|Line Numbers
  1.    var rst refcursor;
  2.    exec tag_data.tag_getall(:rst);
  3.    print rst;

Following is a portion of the PHP I've used. (I can provide the ASP also.)
[PHP] $con = oci_connect(<login>, <pwd>, <service name>);
$s = oci_parse($con, 'BEGIN tag_data.tag_getall(:rst); END;');
$rst = oci_new_cursor($con);
oci_bind_by_name($s, ":rst", $rst, -1, OCI_B_CURSOR);
oci_execute($s);[/PHP]

The last step results in the PLS-00201 error on tag_data.tag_getall

Googling around suggests this is a permissions problem.
I have granted EXECUTE permission to the package to PUBLIC and ANONYMOUS, with no change.
Also: the login I'm using is the same that I use from sql*plus so presumably
the same permissions should apply, no?

Thanks
Apr 1 '08 #1
3 2608
A slight correction to my initial post:
I should have said: "PLS-00201:identifier' <Package Name>.<Procedure Name>,
rather than: "PLS-00201:identifier' <User>.<Procedure Name>
Apr 1 '08 #2
debasisdas
8,127 Expert 4TB
grant the permission to the procedure also

grant to packagename.procedure name

again call from your frontend.
Apr 2 '08 #3
Hmm. After some research, it appears that:

1) Granting privileges to the package automatically grants the same privileges to procedures within the package.

2) It is not clear that it is even possible, without some workaround, to grant privileges to specific procedures in a package. For instance:
Expand|Select|Wrap|Line Numbers
  1. GRANT EXECUTE on tag_data to public;
works fine, butGRANT EXEC
[HTML]GRANT EXECUTE on tag_data.tag_getall to public;[/HTML]
coughs up an error.

In fact, I'm not yet convinced this is a permissions problem. (It is annoying that Oracle doesn't give a more informative error message.) For, as I mentioned, I can successfully call the procedure from sql*plus, using the same login.


grant the permission to the procedure also

grant to packagename.procedure name

again call from your frontend.
Apr 2 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Michael Hogan | last post by:
I want to pars a playlist file for three different varibles, so I can save them as mp3 files. I am using: strTEMPURL = GetUrlSource(Text1.Text) to put the entire .pls file into a strTEMPURL...
6
by: ritagoldman101 | last post by:
Pls help - how to find Domain owner For most people this may be an easy question...but not for me. How can I find out who the owner of a domain is so I can write to her / him and ask if she /...
0
by: RamaKrishna | last post by:
Hi All: When am trying to call a .NET webservice which was developed using .NET V 1.1 from VB6.0 using SOAP tool kit3.0......It can be any function/ method in the webservice..Bec'z lets say i...
8
by: Raghu Raman | last post by:
Hi , i want to compile my asp.net app from the commandline window.could you please tell me how. With thanks Drop in the ocean.
2
by: Raghu Raman | last post by:
Hi , am storing the session id in my database when the user signs in.The session_on start is firing nice & am doing my DB operations there & quite working good. But when the user closes the...
20
by: Dj_TRuST | last post by:
This is my homework and i couldn't do it,please help me. I wait your helpsss On the planet Zephod, which orbits the star Betelgeuse, the sharks increase at a rate of 5% of the guppy population...
3
by: bangaw | last post by:
i'm currently using c++ on windowsXP, unistd.h doesnt work for windows what other substitute for it could i use to replace it Pls. Help me Pls pls the code goes as follows #include <stdio.h>...
0
by: naheed javaid | last post by:
I m student and doing my final project. My project is related to screen capturing. my project captures screen and save the captured screen as bitmaps in a folder. while the screen recording audio...
1
by: vbsoft | last post by:
Hello My Name is Mike Am from Nigeria a student of computer Science, Pls i want your You to help in Using VISUAL BASIC 6.0 AND MS SQL SERVER AS DATABASE AS A CLIENT SERVER SIDE pLS: I...
0
by: sonuindia88 | last post by:
Some common confusions .I am reading Ritchie and Deitel and practising questions from Yashwant Kanetkar...Here are some of the confusions i am having..your help is required.... Q1) ...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.