• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Formatter, WORepetition for rawRowsSQL results
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Formatter, WORepetition for rawRowsSQL results


  • Subject: Formatter, WORepetition for rawRowsSQL results
  • From: Janice Cheung <email@hidden>
  • Date: Thu, 06 Oct 2005 10:38:12 -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().defaultEditingConte
xt(), "server_mgmt", sql);
       setM_strDvDepts((NSArray) results);
   }

    This is my error:

    Error:   java.lang.IllegalArgumentExcep
tion: 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.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Formatter, WORepetition for rawRowsSQL results
      • From: David LeBer <email@hidden>
  • Prev by Date: Re: Wanting to return an .XML document for a direct action
  • Next by Date: Re: Axis exception vending complex types service
  • Previous by thread: WOWorx(1) & (2) Video posted for Beginners.
  • Next by thread: Re: Formatter, WORepetition for rawRowsSQL results
  • Index(es):
    • Date
    • Thread