Error calling a package function
Hi all,
I've created one package and inside it, I've two different functions. The package definition and body are OK.
Now, I want use it but, I've an error:
ORA-06550: line 16, column 13:
PLS-00201: 'BB.PKG_BB_TEMP' must be declared
this is the function declaration on package declaration:
FUNCTION busca_municipio (gest varchar2) RETURN number;
Procedure solu (codi_ges number, muni number);
And this is the code from I'm calling:
DECLARE
CURSOR datos IS
select a.id from bb.cr_agent a, bb.cr_branchoffice b, bb.cr_professionalorder p, bb.cr_user u where a.branchoffice_id = b.id
and b.professionalorder_id = p.id and p.externalsystem_id = 42 and a.id = u.id and u.address_id is null;
cod_ag number;
muni number;
BEGIN
muni:=0;
open datos;
loop
fetch datos into cod_ag;
exit when datos%notfound;
muni:=bb.pkg_bb_temp.busca_municipio(cod_ag);
bb.pkg_bb_temp.solu (cod_ag,muni);
end loop;
close datos;
END;
This package is owned by user BB, and I'm connected like sys to execute the code I put before.
Any ideas?
Regards,
dbajug
dbajug wrote:
Hi all,
I'm having problems to grant:
SQL> select object_name, object_type, status from dba_objects where owner like 'BB' and object_type like 'PACK%';
OBJECT_NAME OBJECT_TYPE STATUS
PKG_bb_temp PACKAGE VALID
PKG_bb_temp PACKAGE BODY VALID
SQL> GRANT EXECUTE ON BB.PKG_bb_temp to sys;
GRANT EXECUTE ON BB.PKG_bb_temp to sys
ERROR in line 1:
ORA-04042: procedure, function, package or package body doesn't exist
SQL> conn bb/*******
Conected.
SQL> GRANT EXECUTE ON PKG_bb_temp to sys;
GRANT EXECUTE ON PKG_bb_temp to sys
ERROR in line 1:
ORA-04042: procedure, function, package or package body doesn't exist
Any ideas?
Regards,
dbajugHave you created the package with a case sensitive name i.e. did you put double quotes around it?
select owner, object_name from all_objects where upper(object_name) = 'PKG_BB_TEMP';The owner should show as "BB" and the object_name should be in upper case (hopefully). If it's not upper case then it's been created case sensitive and you you'll have to either recreate the package without using double quotes around the name or make sure you always reference the package with double quotes and the case exact version of the name.
e.g.
GRANT EXECUTE ON "PKG_bb_temp" TO <user>;Hopefully, you are not running your other code as SYS, so you should ensure you grant permission to the correct user, not to SYS.
Similar Messages
-
Fatal error: Call to undefined function oci_connect()
I get below error when I try to connect to oracle in PHP on SUSE 10. I orginally posted this question in PHP forum but I was advised to post it to Linux forum. so here is the error and other details.
Fatal error: Call to undefined function oci_connect()
I followed one of the documentation realed to this error and I get below error.
/home/knaik # php -version
PHP 5.2.5 with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 23 2008 23:35:28)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
/home/knaik/oci8-1.3.5 # phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
Cannot find autoconf. Please check your autoconf installation and the $PHP_AUTOCONF
environment variable is set correctly and then rerun this script.
I was looking into below link. But I could not find oci8.so file after the OCI build.
http://www.orware.net/tips-and-how-tos/plesk/46-oracle-oci8-php-installation.html
===================================================
===> In reply to my request *"mgogala's"* reply was as below.
Install autoconf using yast. Check whether the package is installed by using:
$>rpm -qa autoconf
autoconf-2.59-5
BTW, this is not a Linux forum. There is one on OTN, I'm sure that Frits Hoogland will gladly help you out.
====>
I am not able to find "autoconf" rpm for Suse 10.
Below is the exact version details of the O/S.
#*more SuSE-release*
SUSE Linux Enterprise Server 10 (i586)
VERSION = 10
PATCHLEVEL = 2
#*uname -a*
Linux osdvglobalopsdv02 2.6.16.60-0.21-smp #1 SMP Tue May 6 12:41:02 UTC 2008 i686 i686 i386 GNU/Linux
Please let me know, from where can I download this RPM?
Thanks
Shellybtw, this is the oracle enterprise linux forum, the forum specific for oracle's linux distro, there is a general linux forum here: Generic Linux
-
1) Configured Php4.4 to have oci8 enabled with Apache2.2 on Windows 2000 ( service pack4). No error at the time of Apache start but when trying to connect to Oracle using Oracle Instant Client below error is thrown..
"Fatal error: Call to undefined function: ocilogon() in C:\Apache2 \htdocs\star\dbconnect.php on line 7"
Configuration steps..
1) Uncommented "extension=php_oci8.dll" in php.ini to enable oci API's.
2)Configured Oracle Instant client by adding path to Windows path variable as per it documentation.
3)Copied all Php4.4 dlls( oci..etc) into the directory pointed by "PHPIniDir", which is configured in httpd.conf
If i run phpinfo(), i dont see oci8 enabled in the output. I guess there is problem in the configuration? Any insights into the error is greatly appreciated..
BTW, I did same configuartion on Windows XP and is working fine..Also, I dont see path value for path variable in phpinfo() ouput for Oracle Instant Client, which i updated in Windows?
Below is the snippet of ouput from phpinfo().
Apache Environment
Variable Value
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*
HTTP_ACCEPT_LANGUAGE en-us
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
HTTP_HOST localhost
HTTP_CONNECTION Keep-Alive
PATH D:\CESi\isis\bin;D:\CESi\Gateway\mico-win32-bin\;D:\CESi\Gateway\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Support Tools\
SystemRoot C:\WINNT
COMSPEC C:\WINNT\system32\cmd.exe
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
WINDIR C:\WINNT
SERVER_SIGNATURE <address>Apache/2.0.59 (Win32) PHP/4.4.4 Server at localhost Port 80</address>
SERVER_SOFTWARE Apache/2.0.59 (Win32) PHP/4.4.4
SERVER_NAME localhost
SERVER_ADDR 127.0.0.1
SERVER_PORT 80
REMOTE_ADDR 127.0.0.1
DOCUMENT_ROOT C:/Apache2/htdocs
SERVER_ADMIN [email protected]
SCRIPT_FILENAME C:/Apache2/htdocs/info.php
REMOTE_PORT 4977
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /info.php
SCRIPT_NAME /info.php
Environment
Variable Value
ALLUSERSPROFILE C:\Documents and Settings\All Users
CMM_CELL CSTAR_STAR
CommonProgramFiles C:\Program Files\Common Files
COMPUTERNAME STAR-SM-NR-PROD
ComSpec C:\WINNT\system32\cmd.exe
NUMBER_OF_PROCESSORS 2
OS Windows_NT
Os2LibPath C:\WINNT\system32\os2\dll;
Path D:\CESi\isis\bin;D:\CESi\Gateway\mico-win32-bin\;D:\CESi\Gateway\;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program Files\Support Tools\
PATHEXT .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE x86
PROCESSOR_IDENTIFIER x86 Family 6 Model 11 Stepping 1, GenuineIntel
PROCESSOR_LEVEL 6
PROCESSOR_REVISION 0b01
ProgramFiles C:\Program Files
SMS_LOCAL_DIR C:\WINNT
SystemDrive C:
SystemRoot C:\WINNT
TEMP C:\WINNT\TEMP
TMP C:\WINNT\TEMP
USERPROFILE C:\Documents and Settings\xwback
windir C:\WINNT
AP_PARENT_PID 884 -
Calling a package function inside a sql
Hi friends!!!
First of all happy Christmas! And them please help! :)
We have a query calling a package function:
SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR ('0000000000000000');There is a primary key just with one column DW025H_NR and the problem is that is not accessing by INDEX UNIQUE SCAN,
it's accessing by TABLE ACCESS FULL.
May be the problem is that we are calling a procedure inside the query?
I have been able to run that query accessing by primary key from my computer but a workmate hasn't!
We both are connecting the same data base 10.2.0.4 and using Oracle SQL Developer!
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 5343K| 1406M| 15670 (7)| 00:02:43 |
|* 1 | VIEW | DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
|* 2 | FILTER | | | | | |
| 3 | TABLE ACCESS FULL| DW025H | 5343K| 1406M| 15670 (7)| 00:02:43 |
Predicate Information (identified by operation id):
1 - filter("DW025H_NR"="MPPCI"."ENCRIPTAPAN"('0000000000000000'))
2 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
SYS_AUDIT('OPS$SISINFO','DW025H','CMINFOGR001',3) ELSE NULL END IS
NULL)
The correct path would be:
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 276 | 3 (0)| 00:00:01 |
|* 1 | FILTER | | | | | |
| 2 | TABLE ACCESS BY INDEX ROWID| DW025H | 1 | 276 | 3 (0)| 00:00:01 |
|* 3 | INDEX UNIQUE SCAN | PK_DW025H | 1 | | 2 (0)| 00:00:01 |
Predicate Information (identified by operation id):
1 - filter(CASE "OPS$SISINFO"."IS_USER_DNI"() WHEN 1 THEN
SYS_AUDIT('OPS$SISINFO','DW025H ','CMINFOGR001',3) ELSE NULL END IS NULL)
3 - access("DW025H_NR"="MPPCI"."ENCR"('0000000000000000'))
Please any ideas!?!?!
Thanks a lot!
José
Edited by: jamv on Dec 20, 2011 10:50 AMHello
Have a read of this and try to pull together the information in it and post it up here. That will help immensely with getting to the root of your problem...
HOW TO: Post a SQL statement tuning request - template posting
In the mean time:
From the execution plan you have extra predicates that aren't present in the query you supplied, so that's either not the SQL or you have something like VPD switched on.
Anyway, there could be lots of reasons for the difference in execution plan. Sorry if this is very basic and possibly patronising question but it's always worth checking the basics I think - are you both definitely connecting to the same database? If so, have a look in v$sqlarea for this SQL statement and find the SQL_ID, use this to query v$sql and look at the child_number column.
select
sql_id
from
v$sqlarea
where
sql_text like '%SELECT * FROM DW025H WHERE DW025H_NR=MPPCI.ENCR%(''0000000000000000'')%'
and
sql_text not like '%v$sqlarea%'
select child_number from v$sql where sql_id='<enter the sql id returned by the query above>'as an example...
XXXX> select /* my sql statement*/ rownum id from dual;
ID
1
1 row selected.
Elapsed: 00:00:00.10
XXXX> select sql_id from v$sqlarea where sql_text like '%my sql statement%'
and sql_text not like '%v$sqlarea%';
SQL_ID
a6ss4v79udz6g
1 row selected.
Elapsed: 00:00:03.56
XXXX> select child_number from v$sql where sql_id='a6ss4v79udz6g'
2 /
CHILD_NUMBER
0
1 row selected. If you have more than one row in v$sql there could be differences in the optimiser environment. The supplied like shows you how to gather the information that should help find what the differences are if any.
Also as a side note if you're calling PL/SQL functions from SQL, you can take advantage of subquery caching to help reduce the number of calls (depending on your version). As it stands, your function is most likely going to be called for every row - when there is only a single row returned, that's not necessarily a problem but for multiple rows, the overhead can quickly grow. If there's no way to get rid of the function call, select the function from dual instead i.e.
SELECT * FROM DW025H WHERE DW025H_NR= (SELECT MPPCI.ENCR%('0000000000000000') FROM dual);This also (as I learnt a couple of weeks ago) works when you're using columns in the table your selecting from as parameters to the function.
HTH
David -
http://www.oracle.com/technology/tech/php/htdocs/inst_php_apache_windows.html
I have followed all these instructions, installed what was specified (including all versions needed).
First problem I encountered was there were no oci8 title in phpinfo.php,
Second was when I compiled the oci8test.php it brings this error,
Fatal error: Call to undefined function ocilogon() in C:\Program Files\Apache Group\Apache2\htdocs\ocisample.php on line 3
As I said, I have followed exactly what was specified in the instructions, yet the error is persistent.
Actions taken:
restarted apache
checked folder locations
checked php.ini-recommended
checked httpd.conf
everything is where they need to be.
I need help.
Thanks everyone. Have a nice day.If this is line #3, then try changing "//127.0.0.1/XE" to "localhost", or better yet to your TNS alias, which is typically "XE".
$db_conn = ocilogon("hr", "your_hr_password", "//127.0.0.1/XE");
It should look like this if you're using a USER account of test with a password of test:
$db_conn = ocilogon("test","test","XE"); -
Fatal error: Call to undefined function OCILogon()
Dear,
Under WinXp_Sp2 in iis I installed 5.1.6. It worked fine but when used with oracle 9.2.0.1.0 it gives error "Fatal error: Call to undefined function OCILogon()" while other extensions are working fine in extension dir. Please help me.
Thanks & regards.
JamilYou haven't mentioned having 9i installed locally. This way it should work well but in some cases ORACLE_HOME dependencies could not be resolved. If you need precise information what file to put where try the filemon utility.
http://www.sysinternals.com/Utilities/Filemon.html
It would show you the files php is trying to access in order to make use of the oci module. -
Hi all,
when I use this php script
<?php
$db_conn = ocilogon("venus_pkg","venus_pkg","ventst");
?>
I get this error:
Fatal error: Call to undefined function ocilogon() in d:\SITO\VENTST.php on line 3
How to configure Apache 1.3.3 with PHP version 5 to use OCI?
Thanks in advanceHi,
Even I am facing the same problem. I have done all the above mentioned settings. I have set the php.ini file with the extension dirt to "php/ext" and also uncommented the extension=phpoci8.dll . we r using PHP5.2.0, Apache 2.2 and Oracle 10g and installed both the XE and the Client edition of oRACLE 10G on windows XP.
Trying to execute the code:
<?php
echo "<h1>OCI Test</h1>\n";
$conn=OCILogon("username", "password", "system");
$stmt = OCIParse($conn, "SELECT * FROM employee ORDER BY name");
OCIExecute($stmt, OCI_DEFAULT);
while (OCIFetch($stmt)) {
$table_name = OCIResult($stmt, "employee");
echo "$table_name<br />\n";
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
and getting the error as:
Debug Error: C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\test.php line 3 - Call to undefined function OCILogon()
Please help me out solving this problem. -
Fatal error: Call to undefined function add__custom_background() in /home4/dargonza/public_html/wp-content/themes/twentythirteen/functions.php on line 24
While practicing with HTML with WordPress Themes, I inserted a phrase (add_custom_background) in the wrong sentence.Its wordpress theme issue
*issue in path location
Try with wordpress forum
*http://wordpress.org/support/
May be try this
*http://wordpress.org/support/topic/fatal-error-call-to-undefined-function-add_custom_background -
Getting Fatal error: Call to undefined function mysql_connect() error.
ok, so before I had my mysql_connect php script and it ran fine, no errors, but once I changed my php.ini file to give ERROR_REPORTING E_ALL I now get Fatal error: Call to undefined function mysql_connect(). I am just wondering how I can fix this?
I followed the arch linux LAMP wiki and I can't figure out why I am getting this error after turnning on error_reporting.
Thanks
this is my php code
<?php
$connection = mysql_connect('localhost', 'root', 'password');
if(!$connection){
echo mysql_error();
} else {
echo 'connected';
if (!mysql_select_db('my_first_db')){
echo 'uh';
} else {
echo 'selected database';
?>
<?php phpinfo(); ?>
Last edited by clandest (2012-03-22 04:36:43)aking9 wrote:grabbing into the back of the back of my memory here but don't you need to specify a port to connect to?
Only if you change the port from the default 3306. But even then, a different error message will output, in this case the mysql modules have not loaded for some reason.
There is a syntax error in your php.ini file, at line 510. Comment out this line as it's a line giving information rather than an option. Then uncomment the error_reporting option.
So this:
Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
;error_reporting = E_ALL & ~E_DEPRECATED
Should be changed to this:
; Default Value: E_ALL & ~E_NOTICE
; Development Value: E_ALL | E_STRICT
; Production Value: E_ALL & ~E_DEPRECATED
; http://php.net/error-reporting
error_reporting = E_ALL & ~E_DEPRECATED
After this try "sudo /etc/rc.d/httpd restart" then see if you have any better luck connecting to mysql.
Last edited by astiak (2012-03-22 23:24:40) -
Calling public package functions and variables through dblink
Is it possible to call a global public variable in a package in one database from another package procedure in another database using a database link? If so, could you let me know the syntax? Same question for package functions.
Hi,
check this documentation link especially the stmt...
http://www.mcs.csueastbay.edu/support/oracle/doc/10.2/appdev.102/b14251/adfns_packages.htm#i1007858
You cannot access remote package variables and constants.May be you can write a function in the remote db which when called will return the variable value.
for calling remote package functions...
syntax from documentation is [[schema.]package.]function_name[@dblink][(param_1...param_n)]
an example given in the above link for this...
EXECUTE fire_emp1@boston_server(1043);
Ravi Kumar
Edited by: ravikumar.sv on Aug 31, 2009 11:29 AM -
Calling Oracle Package Function from Visual Basic
Hi,
Oracle Client 8.04
Oracle ODBC Driver 8.00.04
VB 6.0
Windows 2000
I'm stumped here. I want to have a Oracle stored procedure run a
query and return a result set which I can assign to a recordset
object in VB. Based on things I've read here and on MS's site,
here's what I've done:
In the Oracle Schema Manager under the Packages folder I created
the following package:
PACKAGE test
IS
TYPE test_cur IS REF CURSOR;
FUNCTION mycur RETURN test_cur;
END test;
and under the Package Body folder created:
PACKAGE BODY test
IS
FUNCTION mycur RETURN test_cur
IS
c_return test_cur;
BEGIN
OPEN c_return FOR
SELECT * FROM table_A;
RETURN c_return;
CLOSE c_return;
END mycur;
END test;
They both compile without errors and in Oracle SQL Worksheet I
can enter the following:
variable x refcursor;
execute :x :=test.mycur;
print x;
and the query results are displayed as expected.
The problem is trying to get the result back into a VB recordset
object.
In VB 6.0 I have done this:
Dim RS As ADODB.Recordset
Dim Conn As ADODB.Connection
Dim sConnection As String
Dim sSQL As String
sSQL = "{call test.mycur}"
sConnection = "Provider=MSDASQL;UID=" & sUserID & ";PWD=" &
sPassword & ";Driver={Microsoft ODBC for Oracle}; Server=" &
sInstance & ";"
Conn.Open sConnection
RS.CursorLocation = adUseClient
RS.Open sSQL, Conn, adOpenForwardOnly, adLockOptimistic,
adCmdStoredProc ' or adCmdText
but get:
?err.Number -2147217900
?err.Source Microsoft OLE DB Provider for ODBC Drivers
?err.Description [Microsoft][ODBC driver for Oracle]Syntax error
or access violation
The problem is not with the connection or permissions, since the
query works fine when I just use the select statement in the
package function as the string, instead of calling the function
in the package (eg sSQL = "Select * from table_A") and can
process the resulting recordset in VB.
I've also tried variations using:
Set RS = Conn.Execute("{call test.mycur}")
or using a Command object something like:
Dim com As ADODB.Command
Set com = New ADODB.Command
With Conn
.ConnectionString = sConnection
.CursorLocation = adUseClient
.Open
End With
With com
.ActiveConnection = Conn
.CommandText = sSQL
.CommandType = adCmdText
End With
Set RS.Source = com
RS.Open
But still get the same errors. Any help is appreciated. Also, in
my package body, is it necessary to explicitly close the cursor,
or does the function just exit when it executes the return and
not ever hit the close statement?
Thanks,
Ed HollomanHi
i don't know if you got your answer, but i work with VB and
Oracle.
the procedure in the DB should have the cursor like you writen
in your mail.
to call a procedure in Oracle and get the data back
into a recordset you shuld use a Command object like this:
Dim conn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
Set conn = CreateObject("adodb.connection")
Set cmd = CreateObject("adodb.command")
Set rs = CreateObject("adodb.recordset")
With conn
.ConnectionString = ""
.CursorLocation = adUseClient
.Open
End With
'THE IMPORTENT SECTION IS THIS WHERE YOU SET THE COMMAND TO THE
STORE PROCEDURE TYPE
With cmd
.ActiveConnection = conn
.CommandText = "proc.fun"
.CommandType = adCmdStoredProc
End With
'Then you set the rs to the command
Set rs = cmd.Execute
Set conn = Nothing
Set rs = Nothing
Set cmd = Nothing -
Calling a package function in the data template
Hello All,
I am not able to understand the concept of calling a function from the data template.
In my data template, I put the sql statement as
<sqlStatement name="Q_SEL">
<![CDATA[ Select l_period_name PERIOD_NAME
from xla_tb_ap_report_pvt.get_period_name(1) ]]>
</sqlStatement>
Is it possible to call a specific package function as shown above in a select statement?
I am getting the message "ORA-00933: SQL command not properly ended" when I tried with the above. Could you pls. point out what the error is in the above sqlStatement?
1) My instance is R12.1.3
2) The base pkg function 'xla_tb_ap_report_pvt.get_period_name' expects a number to be passed in as 'IN' parameter.
Thanks,
MonkeyI tried another version of the sql statement (after going through some older posts) like:
<sqlStatement name="Q_SEL">
<![CDATA[ Select xla_tb_ap_report_pvt.get_period_name(1) PERIOD_NAME
from dual]]>
</sqlStatement>
My group is :
<group name="G_PERIOD_NAME" source="Q_SEL">
<element name="PERIOD_NAME" value="PERIOD_NAME"/>
</group>
Now getting the error message:
ORA-00904: xla_tb_ap_report_pvt.get_period_name : invaild identifier
What is it that i am doing wrong?
Thanks,
Monkey
Edited by: OAF_Monkey on Mar 26, 2012 11:52 AM -
Error when calling a package function
any insight why my object is erroring out when calling a function. the error is
oracle.apps.fnd.framework.OAException: java.sql.SQLException: ORA-06502: PL/SQL: numeric or value error: character to number conversion error
ORA-06512: at line 1
it errors out when the cs.execute() is . is it the placement ? thanks for the help....
then pkg func is xxx.get_log
Get_Log(rmode IN NUMBER , doc_type IN VARCHAR2 DEFAULT 'TEL', doc_id IN VARCHAR2 DEFAULT NULL,
doc_num IN VARCHAR2 DEFAULT NULL -- , p_out out varchar2 --
RETURN varchar2 IS....
the co
Serializable paramDocLocatorParamList [] = {paramRMODE, paramDOC_TYPE, paramDOC_ID, paramDOC_NUM, p_out };
OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
OADBTransaction dbtrans;
OAViewObject docLocator = (OAViewObject)am.findViewObject("DocLocatorVO1");
rtxt0.setValue(pageContext, "here it is" + am.invokeMethod("getHTMLString", paramDocLocatorParamList));
docLocator.executeQuery();
// am.invokeMethod("getHTMLString", paramDocLocatorParamList);
the impl
public String getHTMLString ( String paramRMODE, String paramDOC_TYPE, String paramDOC_ID, String paramDOC_NUM, String p_out )
System.out.println("Entering The AM Impl");
CallableStatement st = null;
OADBTransaction txn = (OADBTransaction)getDBTransaction();
Connection conn = txn.getJdbcConnection();
String sql = " BEGIN :5 := test_proc.get_log(:1, :2, :3, :4 ); END; ";
CallableStatement cs = txn.createCallableStatement(sql,1);
String ErrorExist = "";
String getHTML = "";
try
cs.setString(1, paramRMODE);
cs.setString(2, paramDOC_TYPE);
cs.setString(3, paramDOC_ID);
cs.setString(4, paramDOC_NUM);
cs.setString(5,p_out); // --param
/* cs.registerOutParameter(1,Types.CHAR);
cs.registerOutParameter(2,Types.CHAR);
cs.registerOutParameter(3,Types.CHAR);
cs.registerOutParameter(4,Types.CHAR);*/
cs.registerOutParameter(5,Types.CHAR);
cs.execute();
getHTML = cs.getString(5 ) ;
/* System.out.println("getHTML is " + getHTML );
cs.close();
// if ( "E".equals(ErrorExist))
/// throw new OAException ("Payment Request Is Already Cancelled" );
catch (SQLException sqle)
try { cs.close(); }
catch (Exception e) {}
throw OAException.wrapperException(sqle);
String doctype = paramDOC_TYPE;
String docnum = paramDOC_NUM;
String html ;
System.out.println( "paramDOC_TYPE in IMPL is " + doctype) ;
System.out.println( "paramDOC_Numb in IMPL is " + docnum) ;
return getHTML;resolved.....
public String getHTMLString (String p_out , String rmode, String doc_type, String doc_id, String doc_num )
System.out.println("");
System.out.println("Entering The AM Impl");
// System.out.println("Passing getDocAbbrForHTML in IMPL -------> " +getDocAbbrForHTML );
// System.out.println("Passing paramDOC_NUM in IMPL -------> " + paramDOC_NUM );
System.out.println("Passing getDocAbbrForHTML in IMPL -------> " +doc_type );
System.out.println("Passing paramDOC_NUM in IMPL -------> " + doc_num );
CallableStatement st = null;
OADBTransaction txn = (OADBTransaction)getDBTransaction();
Connection conn = txn.getJdbcConnection();
String sql = " BEGIN :1 := test_proc.get_log(:2, :3, :43, :5 ); END; ";
CallableStatement cs = txn.createCallableStatement(sql,1);
String ErrorExist = "";
String getHTML = "";
try
cs.setString(2, rmode);
cs.setString(3, doc_type);
cs.setString(4, doc_id);
cs.setString(5, doc_num);
cs.registerOutParameter(1,Types.VARCHAR);
cs.execute();
getHTML = cs.getString(1 ) ; -
Unable to call a Packaged function in SQL statement??
I have written a package & overloaded a function 3 times. I am using different parameter name for overloading & call as follows:
my_pkg.ovrld_func(p_1 => v_val)
my_pkg.ovrld_func(p_2 => v_val)
my_pkg.ovrld_func(p_3 => v_val)
When i use this statement in a sql or DML statement i get the following error.
ORA-00907: missing right parenthesis
I searched for limitations on packages but couldn't find this issue.
FYI: I am using Oracle 9i Rel2
ThanksI think its a bug as Oracle didn't report this limitation anywhere in the documentation & i should open a TAR.Well, it's documented limitation in fact.
Quote "Oracle9i Application Developer’s Guide - Fundamentals Release 2 (9.2)"
In a chapter entitled "Syntax for SQL Calling a PL/SQL Function"
p. 9-53.
Arguments
To pass any number of arguments to a function, supply the arguments within the
parentheses. You must use positional notation; named notation is not currently
supported. For functions that do not accept arguments, use ().Regards. -
Problem calling a packaged function from an authorization scheme
I wrote a package and body called pkg_auth with a function returning a boolean called is_authorized with 2 parameters (username and functional area).
i.e.
CREATE OR REPLACE PACKAGE pkg_auth
AS
FUNCTION is_authorized(p_username VARCHAR2, p_functional_area VARCHAR2) RETURN BOOLEAN;
END;
additionally i created a public synonym for it and granted execute access on it to apex_public_user and htmldb_public_user;
i then created an authorization scheme called 'access_control_db' defined as Scheme Type 'PLSQL Function Returning Boolean' and placed the following:
pkg_auth.is_authorized(v('APP_USER'),'DATABASE')
in the Expression 1 field.
and the following:
Not permitted to edit database information.
in the error field.
However when I apply this authorization scheme to a buton I receive the following error when I go to the page containing that button:
ORA-06550: line 1, column 44: PLS-00221: 'IS_AUTHORIZED' is not a procedure or is undefined ORA-06550: line 1, column 44: PL/SQL: Statement ignored
Error ERR-1082 Error in executing authorization scheme code.
Any help would be most appreciated.Hello,
Does putting 'return' infront -
return pkg_auth.is_authorized(v('APP_USER'),'DATABASE')fix your problem?
John.
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone!
Maybe you are looking for
-
I recently got an iphone 4 through my network provider after 4 days of having the product i started to experience problems. My iphone 4 would start calling people in my contacts without me even touching the phone, at first it was funny but people we
-
Can anybody help me to buil this query
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bi PL/SQL Release 10.2.0.1.0 - Production CORE 10.2.0.1.0 Production TNS for Linux: Version 10.2.0.1.0 - Production NLSRTL Version 10.2.0.1.0 - Production =========================
-
Spry accordion defaulting colors in IE
Hi all: I have built a Spry accordian with color styles in the css file which work fine in Safari but are defaulting to bright blue and aqua in IE7. Can anyone tell me the css or js mods I should make to fix the IE issue? K.
-
How can I get my apple ID back if my ID were stolen and all of my personal information were changed
I recently found out if someone else stolen my apple ID then he can login my account on apple's website and change almost every information, like my first and last name, my apple ID, my password, my security question and my birthday... Those informat
-
Prob in accessing DataSourece value from netui-data:repeater after submit
HI all, I am new to this WLWS. PLease guide me in the following scenario: I am retrieving an array of records (activityDetails[]) from a Db control and setting this to the datasource property of a netui-data:repeater. Basically I