SQL & PL/SQL :: Error In Oracle Collection

Aug 8, 2011

I got error in oracle collection

CREATE OR REPLACE PACKAGE BODY pkg_das_stag_to_master
AS
PROCEDURE sp_load_dasstage_security
AS
cursor cur_stag is
select Asset_id,
ID_ISIN,
ID_SEDOL1,
ID_CUSIP,
[code].........

error:

66/35 PLS-00302: component 'ASSET_ID' must be declared
66/35 PLS-00302: component 'ASSET_ID' must be declared
66/18 PL/SQL: ORA-00904: "TYP_SECURITY_VAR"."ASSET_ID": invalid identifier
63/1 PL/SQL: SQL Statement ignored

View 2 Replies


ADVERTISEMENT

SQL & PL/SQL :: Error In Calling Collection Procedure

Jun 4, 2013

In a package I have one procedure "setscores_ram_bulk" with collection varaiavles.And other two procedures are

"UpdateRelatedOrders" and "SetGeoFraudScore"

with out collections.I am calling collection procedure "setscores_ram_bulk" in non collection procedures

"UpdateRelatedOrders" and "SetGeoFraudScore".

I am getting the below error.PLS-00306:wrong number or types of arguments in call to 'SETSCORES_RAM_BULK' .I am sending my code.

CREATE OR REPLACE PACKAGE GAFT_PROG_DIT.INTERNAL_SCORING_setscore_Bulk
IS
TYPE rec_setscores IS RECORD
(
pBUID score.buid%TYPE,
OrderNum score.order_num%TYPE,
ScoreType VARCHAR2(100),
p_Score score.velocity_score%TYPE
);
[code]....

View 19 Replies View Related

SQL & PL/SQL :: Error In Reading Data From Collection Variable For Ref Cursor

Jun 19, 2013

While reading data from collection variable using ref cursor . I am getting the below two errors.

PLS-00382:Expression is of wrong type
ORA-22905 Cannot access rows from a non-nested table item.

CREATE OR REPLACE PACKAGE APPS_GLOBAL.GIIOMEGAORDERLIST
AS
TYPE BU_LIST_TYPE IS TABLE OF VARCHAR(50);
TYPE OFFER_DETAIL IS RECORD
(
GII_BU VARCHAR(50),
GII_OFFER NUMBER,
[code]........

View 4 Replies View Related

SQL & PL/SQL :: Various Collection Types Available In Oracle 9i?

Jun 15, 2010

What are the various collection types available in Oracle 9i.

Mention the differences between them.

View 4 Replies View Related

Stats Collection In Oracle 11g

Nov 9, 2013

while doing stats collection weather system takes the backup of current statistics. i think we can specify stattab. but weather it takes stats backup before over writing? I got this requirement as a part of upgrade, i have already gone through export_schema_stats and import_schema stats already.  Just trying all other possible options only.

View 4 Replies View Related

PL/SQL :: Related Collection Within A Collection

Sep 20, 2012

There is a nested table with in a nested table type and i want to print the value and again assign a new value to the next subscript and i have tried a lot but couldn't find any solution.

declare
type type_name is table of varchar2(10);
type type_name1 is table of type_name;
names type_name1:=type_name1(type_name('hello'));
begin
-----HOW TO PRINT A VALUE--------
-----HOW TO ASSIGN A NEW VALUE TO NEW SUBSCRIPT
null;
end;

1) need to print the values of names(1)
2)Assign a value to names(2)

View 3 Replies View Related

PL/SQL :: How To Create One-column Collection From Another Multi-column Collection

Mar 22, 2013

I am describing a SQL statement to get it's column list:DECLARE

cur     NUMBER;
col_cnt INTEGER;
rec_tab DBMS_SQL.DESC_TAB;

[Code]....

Now I need to get out the columns list from rec_tab.col_name and put it to my_colls collection. Have Oracle any build-in to do that?

View 4 Replies View Related

SQL & PL/SQL :: Backward Accessing Super Type Attributes From Sub-type Body In Oracle Collection?

Jan 2, 2013

I have 3 user defined collection types. I am trying to access the type3's attribute in type1 body (like backward accessing).

Ex. My Collection Types Structure (something like master detail structure)

