Re: Strange behavior of Derby database. SQL generation
Re: Strange behavior of Derby database. SQL generation
- Subject: Re: Strange behavior of Derby database. SQL generation
- From: David Avendasora <email@hidden>
- Date: Tue, 5 Feb 2008 13:54:28 -0500
I don't know about Derby, but table and field names like "created",
"start", "name" and "stop" give me the creepy-crawlies.
They either are, or are very similar to, reserved words. Could that
be causing any of your pain? It doesn't really seem like it here, but
crazier things have happened.
Also, since Java is case-sensitive, is Derby? Is created == CREATED?
Dave
On Feb 5, 2008, at 1:15 PM, Sergio Sánchez Maffet wrote:
Hi all,
I'm trying to get the derby database up and running with a new WO
application (a simple test). Trying to insert some simple records
including a 24 byte auto generated primary key, I encountered a
strange problem related to the SQL.
In contrast to the description in the derby documentation provided
with the JavaWebObjects examples, derby expects all external names
surrounded by double quotes. (I have done a dirty trick putting
double quotes into the external name in the model file itself, only
to test my guess and it does work)
Here is an example:
The following code will only run when you replace (created, start,
name, stop, id_r) with ("created", "start", "name", "stop", "id_r")
INSERT INTO tablea(created, start, name, stop, id_r) VALUES (?,
NULL, ?, NULL, ?)" withBindings: 1:2008-02-05 18:35:43(created),
2:"Test"(name), 3:<NSData: length=24, data=0... deleted...000>(idR)>:
Error:
Next exception:SQL State:42X14 -- error code: 20000 -- msg:
'CREATED' is not a column in table or VTI 'APP.TABLEA'.
But the table and the column exists! Checked with ij tool (show
tables and describe tablea).
There are three possibilities left:
1. Force the SQLExpression to use quotes on external names, but
this is deprecated, and a simple test did not work. (should I try
harder? ;-))
2. Repair, patch, configuration or what else to let derby accept
unquoted external names as described in the doc.
Other ideas?
My setup:
derby.system.home=/Library/Databases/Derby
derby.ui.codeset=UTF8
WO 5.4
Derby 10.2.2.0 (jars copied from the examples installation)
WOLips 4788
Any clues?
--
Sergio
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40avendasora.com
This email sent to email@hidden
_______________________________________________
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