Questions tagged [varray]

VARRAY (variable-size arrays) is a PL/SQL datatype

Varrays (short for variable-size arrays) hold a fixed number of elements (although you can change the number of elements at runtime). They use sequential numbers as subscripts. You can define equivalent SQL types, allowing varrays to be stored in database tables. They can be stored and retrieved through SQL, but with less flexibility than nested tables.

Reference:

119 questions
3
votes
1 answer

How I can debug a stored procedure with a VARRAY parameter?

I have a little trouble to debug a procedure with two VARRAY parameter in TOAD. I have in my DB this VARRAY defined: CREATE OR REPLACE TYPE BDD_ACTIVOSEPAREP.TORDEN_CAMPO as VARRAY(7) of VARCHAR2(13); And now I want to debug a procedure that needs…
emilioxiri
  • 113
  • 2
  • 10
3
votes
1 answer

How best to store an array in Oracle?

I plan to create an Oracle database that will contain arrays of numeric data. Each array has from 2 to 4 dimensions, and on the order of 1000 data points. I will want to use the arrays in WHERE clauses, e.g. . Oracle's array support (VARRAYS,…
user3006778
  • 41
  • 1
  • 4
3
votes
1 answer

I want to insert a column values of a table into varray collection in PL/SQL

I want to insert a column values of a table into varray collection in PL/SQL. Could you please guide me through this
jeevan
  • 33
  • 1
  • 3
2
votes
0 answers

createArrayOf Not supported, How to insert or update anonymous type in oracle?

I am new to oracle.I had created varray type in oracle. And now want to insert the data and set using preparedStatement. I had done same implementation in postgres using createArrayOf. But oracle does not support createArrayOf with anonymous type. I…
Sakshi
  • 31
  • 1
2
votes
1 answer

Oracle PL/SQL: How to DEREF from a VARRAY of REFs?

I'm new to Oracle Objects and I have a problem. I don't know how to dereference an item from a VARRAY of REFs. Below is some source code that reproduces the problem that I have. The error is: PLS-00306: Wrong number or types of arguments in call to…
Bigba Mbum
  • 53
  • 2
  • 7
2
votes
1 answer

How to INSERT correctly in a VARRAY of TYPE OBJECT?

In this moment I'm working in SQL Developer and proving creation of different TYPES. For now this is the idea: CREATE OR REPLACE TYPE actividad_t AS OBJECT( nombre varchar2(50), contenido varchar2(50), plantilla varchar2(50), nota…
2
votes
1 answer

Oracle Apex - Save list of numbers in a varray-table-field

I have a table with varray of number field type aptitude_list as varray(60) of number and want to save/update a comma separated list from an apex-text-field in it. My SQL statement looks like : INSERT INTO tbl_aptitude (ID, APTITUDE) VALUES…
2
votes
1 answer

Using Oracle MEMBER OF operator with VARRAY columns in SQL

Consider the following script: CREATE TYPE t1 AS TABLE OF VARCHAR2(10); / CREATE TYPE t2 AS VARRAY(10) OF VARCHAR2(10); / CREATE TABLE t ( id NUMBER(10), t1 t1, t2 t2 ) NESTED TABLE t1 STORE AS t1_nt; INSERT INTO t VALUES (1, NULL,…
Lukas Eder
  • 211,314
  • 129
  • 689
  • 1,509
2
votes
1 answer

How do you use a packaged type as a column type in a table?

I'm currently trying to understand how to use a type I've created in a package as a column type in my table. Here is the code for my package... create or replace PACKAGE MY_TYPES IS --Associative Array Types TYPE permutation_array IS TABLE OF…
user2023068
  • 435
  • 1
  • 6
  • 14
2
votes
1 answer

How to initialize a varray table of {TABLE}%ROWTYPE?

I have a varray defined like: declare TYPE tnr_l IS VARRAY(30) of lve%ROWTYPE; I want this varray to be initialized with a fetch from the database: select * into tnr_l from lve where type = 'TNR' order by value; But this fails…
dr jerry
  • 9,768
  • 24
  • 79
  • 122
2
votes
1 answer

Create and populate Varray in Oracle SQL

I'm trying to créate a Varray of beans type and populate it, but I'm in a hurry and don't find any usefull example. arr=[[1,'A'],[2,'B'],[3,'C']] This is my code: create table my_table (NUM_OPERACIO NUMBER,TITULS varchar2(3)) ; insert into…
Israel Rodriguez
  • 425
  • 1
  • 6
  • 24
2
votes
2 answers

PL/SQL: ORA-00932: inconsistent datatypes: expected NUMBER got USER_NAME.VARCHAR_ARRAY

The below is a function that I am creating to accept an array of varchar2 items and return the internal pk of that record which is a NUMBER for each record. I am struggling to get the syntax right to pass an array of type VARCHAR_ARRAY to the simple…
Sanjay Rao
  • 547
  • 1
  • 11
  • 22
2
votes
2 answers

Error while passing object array from PLSQL to Java function

I have a type abc_type and an array of type abc_table. I am trying to pass an object array to a java function. create type abc_type authid definer as object ( file_name varchar2(5000), file_size number, file_paths varchar2(4000) …
jaekid
  • 31
  • 3
2
votes
1 answer

Return rows which contain a string in a collection

I am looking to return only the rows which contain a certain string in their VARRAY. Table Definition: create table studentClasses( student_id INTEGER, full_name VARCHAR2(30), phone_nos varray_num, classes varray_class, subjects_registered…
2
votes
1 answer

How can i pass multiple values to an array parameter function

i need your help.....how can i pass multi values into single parameter in a function? The values 'AAA 1','BBB 2', 'CCC 3' 'DDD 4' are to be passed to the same parameter "v_type", the values will be sent based on the selection from the drop down in…