create type type1 as object
(
attr1 varchar2(10),
attr2 varchar2(10),
member procedure function1

[code]...

so, in the type1 body i have to get or assign the value either to type2's attribute or type3's attribute. I have search all the in internet but i haven't find anything such. how to find the reverse method of accessing the super type's attribute(s) in sub type's body.

View 3 Replies View Related

SQL & PL/SQL :: Collection Over Cursor?

Jun 30, 2010

What is the advantage of collections over CURSOR? What is the use for collections and when collections is used?

View 1 Replies View Related

SQL & PL/SQL :: Collection Of Records

Sep 29, 2010

I have been doing some code in collection for testing. I have been doing the below but getting the error.

SQL> desc t_mine;
Name Null? Type
----------------------------------------------------- --------
OWNER NOT NULL VARCHAR2(30)
OBJECT_NAME NOT NULL VARCHAR2(30)

SQL> ed
Wrote file afiedt.buf

1 declare
2 v_start_time PLS_INTEGER := DBMS_UTILITY.GET_TIME;
3 v_elapsed PLS_INTEGER;
4 type allobjects_record is record
5 (owner varchar2(1000)
[code].......

ERROR at line 15:

ORA-06550: line 15, column 15:
PL/SQL: ORA-00947: not enough values
ORA-06550: line 15, column 3:
PL/SQL: SQL Statement ignored

I followed the below link

[URL].......

View 5 Replies View Related

SQL & PL/SQL :: Table Variable Or Collection

Jul 11, 2012

Is there any table except (global temp table and permanent table) which can be used to store data and be used in inner, left and right join for a session.

View 7 Replies View Related

SQL & PL/SQL :: How To Remove Duplicates From Collection

Mar 24, 2011

remove duplicates from my collection(table type).Or an alternate solution for my issue is get clean data into my collection which i am not able to get to either.

Object creation

create table testingtype_table(ordernumber number,org_id number , company_name varchar2(10))
insert into testingtype_table values (1124,2424,'cbaaa');
insert into testingtype_table values (1124,2424,'cbaaa');

create or replace type testingtype_obj as object (ordernumber number,org_id number , company_name varchar2(10));
create or replace type testingtype_tab as table of testingtype_obj;

Code Block
declare
l_testingtype_tab testingtype_tab := testingtype_tab();
begin
select distinct testingtype_obj(ordernumber
,org_id
,company_name)
bulk collect into l_testingtype_tab
from testingtype_table;
end;

If only i can get a way to bulk collect only distinct values into the table type that will just do great but when i try the above (with distinct highlighted in red) it throws an error

ORA-22950: cannot ORDER objects without MAP or ORDER method

View 4 Replies View Related

SQL & PL/SQL :: Using Collection Variable As OUT Parameter

Aug 8, 2012

The following procedure stores the retrieved data in o_ref_primary_dept collection variable, suppose I want to display the data from that variable while executing what code I have to write.

CREATE OR REPLACE PROCEDURE sp_ost(
o_ref_primary_dept OUT PRIMARY_DEPT)
IS
l_primary_dept LONG;
[code].....

how to use collection variables as OUT parameters in procedure.

View 1 Replies View Related

SQL & PL/SQL :: Populating Ref Cursor From Collection?

Aug 17, 2011

I have an existing Procedure that uses a ref cursor as a parameter. The procedure currently simply selects data into the ref cursor using an OPEN FOR and then exits.

I have a need to extend the processing of the procedure. This will mean retrieving extra columns in the select and also removing some of the retrieved records.

I have the constraint that the definition of the REF CURSOR (which is based on a record type as follows) cannot be modified.

TYPE t_charge
IS
RECORD (
id number,
date_from invoice_detail.from_date%TYPE,
date_to invoice_detail.to_date%TYPE,
description invoice_detail.desc_text%TYPE,
amount invoice_detail.amount%TYPE
);
TYPE t_charge_cursor IS REF CURSOR RETURN t_charge;

The procedure does this

PROCEDURE get_bill_lines (
p_bill_id IN NUMBER,
bill_lines_list OUT t_charge_cursor )
IS
OPEN bill_lines_list FOR
SELECT id, from_date, to_date, desc_text, amount
from invoice_table
where id = p_bill_id;

I am thinking instead of selecting directly into the bill_lines_list parameter I will use a local REF CURSOR to select into a COLLECTION. I can then do some work on the collection, similar to below:

PROCEDURE get_bill_lines (
p_bill_id IN NUMBER,
bill_lines_list OUT t_charge_cursor )
TYPE t_local_charge
IS
RECORD (

[code].....

This all works fine, but the question is, how do I then put the collection into the bill_lines_list REF CURSOR where the '*** HERE ***' comment is so I can send the existing REF CURSOR structure back? (Remember I cannot change any definition that is referenced externally)

View 4 Replies View Related

SQL & PL/SQL :: Append Collection Variable

Oct 11, 2012

Declare
Cursor c1...;
Cursor c2...;
begin
open c1 ;
fecth c1 bulk collect into v1;
close c1;

[Code]...

Is there any way by which if condition gets true then v1 gets appended rather than being overwritten?

declare
type lst_deptno is table of dept.deptno%type index by binary_integer;
type lst_deptno_emp is table of emp.deptno%type index by binary_integer;
v_deptno lst_deptno;
v_deptno_emp lst_deptno_emp;
cursor c1 is select deptno from dept;

[Code]...

View 8 Replies View Related

SQL & PL/SQL :: Searching Collection For A Specific Value?

Oct 18, 2011

I need to check if a small collection contains a specific value. I know I can use the .exist method to let me know if the nth element exists. But is there a similar syntax for checking if an actual value exists?

So the below collection has 6 values (300,301,310,320,400,410) after the cursor values are fetched. I want to use something similar to the below exists syntax in order to search the collection for a value (rather than position) within an IF statement.

The below code shows the kind of thing I want to do. Currently, unless my test value (310) is in the range 1 to 6 the test will always return FALSE. But is there a similar syntax for testing against the value?

The example I have given is a simplification of what I need. In reality there will be more than one test value... returned by another cursor.

DECLARE
CURSOR c_type_id_usg
IS

[Code]....

-- get the list of sms type id usg values
OPEN c_type_id_usg;
FETCH c_type_id_usg bulk collect into l_type_ids;
CLOSE c_type_id_usg;

-- the above returns value 300,301,310,320,400,410

IF l_type_ids.exists(310)
then
dbms_output.put_line('I have found an entry ');
else
dbms_output.put_line('I have NOT found an entry ' );
end if;
END;

View 2 Replies View Related

PL/SQL :: How To Handle Breaks On Collection

Oct 22, 2012

I'm working on a plsql program and i'm using collections. I loop the collection and delete rows of it depending on the edits of my program. Here is the question.

if my collection holds
rows
[1]value
[2]value
[3]value

i can simply do something like FOR indx in invoice.first..invoice.lasthowever if i delete row 2 of my collection i get an error. no data found.
ive been researching this site

[URL].......

rows
[1]value
[3]value
[4]value

is there a way to tell plsql i just want it to loop the collection from top to bottom regardless of the index values?

View 2 Replies View Related

PL/SQL :: Using Collection Variable With OUT Parameter?

Aug 8, 2012

The following procedure stores the retrieved data in o_ref_primary_dept collection variable,suppose I want to display the data from that variable while executing what code I have to write.

CREATE OR REPLACE PROCEDURE sp_ost(
o_ref_primary_dept OUT PRIMARY_DEPT)
IS
l_primary_dept LONG;
BEGIN
l_primary_dept :=
'SELECT emp_obj(empno,ename)'
|| ' FROM emp';
EXECUTE IMMEDIATE l_primary_dept BULK COLLECT INTO o_ref_primary_dept;
END;

how to use collection variables as OUT parameters in procedure.

View 1 Replies View Related

PL/SQL :: Using Collection As Input For Cursor?

Oct 29, 2013

In PL/Sql, I create a new collection using TYPE. Then populate it with BULK COLLECT.The next step I need is to load data from the collection to pass as WHERE condition to a ref cursor.How I can do this?Every test I did fais. It seems to me that I cannot use some kind of SELECT to retrieve all data from the collection, but I might use a cursor to read row by row. (I'm on Oracle 11gR2 DB )

View 3 Replies View Related

SQL & PL/SQL :: Complex Bulk Collection?

Mar 25, 2011

I have the following questions you can create a bulk collect in which he has 3 fields and one of them is a type collect failing index or other bulk collect?.If so, how would the procedure for when to insert the first record sub ​​fill the bulk collect. being for example something like this:

-----------------------------------------------------------------
index | codigo | nombre | telefono
| | |-----------------------
| index | telefono
-----------------------------------------------------------------
| | | |

[code]...

View 2 Replies View Related

No Module Requiring Data Collection

Dec 1, 2010

I am getting the below output when I tried to take the "Payables" RDA from command-line (Application RDA is failing to collect) I am getting the below output.

appldev@devpi:/home/appldev>cd $IZU_TOP/bin
appldev@devpi:/d02/appldev/apps/apps_st/appl/izu/12.0.0/bin>./rda.sh -vdCRP -e APPL_SHORT='SQLAP' ACT
Collecting diagnostic data ...
No module requiring data collection
Generating the reports ...
No pending report

[code]....

why it is saying that "No module requiring data collection"?

View 1 Replies View Related

How To Remove Duplicate Record From A Collection

Jan 26, 2011

I have following query:
type EMP_REC is record
(
id number,
name varchar2(20),
dept number
);

type EMP_TBL IS TABLE OF EMP_REC INDEX BY BINARY_INTIGER;
EMP_TABL1 EMP_TBL;

select * BULK COLLECT into EMP_TBL1
FROM emp;

How to remove duplicate records from EMP_TBL1 collection if exists.I don't want to remove duplicate records from main table. But actually want to remove duplicate records from EMP_TBL1 collection if exists.

View 1 Replies View Related

10.2.0.4.0 Two Node RAC - Collection Cause Database Performance To Go Down In AWR?

Jul 16, 2012

we had an issue with our 10.2.0.4.0 two node RAC Database where when running stats collection caused the database performance to go down and in AWR I noticed the following:

Top 5 Timed Events
Event Waits Time(s) Avg Wait(ms) % Total Call Time Wait Class
gc buffer busy 95,077 73,786 776 76.0 Cluster
cursor: pin S wait on X 3,524,808 54,467 15 56.1 Concurrency
library cache lock 30,223 13,660 452 14.1 Concurrency
gc cr request 2,876 3,594 1,250 3.7 Cluster
library cache pin 1,740 1,800 1,035 1.9 Concurrency

when looked under Library Cache Activity section in the AWR report, I see the following:

Namespace Get Requests Pct Miss Pin Requests Pct Miss Reloads Invali- dations
BODY 59 3.39 3,056 0.13 1 0
CLUSTER 70 0.00 73 0.00 0 0
INDEX 178 0.00 925 0.00 0 0
SQL AREA 423,064 50.25 2,465,209 2.37 182 119,671
TABLE/PROCEDURE 1,848 21.27 22,638 0.62 70 0
TRIGGER 14 0.00 1,801 0.06 1 0

does this mean, we are having memory crunch for this instance on node 1? we have sga_target=26gb and sga_max_size=32gb set for this instance.

View 2 Replies View Related

SQL & PL/SQL :: Dynamic SQL Returning Clause Into Collection

Nov 8, 2010

I have been testing some functionalist, I have been trying to get the updated dept no values into an array and then print the count. But i am getting the following error.

I have implemented, the whole example is to know about 'dynamic sql returning clause into collection'

s@ORCL> select * from t_dept;

DEPTNO DNAME LOC
---------- -------------- -------------
10 comp NEW YORK
20 Compt DALLAS
30 SALES CHICAGO
40 OPERATIONS BOSTON
60 Comp Ahaaa
80 data ab
80 data ab
80 data ab
80 data ab

9 rows selected.

s@ORCL> ed
Wrote file afiedt.buf

1 declare
2 type tp_dept is table of number;
3 arr_dept tp_dept;
4 begin
5 execute immediate q'['update t_dept set dname = 'Pointers' where deptno = 80 returning deptno into :out]'
6 returning into arr_dept;
7 dbms_output.put_line('The count is '||arr_dept.count);
8* end;
s@ORCL> /
returning into arr_dept;
*
ERROR at line 6:
ORA-06550: line 6, column 19:
PLS-00597: expression 'ARR_DEPT' in the INTO list is of wrong type
ORA-06550: line 5, column 4:
PL/SQL: Statement ignored

View 4 Replies View Related

SQL & PL/SQL :: Sorting Collection In Nested Table

Sep 11, 2012

I'm trying to sort a collection in a nested table in PL/SQL so these value can be used later for a display and for export to Excel. The sort is failing.

-- PLS-00642: local collection not allowed in SQL statements

-- PL/SQl: ORA-00902: invalid datatype

The error message are also noted below in the code on the line that fails.

A quick overview of this code- Using a nested table MyNestedTable the values from several select queries are combined into MyRecordsetZero using CURSOR, and MULTISET UNION. I'm trying to either sort MyRecordsetZero or populate MyRecordsetSorted with the sorted values for futher use.

IMPORTANT: The code is running in an enviroment that does not have permission to create.

Versions:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Developer: 8.0.0.1480

DECLARE
-- Declare the variable MyTID to be used by select statements and
-- set its data type and max character count
MyTID varchar2(10);
[code]....

View 13 Replies View Related

SQL & PL/SQL :: Get The Distinct Elements Of A Collection Of Objects

Oct 7, 2010

I have a collection of objects built in a PL/SQL program.

I want to keep only the distinct elements of this collection for the rest of the program.

I failed to find the correct way to do it

For instance (the actual object is far more complex containing object attributes itself), with the following types:

drop type t1b
/
drop type t1a
/
create or replace type t1a as object (
v1 integer,
v2 integer
)
/
create or replace type t1b as table of t1a
/
I have the following variable:

v t1b := t1b(t1a(1,2),t1a(1,2));

And I want to get only one "t1a(1,2)" in my collection.

My first idea (actually the second one but it does not matter) was to use DISTINCT:

SQL> declare

2 v t1b := t1b(t1a(1,2),t1a(1,2));
3 begin
4 select distinct t1a(v1,v2) bulk collect into v from table(v);
5 dbms_output.put_line(v.count);
6 end;
7 /
declare
*
ERROR at line 1:

ORA-22950: cannot ORDER objects without MAP or ORDER method ORA-06512: at line 4

As I said the object is far more complex and builting a MAP function is quite tedious (but I will do it if there is no other way).

The next idea was to use multiset operators:

SQL> declare
2 v t1b := t1b(t1a(1,2),t1a(1,2));
3 begin
4 select v multiset intersect distinct v into v from dual;
5 dbms_output.put_line(v.count);
6 end;
7 /
1

PL/SQL procedure successfully completed.

This works well but I suspect this is not the correct way and there is one to do it in PL/SQL but currently failed to find it.

View 2 Replies View Related

SQL & PL/SQL :: Sorting Nested Table / Collection

Nov 10, 2011

In test.pks file I declared the following type

TYPE tab_tests is table of NUMBER(15);

In test.pkb, I have the following procedure

PROCEDURE report (
i_cid IN NUMBER
)
IS
test1 tab_tests := tab_tests();
test2 tab_tests;
BEGIN

-- I populate test1 with the data and it works fine. But when I tried to make a sorted nested table with the following command.

I got this error 'ORA-00902: invalid datatype',

a nested table than the following, like a built in Oracle collection method?

execute immediate 'select cast( multiset (select * from table(test1) order by 1) as tab_tests) INTO test2 FROM dual';
END;

View 16 Replies View Related

SQL & PL/SQL :: Dynamic Collection As Parameter To Procedure

Feb 20, 2010

I want to have a dynamic collection as a parameter to procedure.This collection should access dynamic column set.

while calling this proc user may not aware of what column set is going to be sent to this proc.

View 8 Replies View Related

SQL & PL/SQL :: ORA-06531 / Reference To Uninitialized Collection

Mar 1, 2013

I am getting the error ORA-06531: Reference to uninitialized collection while calling a table function which is of collection type.

CREATE OR REPLACE FUNCTION FN_GET_LINK_SYS_ID
RETURN PGIPK_DM_PROCESS.DM_SYSID
PIPELINED IS
T_SYS_ID PGIPK_DM_PROCESS.DM_SYSID;
BEGIN
T_SYS_ID := PGIPK_DM_PROCESS.DM_SYSID();

[code]....

Definition of Type is below

--NESTED TABLE TO STORE SYS_ID S OF TABLE
TYPE TAB_SYS_ID IS RECORD(
POL_NO VARCHAR2(60),
POL_END_NO_IDX NUMBER,
PSEC_SEC_CODE VARCHAR2(30),
PRAI_RISK_ID VARCHAR2(10),

[code]....

when i m writing select * from table(FN_GET_LINK_SYS_ID) , its throwing ORA-06531: Reference to uninitialized collection.

View 6 Replies View Related

SQL & PL/SQL :: Replace Temp Table With Collection?

Nov 4, 2011

how I can replace gtt in the following procedure with an Oracle Collection?

gtt or Collection is more efficient?
PROCEDURE report_gen (
i_table IN NUMBER
)
IS
BEGIN
create global temporary table test_gtt (tid NUMBER(15));

[code].....

View 6 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved