2

I have some types in Oracle.

create or replace
TYPE r_telefone_cand AS OBJECT (
    candidato NUMBER(10,0),
    telefone VARCHAR2(15)
);

create or replace TYPE t_telefone_cand AS TABLE OF r_telefone_cand;

create or replace
TYPE r_candidato AS OBJECT (
    codigo NUMBER(10,0),
    rg VARCHAR2(15),
    cpf NUMBER(15,0),
    nome VARCHAR2(50),
    telefone t_telefone_cand,
);

And I have a procedure insert_candidato that parameter candidato is IN r_candidato

create or replace
PROCEDURE insert_candidato(
    candidato IN r_candidato
) AS ...

But I don't know how to pass the parameter candidato with the collection telefone.

Please, help me.

2 Answers 2

1

Give a try using JPublisher of Oracle.. !

http://download.oracle.com/docs/cd/B10500_01/java.920/a96658/intro.htm

It helps in interacting with user defined DB objects through Java.

Sign up to request clarification or add additional context in comments.

Comments

1

You can use SQLData to map a java class to an oracle User Defined type. Check out the docs at http://download.oracle.com/javase/1.4.2/docs/api/java/sql/SQLData.html

In your case you'd need two types to match the db types.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.