473,385 Members | 1,821 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,385 software developers and data experts.

user defined data types

Hi
how can I pass a user defined type or array of user defined type to a function?

type:
CREATE TYPE CARDDATARECTYPE AS (DATANAME VARCHAR(256), DATAVALUE VARCHAR(2048), ISDELETABLE SMALLINT )

By oracle jdbc I do this by following:

Expand|Select|Wrap|Line Numbers
  1. StructDescriptor cardStruct = StructDescriptor.createDescriptor("CARDDATARECTYPE",stmt.getConnection());
  2. ArrayDescriptor desc = ArrayDescriptor.createDescriptor("CARDDATARECARRAY",stmt.getConnection());
  3. Object[] arr = new Object[datas.length];
  4. for (int i = 0; i < this.datas.length; i++) {
  5.   Object[] cardData = {datas[i].getName(), datas[i].getValue(), (datas[i].getDeletable() ? "1" : "0")};
  6.         STRUCT p1struct = new STRUCT(cardStruct, stmt.getConnection(), cardData);
  7.         arr[i] = p1struct;
  8.       }
  9.       ARRAY oraArr = new oracle.sql.ARRAY(desc, stmt.getConnection(), arr);
  10.       stmt.setObject(13, oraArr, oracle.jdbc.driver.OracleTypes.ARRAY);
  11.  
thanks alot
Jan 26 '08 #1
0 2889

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

Similar topics

1
by: Guilherme Pinto | last post by:
Hello. I am reading the book written by Bjarne Stroustrup called " The C++ Programming Language - Special Edition" and had a doubt which a think is really important to distinguish between the...
3
by: Kunle Odutola | last post by:
I have a database that tracks players for children's sports clubs. I have included representative DDL for this database at the end of this post. A single instance of this database supports...
1
by: Robbie | last post by:
Hi Guys Wonder if you could help me. Basically I produce an accounts package that uses a SQL 2000 DB as the RDBMS. I always instruct users to login as 'sa' and the relevant password when...
2
by: Miles Ashton | last post by:
A common request for enhancement to applications is to "make this field bigger". I know I've been caught with increasing a field size, and then spending hours debugging because another stored proc...
13
by: dawatson833 | last post by:
I have several stored procedures with parameters that are defined with user defined data types. The time it takes to run the procedures can take 10 - 50 seconds depending on the procedure. If I...
2
by: Les Stockton | last post by:
In VB6 you had a Type and End Type to define your own data types. Are the only ways to do this in VB.Net with enums, struct and class. How's the best way to define user defined types?
2
by: Jonathan Daugherty | last post by:
Hello, I'm trying to write a PL/PgSQL function whose sole parameter is an array whose element type is a type that I've created. For example: CREATE TYPE test_type AS (x bigint, y bigint); ...
27
by: Randy | last post by:
Is there a way to override operators for user-defined types (e.g., typedefs) rather than class types? I'm trying to override the extractor operator for a user-defined enumeration type but...
4
by: Anamika | last post by:
I want to create a map,which will be having string as a key and the related data as a structure... So can I use user defined data types as the data in maps? If so How I can use it... What is...
3
by: vasili | last post by:
hello All, I have a simple issue. I defined a custom container, that encloses a std::list, which in turn holds objects that are a simple abstraction of a six position array. Now, i would like...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.