Re: Problem with Oracle adapter and update
Re: Problem with Oracle adapter and update
- Subject: Re: Problem with Oracle adapter and update
- From: shaun <email@hidden>
- Date: Wed, 11 Oct 2006 13:07:13 +0930
Hi,
Tarun Reddy wrote:
On Oct 10, 2006, at 8:02 PM, shaun wrote:
Hi,
Tarun Reddy wrote:
On Oct 10, 2006, at 7:02 PM, Art Isbell wrote:
On Oct 10, 2006, at 2:36 PM, Tarun Reddy wrote:
Trying this in sqlplus with this statement:
UPDATE IDEA SET STATUS = "A" WHERE (IDEA_OID = 1 AND AVGRATING is
NULL AND CATEGORY_OID = 6 AND IDEADESC = "afdsafadsfasfa" AND
IDEANAME = "fdsfadf" AND IDEAURL is NULL AND NUMRATINGS is NULL
AND PARENT_OID is NULL AND STATUS = "P" AND SUBMIT_DATE =
"2006-10-08 00:00:00" AND USER_OID = 1)";
returns:
ERROR:
ORA-00972: identifier is too long
You have an unmatched double quote near the end of the above
statement. This might cause the error in your sqlplus test, but
probably not in your WO app.
If you eliminate the unmatched double quote, replace the
remaining double quotes with single quotes, and rerun the
statement in sqlplus, does the error still occur? Searching
Google for "ORA-00972" produced one response that claimed that
this bogus error message can occur when double quotes are used.
Another Google search results states that an incorrect column
name can cause this error. Is it possible that an attribute in
your eomodel has a column name that doesn't match a column name in
the IDEA table?
Art,
First off, I appreciate your help!
I changed the SQL to
UPDATE IDEA SET STATUS = 'A' WHERE (IDEA_OID = 1 AND AVGRATING is
NULL AND CATEGORY_OID = 6 AND IDEADESC = 'afdsafadsfasfa' AND
IDEANAME = 'fdsfadf' AND IDEAURL is NULL AND NUMRATINGS is NULL AND
PARENT_OID is NULL AND STATUS = 'P' AND SUBMIT_DATE = to_date
('2006-10-08 00:00:00', 'yyyy-mm-dd hh24:mi:ss') AND USER_OID = 1)
2 ;
That returned 0 rows updated.
It seems like the SQL generated is off. I think it is the
SUBMIT_DATE part. My SQL maybe off.
UPDATE IDEA SET STATUS = 'A' WHERE (IDEA_OID = 1 AND AVGRATING is
NULL AND CATEGORY_OID = 6 AND IDEADESC = 'afdsafadsfasfa' AND
IDEANAME = 'fdsfadf' AND IDEAURL is NULL AND NUMRATINGS is NULL AND
PARENT_OID is NULL AND STATUS = 'P' AND USER_OID = 1);
What is the oracle data type for the SUBMIT_DATE attribute?
Hi Shaun,
SQL> desc IDEA
Name Null? Type
----------------------------------------- --------
----------------------------
AVGRATING FLOAT(126)
CATEGORY_OID NOT NULL NUMBER
IDEADESC NOT NULL VARCHAR2(4000)
IDEANAME NOT NULL VARCHAR2(255)
IDEA_OID NOT NULL NUMBER
IDEAURL VARCHAR2(255)
NUMRATINGS NUMBER
PARENT_OID NUMBER
STATUS NOT NULL VARCHAR2(1)
SUBMIT_DATE NOT NULL DATE
USER_OID NOT NULL NUMBER
In my EO Model
submitDate maps to SUBMIT_DATE with
External Type of DATE
Value Class (Java) of NSTimestamp
Value (not sure what this might affect) of D
I have this in my notes regarding value type:
------------------------------------------------------------------
For attributes with a Value Class of NSTimestamp the following value
types are defined:
<none>
D
t
T
M
These value types affect how the data is transfer between the JDBC
adaptor and the database. An empty Value Type uses get/setObject() on
the ResultSet and PreparedStatement. It assumes the database can provide
a value compatible with a java.sql.Timestamp. A 'D' indicates
WebObject's JDBC adaptor should use get/setDate. A 't' indicates
get/setTime(), and a 'T' uses get/setTimestamp(). The 'M' value type is
a workaround for a bug in some MS SQLServer JDBC drivers. It only
support java.sql.Date.
------------------------------------------------------------------
I thought that I used T usually, but looking at some of my models I have
nothing set for a lot of the oracle DATE fields. The info above
indicates that if you only want the date portion then use a D, if you
want Date and time ie) a timestamp then use T.
Also, I'm using NSCalendarDate not NSTimestamp for valueClassName in my
eomodels. Using NSTimestamp in the classes. I have a much older version
of Oracle and WO5.3. FWIW most of my eomodels are also quite old now.
HTH.
- shaun
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden