Formatter, WORepetition for rawRowsSQL results
Formatter, WORepetition for rawRowsSQL results
- Subject: Formatter, WORepetition for rawRowsSQL results
- From: Janice Cheung <email@hidden>
- Date: Thu, 06 Oct 2005 10:37:15 -0400
Greetings!
How do I format my array of raw rows of SQL results using a
formatter in a WORepetition?
Here is my function:
public void fetchSixtyEx()
{
Session s = ((Session)session());
String sql = new String("select
distinct DNS_NAME, WARRANTY_EXP_DATE,
MODEL_TYPE, WARRANTY_TYPE, IP, VENDOR, MODEL,
TAG, SERIAL_NUMBER
from server_mgmt_db.SERVER,a_db.V_DEVICE");
sql += " where SERVER.DEVICE_FK = V_DEVICE.DEVICE_ID";
sql += " and SERVER.WARRANTY_EXP_DATE < SYSDATE+60 and
SERVER.WARRANTY_EXP_DATE>=SYSDATE";
NSArray results =
EOUtilities.rawRowsForSQL(session().defaultEditingContext(), "server_mgmt", sql);
setM_strDvDepts((NSArray) results);
}
This is my error:
Error: java.lang.IllegalArgumentException: While trying to
set the field "server" on an object of type ViewServerReport we
expected a
Server but received a
com.webobjects.foundation.NSMutableDictionary
with a value of {MODEL_TYPE = "eServer x335"; DNS_NAME = "N114";
WARRANTY_EXP_DATE = 2006-06-15 04:00:00 Etc/GMT; SERIAL_NUMBER =
"ABCDE"; IP = "123.456.78.106"; VENDOR = "IBM"; MODEL = "xSeries 335
Intel Xeon"; TAG = "111423"; WARRANTY_TYPE = "24x7x4"; }.
This often happens if you forget to use a formatter.
However, I am using a formatter - well .. I am using a
WORepetition, with list attribute defined with a "m_strDvDepts" binding,
and item attribute with a "server" binding. In this repetition, I
am trying to retrieve string "server.dnsAlias". I tried putting in
string "DNS_ALIAS" (as retrieved from
the sql query) but to no avail. How can I get my WORepetition to
properly format the results of
my SQL query? How do I get the object keys for DNS_NAME,
WARRANTY_EXP_DATE, MODEL_TYPE, WARRANTY_TYPE, VENDOR,
MODEL, TAG, SERIAL_NUMBER to be displayed?
Thank you for helping me. Any advice and guidance is greatly
appreciated!
Best regards,
Janice
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden