Re: From OpenBase To MSSQLServer2000 (EOModeller)
Re: From OpenBase To MSSQLServer2000 (EOModeller)
- Subject: Re: From OpenBase To MSSQLServer2000 (EOModeller)
- From: Arturo PĂ©rez <email@hidden>
- 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.
Why don't you just add a method to the EO that runs the above SQL.
Something like (off top o'head)
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>
}
_______________________________________________
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.