Home
All Oracle Error Codes
Oracle DBA Forum

Frequent Oracle Errors

TNS:could not resolve the connect identifier specified
Backtrace message unwound by exceptions
invalid identifier
PL/SQL compilation error
internal error
missing expression
table or view does not exist
end-of-file on communication channel
TNS:listener unknown in connect descriptor
insufficient privileges
PL/SQL: numeric or value error string
TNS:protocol adapter error
ORACLE not available
target host or object does not exist
invalid number
unable to allocate string bytes of shared memory
resource busy and acquire with NOWAIT specified
error occurred at recursive SQL level string
ORACLE initialization or shutdown in progress
archiver error. Connect internal only, until freed
snapshot too old
unable to extend temp segment by string in tablespace
Credential retrieval failed
missing or invalid option
invalid username/password; logon denied
unable to create INITIAL extent for segment
out of process memory when trying to allocate string bytes
shared memory realm does not exist
cannot insert NULL
TNS:unable to connect to destination
remote database not found ora-02019
exception encountered: core dump
inconsistent datatypes
no data found
TNS:operation timed out
PL/SQL: could not find program
existing state of packages has been discarded
maximum number of processes exceeded
error signaled in parallel query server
ORACLE instance terminated. Disconnection forced
TNS:packet writer failure
see ORA-12699
missing right parenthesis
name is already used by an existing object
cannot identify/lock data file
invalid file operation
quoted string not properly terminated

Re: Inserting records in a cursor

Juan Cachito Reyes Pacheco

2004-03-04

Replies:
Thanks, I did something similar
----- Original Message -----
From: "GovindanK" <gkatteri@(protected)>
To: <oracle-l@(protected)>
Sent: Thursday, March 04, 2004 11:45 AM
Subject: Re: Inserting records in a cursor


> May be this is what you need
>
> SQL*Plus: Release 9.2.0.1.0 - Production on Sat Jun 15
> 01:03:12 2002
>
> Copyright (c) 1982, 2002, Oracle Corporation. All
> rights reserved.
>
>
> Connected to:
> Oracle9i Enterprise Edition Release 9.2.0.1.0 -
> Production
> With the Partitioning, OLAP and Oracle Data Mining
> options
> JServer Release 9.2.0.1.0 - Production
>
> SQL>
> SQL> set serveroutput on size 1000000;
> SQL> set echo on
> SQL> create table my_emp(empno number , empsal number)
>  2 /
>
> Table created.
>
> SQL> begin
>  2   insert into my_emp values(1001, 1000);
>  3   insert into my_emp values(1002, 2000);
>  4   insert into my_emp values(1003, 3000);
>  5 end;
>  6 /
>
> PL/SQL procedure successfully completed.
>
> SQL> CREATE or REPLACE TYPE my_record_type as OBJECT
>  2 ( xempsal       NUMBER )
>  3 /
>
> Type created.
>
> SQL> CREATE or REPLACE TYPE my_table_type as TABLE of
> my_record_type
>  2 /
>
> Type created.
>
> SQL> declare
>  2 buf_data my_table_type := my_table_type() ;
>  3 begin
>  4   buf_data.EXTEND ;
>  5   buf_data(1) := my_record_type(1000) ;
>  6   buf_data.EXTEND ;
>  7   buf_data(2) := my_record_type(2000) ;
>  8   FOR CX in
>  9   (
> 10   select a.empno , a.empsal
> 11     from
> 12        (select empno , empsal from my_emp) a
> 13       ,TABLE ( cast( buf_data as my_table_Type) ) y
> 14    WHERE y.xempsal = a.empsal
> 15   )
> 16   loop
> 17     dbms_output.put_line('EmpNo ='||cx.empno||' qualifies');
> 18   end loop;
> 19 end;
> 20 /
> EmpNo = 1001 qualifies
> EmpNo = 1002 qualifies
>
> PL/SQL procedure successfully completed.
>
> SQL> set echo off
> SQL> set echo on
> SQL> declare
>  2 buf_data my_table_type := my_table_type() ;
>  3 begin
>  4   buf_data.EXTEND ;
>  5   buf_data(1) := my_record_type(1000) ;
>  6   buf_data.EXTEND ;
>  7   buf_data(2) := my_record_type(2000) ;
>  8   FOR CX in
>  9   (
> 10   select a.empno , a.empsal
> 11     from
> 12       TABLE ( cast( buf_data as my_table_Type ) ) y
> 13       ,(select empno , empsal from my_emp) a
> 14    WHERE y.xempsal = a.empsal
> 15   )
> 16   loop
> 17     dbms_output.put_line('EmpNo = '||cx.empno||' qualifies');
> 18   end loop;
> 19 end;
> 20 /
> EmpNo = 1001 qualifies
> EmpNo = 1002 qualifies
>
> PL/SQL procedure successfully completed.
>
> SQL>
>
>
>
> Jamadagni, Rajendra wrote:
>
> >Me too lazy ...
> >
> >Raj
>
>---------------------------------------------------------------------------
-----
> >Rajendra dot Jamadagni at nospamespn dot com
> >All Views expressed in this email are strictly personal.
> >select standard_disclaimer from company_requirements;
> >QOTD: Any clod can have facts, having an opinion is an art !
> >
> >
> >-----Original Message-----
> >From: oracle-l-bounce@(protected)
> >[mailto:oracle-l-bounce@(protected)
> >Sent: Wednesday, March 03, 2004 3:59 PM
> >To: 'oracle-l@(protected)'
> >Subject: RE: Inserting records in a cursor
> >
> >
> >Excellent spanglish!
> >
> >-----Original Message-----
> >From: Jamadagni, Rajendra [mailto:Rajendra.Jamadagni@(protected)]
> >Sent: Wednesday, March 03, 2004 2:56 PM
> >To: oracle-l@(protected)
> >Subject: RE: Inserting records in a cursor
> >
> >CREATE OR REPLACE TYPE ctb.tyo_cco_imputacion AS OBJECT(
> >nTotal NUMBER,
> >cCCO1 VARCHAR2(9),
> >cCCO2 VARCHAR2(9),
> >cCCO3 VARCHAR2(9),
> >cCCO4 VARCHAR2(9),
> >cCCO5 VARCHAR2(9),
> >nMonto NUMBER(16,2))
> >/
> >
> >CREATE OR REPLACE TYPE ctb.typ_cco_imputacion AS TABLE OF
> >CTB.TYO_CCO_IMPUTACION;
> >/
> >
> >create functoin load return ctb.typ_cco_imputacion is
> >TuBLA ctb.typ_cco_imputacion;
> >begin
> > for i in 1 .. 10
> > loop
> >   TUBLA(i).nTotal := i;
> >   TUBLA(i).cCCO1 := 'ccol1 ' || i;
> >   TUBLA(i).cCCO2 := 'ccol2 ' || i;
> >   TUBLA(i).cCCO3 := 'ccol3 ' || i;
> >   TUBLA(i).cCCO4 := 'ccol4 ' || i;
> >   TUBLA(i).cCCO5 := 'ccol5 ' || i;
> >   TUBLA(i).nMonto := i;
> > end loop;
> >retturn tubla;
> >end;
> >/
> >
> >something like this should work ...
> >Raj
>
>---------------------------------------------------------------------------
-
> >----
> >Rajendra dot Jamadagni at nospamespn dot com
> >All Views expressed in this email are strictly personal.
> >select standard_disclaimer from company_requirements;
> >QOTD: Any clod can have facts, having an opinion is an art !
> >
> >
> >-----Original Message-----
> >From: oracle-l-bounce@(protected)
> >[mailto:oracle-l-bounce@(protected)
> >Pacheco
> >Sent: Wednesday, March 03, 2004 3:43 PM
> >To: oracle-l@(protected)
> >Subject: Re: Inserting records in a cursor
> >
> >
> >Could you please give a complete example creating a cursor, and adding
> >values and returning :) pleeease... if I'm not abusing of you.
> >I'm getting other error messages.
> >
> >
> >declare
> >
> > Tabla ctb.typ_cco_imputacion;
> >
> >begin
> >
> >Tabla(1).ntotal := 1;
> >
> >Tabla(2).ntotal := 1;
> >
> >Tabla(3).ntotal := 1;
> >
> >tabla(4).ntotal := 1;
> >
> >--RETURN Tabla;
> >
> >rollback;
> >
> >end;
> >
> >16:39:00 ORA-06531: Referencia a una recopilaciĆ³n no inicializada
> >
> >----- Original Message -----
> >From: "Jamadagni, Rajendra" <Rajendra.Jamadagni@(protected)>
> >To: <oracle-l@(protected)>
> >Sent: Wednesday, March 03, 2004 4:16 PM
> >Subject: RE: Inserting records in a cursor
> >
> >
> >you are probably confused between a table (a rdbms entity) and a
collection
> >(aka pl/sql table). Collections do not use DML statements, you need to
treat
> >them like arrays ... that's what they are.
> >
> >tubla[1].ntotal := 1;
> >tubla[2].ntotal := 1;
> >tubla[3].ntotal := 1;
> >tubla[4].ntotal := 1;
> >
> >Raj
>
>---------------------------------------------------------------------------
-
> >----
> >Rajendra dot Jamadagni at nospamespn dot com
> >All Views expressed in this email are strictly personal.
> >select standard_disclaimer from company_requirements;
> >QOTD: Any clod can have facts, having an opinion is an art !
> >
> >
> >-----Original Message-----
> >From: oracle-l-bounce@(protected)
> >[mailto:oracle-l-bounce@(protected)
> >Pacheco
> >Sent: Wednesday, March 03, 2004 3:07 PM
> >To: oracle-l@(protected)
> >Subject: Inserting records in a cursor
> >
> >
> >Hi, maybe this is a stupid question, but I didn't it before, I want to
> >create a cursor load data, and return in in a funciton
> >something like
> >
> >If you can please, thank you.
> >CREATE OR REPLACE
> >
> >TYPE ctb.tyo_cco_imputacion AS OBJECT
> >
> >(
> >
> >nTotal NUMBER,
> >
> >cCCO1 VARCHAR2(9),
> >
> >cCCO2 VARCHAR2(9),
> >
> >cCCO3 VARCHAR2(9),
> >
> >cCCO4 VARCHAR2(9),
> >
> >cCCO5 VARCHAR2(9),
> >
> >nMonto NUMBER(16,2)
> >
> >)
> >
> >/
> >
> >CREATE OR REPLACE
> >
> >TYPE ctb.typ_cco_imputacion AS TABLE OF CTB.TYO_CCO_IMPUTACION;
> >
> >/
> >
> >
> >
> >create functoin load return ctb.typ_cco_imputacion
> >
> >TuBLA typ_cco_imputacion;
> >
> >begin
> >
> >insert into TUBLA values(1,2,3,4);
> >
> >insert into TUBLA values(1,4,3,4);
> >
> >....
> >
> >retturn tubla
> >
> >end;
> >
> >
> >
> >
>
>
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request@(protected)
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>


----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request@(protected)
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------