Home » SQL & PL/SQL » SQL & PL/SQL » Recursive Function -Oracle 11g (Oracle 11g)
| Recursive Function -Oracle 11g [message #547403] |
Wed, 14 March 2012 03:25  |
 |
gharsola
Messages: 3 Registered: March 2012 Location: Hyderabad
|
Junior Member |
|
|
Can any body let me know if recursive functions are supported in ORacle 11g or not.
We are migrating from 8i to 11g.
|
|
|
|
|
|
| Re: Recursive Function -Oracle 11g [message #547409 is a reply to message #547407] |
Wed, 14 March 2012 03:44   |
John Watson
Messages: 9000 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
I tried to create a recursive function, but it will not compile:SQL*Plus: Release 11.2.0.3.0 Production on Wed Mar 14 08:38:56 2012
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
Session altered.
orcl> create or replace function recurf return number as begin
2 recurf;
3 end;
4 /
Warning: Function created with compilation errors.
orcl> sho errors
Errors for FUNCTION RECURF:
LINE/COL ERROR
-------- --------------------------------------------------------------
2/1 PL/SQL: Statement ignored
2/1 PLS-00221: 'RECURF' is not a procedure or is undefined
orcl>
A procedure does compile and run:orcl> create or replace procedure recurp as begin
2 recurp;
3 end;
4 /
Procedure created.
orcl> exec recurp
but it crashes the database with this in the alert log:c:\app\john\diag\rdbms\orcl\orcl\trace>type alert_orcl.log
Wed Mar 14 08:40:27 2012
Errors in file C:\APP\JOHN\diag\rdbms\orcl\orcl\trace\orcl_ora_5588.trc (incident=54299):
ORA-04030: out of process memory when trying to allocate 8204 bytes (PLS PGA hp,PL/SQL STACK)
Incident details in: C:\APP\JOHN\diag\rdbms\orcl\orcl\incident\incdir_54299\orcl_ora_5588_i54299.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Wed Mar 14 08:41:06 2012
Errors in file C:\APP\JOHN\diag\rdbms\orcl\orcl\trace\orcl_j000_2420.trc (incident=54179):
ORA-04030: out of process memory when trying to allocate 262668 bytes (kxs-heap-w,kllcqgf:kllsltba)
Incident details in: C:\APP\JOHN\diag\rdbms\orcl\orcl\incident\incdir_54179\orcl_j000_2420_i54179.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Wed Mar 14 08:41:06 2012
Exception [type: ACCESS_VIOLATION, UNABLE_TO_READ] [ADDR:0xC] [PC:0x90867B1, 090867B1]
Errors in file C:\APP\JOHN\diag\rdbms\orcl\orcl\trace\orcl_j001_4216.trc (incident=55619):
ORA-07445: exception encountered: core dump [PC:0x90867B1] [ACCESS_VIOLATION] [ADDR:0xC] [PC:0x90867B1] [UNABLE_TO_READ] []
Incident details in: C:\APP\JOHN\diag\rdbms\orcl\orcl\incident\incdir_55619\orcl_j001_4216_i55619.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Wed Mar 14 08:41:07 2012
Errors in file C:\APP\JOHN\diag\rdbms\orcl\orcl\trace\orcl_ora_5588.trc (incident=54300):
ORA-04030: out of process memory when trying to allocate 169004 bytes (pga heap,kgh stack)
ORA-04030: out of process memory when trying to allocate 8204 bytes (PLS PGA hp,PL/SQL STACK)
Incident details in: C:\APP\JOHN\diag\rdbms\orcl\orcl\incident\incdir_54300\orcl_ora_5588_i54300.trc
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Wed Mar 14 08:41:08 2012
Process J001 died, see its trace file
kkjcre1p: unable to spawn jobq slave process
Errors in file C:\APP\JOHN\diag\rdbms\orcl\orcl\trace\orcl_cjq0_4212.trc:
Wed Mar 14 08:41:10 2012
Process startup failed, error stack:
Errors in file C:\APP\JOHN\diag\rdbms\orcl\orcl\trace\orcl_psp0_3708.trc:
ORA-27300: OS system dependent operation:CreateThread failed with status: 8
ORA-27301: OS failure message: Not enough storage is available to process this command.
ORA-27302: failure occurred at: ssthrddcr
Wed Mar 14 08:41:10 2012
Dumping diagnostic data in directory=[cdmp_20120314084110], requested by (instance=1, osid=2420 (J000)), summary=[incident=54179].
Wed Mar 14 08:41:11 2012
Process m000 died, see its trace file
|
|
|
|
|
|
| Re: Recursive Function -Oracle 11g [message #547411 is a reply to message #547410] |
Wed, 14 March 2012 03:47   |
 |
gharsola
Messages: 3 Registered: March 2012 Location: Hyderabad
|
Junior Member |
|
|
I am getting below error while compiling..
Function FSG.ITEM_HAS_MASS_NEEDS@PDS 11g new
Error(1): PLS-00707: unsupported construct or internal error [2604]
Error(37,3): PL/SQL: SQL Statement ignored
Error(63,16): PL/SQL: ORA-06544: PL/SQL: internal error, arguments: [2604], [], [], [], [], [], [], []
|
|
|
|
|
|
| Re: Recursive Function -Oracle 11g [message #547413 is a reply to message #547411] |
Wed, 14 March 2012 03:58   |
 |
Michel Cadot
Messages: 68776 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
gharsola wrote on Wed, 14 March 2012 09:47I am getting below error while compiling..
Function FSG.ITEM_HAS_MASS_NEEDS@PDS 11g new
Error(1): PLS-00707: unsupported construct or internal error [2604]
Error(37,3): PL/SQL: SQL Statement ignored
Error(63,16): PL/SQL: ORA-06544: PL/SQL: internal error, arguments: [2604], [], [], [], [], [], [], []
ORA-06544: PL/SQL: internal error, arguments: [%s], [%s], [%s], [%s], [%s], [%s], [%s], [%s]
*Cause: A pl/sql internal error occurred.
*Action:Report as a bug; the first argument is the internal error nuber.
Without the actual code and environment, we can't say more.
Regards
Michel
|
|
|
|
|
|
| Re: Recursive Function -Oracle 11g [message #547574 is a reply to message #547410] |
Wed, 14 March 2012 15:43  |
joy_division
Messages: 4963 Registered: February 2005 Location: East Coast USA
|
Senior Member |
|
|
gharsola wrote on Wed, 14 March 2012 04:44I am having one in oracle 8i which is not supporting in 11g..
Function def..
create or replace
function Item_Has_Mass_Needs
( psITEM_CODE varchar2
, psCheck_Locks varchar2 := 'Y'
)
return varchar2
is
REcursive call inside the function.
select 'Y'
from packaging.item_lnk a
where a.ITEM_ID = psITEM_CODE
and a.ITEM_LINK_TYPE_ID = 1 --Saleable Link;;
and fsg.Item_Has_Mass_Needs(a.ITEM_LINK_ID, 'N') = 'Y';
SQL> l
1 create or replace
2 function Item_Has_Mass_Needs
3 ( psITEM_CODE varchar2
4 , psCheck_Locks varchar2 := 'Y'
5 )
6 return varchar2
7 is
8
9
10 REcursive call inside the function.
11
12 select 'Y'
13
14 from packaging.item_lnk a
15
16 where a.ITEM_ID = psITEM_CODE
17
18 and a.ITEM_LINK_TYPE_ID = 1 --Saleable Link;;
19
20 and fsg.Item_Has_Mass_Needs(a.ITEM_LINK_ID, 'N') = 'Y';
21
22*
SQL> /
Warning: Function created with compilation errors.
SQL> show err
Errors for FUNCTION ITEM_HAS_MASS_NEEDS:
LINE/COL ERROR
-------- -----------------------------------------------------------------
9/16 PLS-00103: Encountered the symbol "INSIDE" when expecting one of
the following:
:= . ( @ % ; not null range default character
|
|
|
|
Goto Forum:
Current Time: Sun Apr 26 09:05:27 CDT 2026
|