Problem Dereferencing


Posted on 16th Feb 2014 07:03 pm by admin

With these types and tables:

CREATE TYPE MANAGER AS OBJECT (
MGR_ID INTEGER,
LAST_NAME VARCHAR(40),
FIRST_NAME VARCHAR(40),
PHONE char(10)
);

CREATE TABLE MANAGERS OF MANAGER OBJECT IDENTIFIER IS SYSTEM GENERATED;

CREATE TABLE STORES (
STORE_NO INTEGER,
LOCATION ADDRESS,
COF_TYPES COF_ARRAY,
MGR REF MANAGER SCOPE IS MANAGERS
);

and this code fragment from the JDBC Tutorial

ResultSet rs = stmt.executeQuery("SELECT * FROM STORES");
Ref managerRef = rs.getRef("MGR");
PreparedStatement pstmt = con.prepareStatement(
"SELECT MANAGER FROM MANAGERS WHERE OID = ?"
);
pstmt.setRef(1, managerRef);
ResultSet rs2 = pstmt.executeQuery();

I get ORA-00904: "OID": invalid identifier.

I think I need to use REF somehow instead of OID but I can't make it work.
"SELECT MANAGER FROM MANAGERS WHERE REF(MANAGER) = ?" results in ORA-00904: "MANAGER": invalid identifier

No comments posted yet

Your Answer:

Login to answer
144 Like 28 Dislike
Previous forums Next forums
Other forums

Cloud Computing?
Hello,

I was wondering if anyone could help explain this term to me. I'm starting to hear it

PHP5 - AJAX help
I've been following the tutorial on w2schools (http://www.w3schools.com/php/php_ajax_database.asp) a

Error in query: Resource id #4??
hey guys, having a minor (i think) problem here that i havent been able to figure out. long story sh

Error when call dll from oracle
Hi all, please help me!

I have dll write C language, I want call it from oracle procedur

PHP Error
On my .php page I have a drop down box that has several names in it. When a user clicks the name &am

need good snippet manager
Hi. as i am coding and learning more, it is becoming difficult to manage code snippets. how you mana

Transport data between itab and textfield on ALV event
Hallo,

I have a ALV Grid ( cl_gui_alv_grid ) and I also have hotspot click event with a h

Warning message
I've put a website that I was doing live and I'm getting this warning message when I try to add a ne

browse folder only
hi,
is there a way i can browse or get the directory or folder only and not the file?
i just w

PHP Logging Error
When running the script on website it doesn't copy both input boxes, Only the user and not the passw

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash