473,396 Members | 2,151 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with the varray...

Hi.

Here is the code I tried for the use of the varray..I am trying to dump the values into the array using for loop.. But it's giving the error "error : Trying to access uninitialized object"

The reason I got.. because I am trying to access temp_array(0) before initializing it.But I want to put the elements dynamically into the database.

declare type array_var is varray(10) of number(10,2);
tem_array array_var;
begin
for i IN 0..9 loop
tem_array(i) := i+1;
end loop;
end;

Can anybody help me How can I achieve the functionality ..?

Thanks!
Feb 14 '09 #1
2 2080
debasisdas
8,127 Expert 4TB
try using the following code

Expand|Select|Wrap|Line Numbers
  1. declare 
  2. type array_var is varray(10) of number(10,2);
  3. tem_array array_var;
  4. begin
  5. for i IN 1..10 loop
  6. tem_array(i) := i+1;
  7. end loop;
  8. end;
  9.  
Feb 14 '09 #2
Saii
145 Expert 100+
declare
type array_var is varray(10) of number(10,2);
tem_array array_var :=array_var();
begin
for i IN 1..10 loop
tem_array.extend;
tem_array(i) := i+1;
end loop;
end;
Feb 19 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Tomislav Petrovic | last post by:
I have following code on my page.... $ora_tns = "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=pirana)(PORT=1521)) )(CONNECT_DATA=(SID=pirana)(SERVER=DEDICATED)))"; $ora_username =...
0
by: PedroSilva | last post by:
I need to know how to get a collection (varray), basically it's an array of chars with size of 9999 positions, from oracle so I can use it as an array with php. There's very little documentation...
1
by: KVN Chary | last post by:
I wrote a small package and it successfully compiled. When I test the package it was giving an error. Please look into the below code. Can anyone written Varrays as input and output variables in...
5
by: Irlan agous | last post by:
I have an echo php link with a javascript mouseout, why doesnt this work? <a href=\"$PHP_SELF?action=list_records&amp;cur_page=$varray&id=$id\" onmouseout=javascript:switchColors(this, 'yellow')>...
0
by: arvind | last post by:
Hello, We have been working on migrating oracle database to postgres for one of our client. We have a stored procedure in oracle which uses varray and I have to convert this stored procedure to...
3
by: Tony Marston | last post by:
I am using PHP 4.4.4 with Oracle 10g Express Edition on Windows XP. I am trying to emulate in Oracle the SET datatype in MySQL and the ARRAY datatype in PostgreSQL I have the created a...
0
by: Aravindkumar | last post by:
Hi My name is Aravind. I would like to know how VARRAY and NESTED TABLES can be used in Oracle Stored Procedures / Packages. Please treat this as urgent Aravind
1
by: dilippanda | last post by:
Hi Experts, Please explain me the difference between VARRAY and Nested Table in PL/SQL with example. Waiting for your comments. Thanks, Dilip
3
by: PANIGRAHI | last post by:
hi friend, let i am using varray in procedure .then how to call it. Regards Rabindra
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.