Re: From OpenBase To MSSQLServer2000 (EOModeller)
Re: From OpenBase To MSSQLServer2000 (EOModeller)
- Subject: Re: From OpenBase To MSSQLServer2000 (EOModeller)
- From: "Jonathan Fleming" <email@hidden>
- Date: Sat, 31 May 2003 15:30:32 +0100
From: Arturo Pirez <email@hidden>
To: Jonathan Fleming <email@hidden>
CC: email@hidden
Subject: Re: From OpenBase To MSSQLServer2000 (EOModeller)
Date: Sat, 31 May 2003 09:58:52 -0400
On Saturday, May 31, 2003, at 09:38 AM, Jonathan Fleming wrote:
From: Art Isbell <email@hidden>
To: email@hidden
Subject: Re: From OpenBase To MSSQLServer2000 (EOModeller)
Date: Fri, 30 May 2003 08:43:21 -1000
On Friday, May 30, 2003, at 07:02 AM, Jonathan Fleming wrote:
JDBCAdaptorException: EvaluateExpression failed:
<MicrosoftPlugIn$MicrosoftExpression: "SELECT (SELECT COUNT(*) FROM
TB_JOB_PICTURE WHERE TB_JOB_PICTURE.TB_JOB_ID = TB_JOB.TB_JOB_ID),
t0.DATA_DIR_JOB, t0.JOB_REF_NO, t0.LOCATION, t0.TB_CLIENT_ID,
t0.TB_JOB_ID, t0.TEXT_ABOUT_JOB FROM TB_JOB t0">:
Next exception:SQL State:HY000 -- error code: 107 -- msg:
[Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]The column prefix
'TB_JOB' does not match with a table name or alias name used in the
query.
this is a derived column to avoid fetching all the TB_JOB objects. Using a
derived column is supposed to do that directly given the correct SQL. what
I want to know is the proper SQL the would work with MSSQLServer2000's
adaptor, ie, the SQL I need to put in the Attribute Inspector's Derived
option and the Advanced Attribute Inspector's Custom Formatting Read
option, the other options here are read only and allow null values which
are both checked.
If that's not right then Ravi Mendis book WebObjects Developer's Guide
page 182 - 184 which suggests doing this to avoid excatly what you are
saying is totally wrong.
I thought derived columns should (and could only) work with columns of the
table an entity
was based upon? With that viewpoint what you're trying to do above is
incorrect.
Apparently not, this has be working without exception in OpenBase since
switching to MSSQLServer2000 this code does not work so it must be to do
with the underlying SQL the MSSQLServer2000 works with. Besides everything I
am now reading to understand SQL states that the SELECT statement can read
from other tables. I don't know I could be very wrong, but I'm gonna put up
a good argument with what I have seen, tested and read until someone proves
me absolutly wrong.
Why don't you just add a method to the EO that runs the above SQL.
Something like (off top o'head)
If nothing else comes from the list to open my options then I will go with
this but can you assure me that this is similar to using a derived column
created in EOModeller and that it will not create a performance drain by
fetching each and every Tb_JOB object just to get the count of objects in
that table?
Jonathan :^|
public int countOfJobsPictures() {
EOUtilities.rawRowsForSQL(this.editingContext(), "myEOModel",
"SELECT COUNT(*) FROM TB_JOB_PICTURE WHERE TB_JOB_PICTURE.TB_JOB_ID = "
+
this.jobID());
<etc,etc>
}
_________________________________________________________________
Tired of 56k? Get a FREE BT Broadband connection
http://www.msn.co.uk/specials/btbroadband
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.