'APEX_APPLICATION_GLOBAL.VC_ARR2' must be declared - oracle

create or replace procedure abcd123
as
V_ARR1 APEX_APPLICATION_GLOBAL.VC_ARR2;
begin
...
end;
compiling above code gives below errors
Error(8,10): PLS-00201: identifier 'APEX_APPLICATION_GLOBAL.VC_ARR2'
must be declared Error(8,10): PL/SQL: Item ignored
Error(12,2): PLS-00320: the declaration of the type of this expression
is incomplete or malformed Error(12,2): PL/SQL: Statement ignored
Error(13,2): PL/SQL: Statement ignored Error(13,5):
PLS-00320: the declaration of the type of this expression is
incomplete or malformed
We tried recreating on a different DB but the issue does not occur.
Could someone suggest what is going wrong on the other DB.

Related

Call Oracle stored procedure from PowerBI

I am using PowerBI (64b) with an Oracle 11g database.
When I try to connect to Oracle by stored procedure, I get an error, I don't know if I'm doing it right. please appreciate any help.
Observation: if there is a connection to the database, I can list the tables, etc.
I'm not calling the stored procedure correctly, what should I change? Thanks a lot,
procedure SPU_LISTAR_1(
FINI IN DATE,
FFIN IN DATE,
RS_CURSOR_LISTA IN OUT TYP_CURSOR)
AS
BEGIN
OPEN RS_CURSOR_LISTA FOR
SELECT IDPROCESO,CAMPO1
FROM TABLA1
WHERE FECHA BETWEEN FINI AND FFIN ;
END;
This is how I call this stored procedure from PowerBI:
DECLARE RS_CURSOR_LISTA SYS_REFCURSOR;
BEGIN
[STOREDPROCNAME]('01/01/2019','05/01/2019');
DBMS_SQL.RETURN_RESULT(RS_CURSOR_LISTA);
END;
And this is the error I get:
An error was encountered while trying to connect.
Details: "Oracle ORA-06550: line3, column1":
PLS-00201: Identifier 'SPU_LISTAR_1' must be declared
ORA-06550: PL / SQL: Statement ignored
pls-00302: Component 'RETURN_RESULT' must be declared
ORA-06550: PL / SQL: Statement Ignored

identifier 'DBMS_CDC_PUBLISH.CREATE_CHANGE_SET' must be declared

I am using oracle 11g express edition and I am getting the below error when trying to create a change set.
Error report -
ORA-06550: line 2, column 3:
PLS-00201: identifier 'DBMS_CDC_PUBLISH.CREATE_CHANGE_SET' must be declared
ORA-06550: line 2, column 3:
PL/SQL: Statement ignored
06550. 00000 - "line %s, column %s:\n%s"
*Cause: Usually a PL/SQL compilation error.
*Action:
I know CDC is desupported in later versions of oracle but I think it is supported here.
Can anyone help please/
Thanks in advance!
The problem is that you are using Express Edition, which does not include Change Data Capture functionality.
https://docs.oracle.com/cd/E17781_01/license.112/e18068/toc.htm#XELIC101

Does anyone know if the Control-M job designed to run stored procedure accepts parameter with ORACLE pre-defined table type "odcivarchar2list"

The procedure is running fine in the Oracle SQL developer. But when I want to run the same procedure using Control-M database job it is showing me below error:
Job failure message:
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'EXE_SUBPARTITION_PARAM_QRY'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Also while passing parameter list in Control-M, it is giving Parameter type as "UNDEFINED" for using ORACLE pre-defined table type "odcivarchar2list" in my procedure.
I know that BOOLEAN type is not supported by Control-M, is this applies to oracle pre-defined types too!
Many thanks for your help.

A type with declaration but without definition used throughout many packages

I have just started my adventure with Oracle and PL/SQL by analysing some legacy code.
I came across the following declaration which does not seem to have any definition (BODY)
CREATE OR REPLACE TYPE "TY_STRING_T";
but is used in many places throughout many packages. For example like this.
otc ty_string_t := ty_string_t();
I understand that this is like creation of an instance of class ty_string_t.
Then it is used for example as a collection.
otc.EXTEND;
otc(1) := 'test';
How come that this type is used that way while there is no definition of it at all? What am I missing? In SQL Developer under types there is no body part when I extend the node.
EDIT:
Searching for the dependencies in all_dependencies table gives the following result.
SELECT * FROM all_dependencies WHERE name = `TY_STRING_T`;
------------------------------------------------------------------------------------------------------------------------------
| OWNER | NAME | TYPE | REFERENCED_OWNER | REFERENCED_NAME | REFERENCED_TYPE | REFERENCED_LINK_NAME | DEPENDENCY_TYPE |
------------------------------------------------------------------------------------------------------------------------------
| AAA | TY_STRING_T | TYPE | SYS | STANDARD | PACKAGE | (null) | HARD |
------------------------------------------------------------------------------------------------------------------------------
The statement you show:
CREATE OR REPLACE TYPE "TY_STRING_T";
creates an incomplete object type:
Use the CREATE TYPE statement to create the specification of an object type, a SQLJ object type, a named varying array (varray), a nested table type, or an incomplete object type.
...
An incomplete type is a type created by a forward type definition. It is called "incomplete" because it has a name but no attributes or methods. It can be referenced by other types, and so can be used to define types that refer to each other. However, you must fully specify the type before you can use it to create a table or an object column or a column of a nested table type.
The object-relational developer's guide has more information about incomplete types and examples of using them.
That isn't what you have though. You are instantiating and populating a varray, not an object type. It would not compile the PL/SQL code with the incomplete type - you would get an PLS-00311: the declaration of "TY_STRING_T" is incomplete or malformed compilation error.
From comments you do not have an overriding PL/SQL type and (from chat) the all_dependencies view confirms that your packages are dependent on the SQL-level type. But it can't be defined the way you think it is.
You can check the current actual definition of the type with
select dbms_metadata.get_ddl('TYPE', 'TY_STRING_T') from dual;
With the statement you showed that returns:
DBMS_METADATA.GET_DDL('TYPE','TY_STRING_T')
--------------------------------------------------------------------------------
CREATE OR REPLACE TYPE "STACKOVERFLOW"."TY_STRING_T" ;
Again from chat, when you run that you really see:
CREATE OR REPLACE TYPE "AAA"."TY_STRING_T" as table of varchar2(32767);
which makes much more sense. Oracle won't have added the as table... part itself though - since it would have been happy leaving it as an incomplete object type; you just woudn't have been able to use it, certainly not as if it was a varray.
So some other part of your code base recreated the type with the new, full, definition; or someone manually recreated the type (before creating the packages that refer to it). If I had to speculate I'd think this might be a source code control problem - that incomplete code was checked in and shipped, and it had to be corrected on the fly in each environment as it was installed. Or possibly that the code had been changed after installation, to a version that is no longer correct.
The type name suggests it was always supposed to be a table of strings though, not an object type; and the truncated version of the create command that you found would never have actually created a varray.
You aren't really missing anything in your understanding, it's just that what you are looking at doesn't reflect reality.
CREATE OR REPLACE TYPE "AAA"."TY_STRING_T"
The above type creation is incomplete.
SQL> CREATE OR REPLACE TYPE "TY_STRING_T"
2 /
Type created.
SQL> DECLARE
2 otc ty_string_t := ty_string_t();
3 BEGIN
4 otc.EXTEND;
5 otc(1) := 'test';
6 end;
7 /
otc ty_string_t := ty_string_t();
*
ERROR at line 2:
ORA-06550: line 2, column 5:
PLS-00311: the declaration of "TY_STRING_T" is incomplete or malformed
ORA-06550: line 2, column 5:
PL/SQL: Item ignored
ORA-06550: line 4, column 1:
PLS-00320: the declaration of the type of this expression is incomplete or
malformed
ORA-06550: line 4, column 1:
PL/SQL: Statement ignored
ORA-06550: line 5, column 1:
PLS-00320: the declaration of the type of this expression is incomplete or
malformed
ORA-06550: line 5, column 1:
PL/SQL: Statement ignored
Reading the chat between OP and #AlexPoole,
CREATE OR REPLACE TYPE "TY_STRING_T" AS TABLE OF VARCHAR2(32767)
/
makes more sense.
SQL> CREATE OR REPLACE TYPE "TY_STRING_T" AS TABLE OF VARCHAR2(32767)
2 /
Type created.
SQL> DECLARE
2 otc ty_string_t := ty_string_t();
3 BEGIN
4 otc.EXTEND;
5 otc(1) := 'test';
6 end;
7 /
PL/SQL procedure successfully completed.

File Browser in Oracle Apex Application

I am working on an application in which I need a file browser to attach files. To achieve this I am using
jquery.fileupload[plug-in]
as item type. However, it is giving this error:
ORA-06550: line 4, column 50: PLS-00201: identifier 'PLUGIN_JQUERY_FILE_UPLOAD.PLUGIN_RENDER' must be declared ORA-06550: line 4, column 1: PL/SQL: Statement ignored
Help!

Resources