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

How to use Substr
I want to check for the word CATEGORY: inside a string which can be CATEGORY: ITEM
and remove the

duplicate record notification
In my database, after insertion of records, I want to know if the record inserted is duplicate or no

array_combine() error
getting an "Warning: array_combine() [function.array-combine]: Both parameters should have an e

Get to know your fellow coder
I think it's time we got personal around here. There's a lot of code swapping and a few members kno

Redirecting Admin
In my members table, I have a field called "perm" and it's set to zero for all members. Ho

Can I use a loop
Hi buddies!

Once again with my doubts here.

Right now I am using this sql stat

Variable Clash
In the past I've had variables clash. For example:

Code: <?php
$c = 5;
$ca

Redistributing dependent dlls
Hai all ,

I have created an application in VC++ using VS2008 in a development machine which r

Why is this query failing?
Why is this not working?
$query = "SELECT * FROM `users` WHERE `userid` = " . $USERID

Extracting URL pointer within XML tag
Hi.

I'm trying to extract text between two quotation marks in XML. For example, I want to ex

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