Hello; I just did this the other day, so you are in luck :). Add a attribute to your table/entity, set it¹s type as COLUMN, enter the column name you want to pass to the function . Set the return type, in this case I used VARCHAR2 and set the internal data type to String. Modify the properties for the attribute and set the read property to the function you wish to use. I used to_char(%P,¹DD MONTH YYYY¹), the %P represents the value to be passed to the function, in this case DATEID. I set the value to ReadOnly, so I did not have to enter a function to write a value in the DATEID field.
After it is all said and done it looks like this: { allowsNull = Y; columnName = DATEID; (column that is going to be passed to function) externalType = VARCHAR2; (External type expected, in this case VARCHAR2) internalInfo = {"_nameInObjectStore" = "TO_CHAR(DATEID,'DD MONTH YYYY')"; }; (This is the data you enter for your read function) isReadOnly = Y; (Here it is readonly not updateable) name = theDateAsString; (What you called the attribute) readFormat = "TO_CHAR(%P,'DD MONTH YYYY')"; (This is the data you entered for the read function) valueClassName = NSString; (Internal Data Type) width = 11; (External Width) }, It is pretty easy, from the properties file it looks hard but it is not. Change 2 things, set the readonly property and set the read format using %P for the value that EOF should pass to your function. And WA-LA. Thanks Don On 1/21/09 3:57 PM, "Tom Pelaia" <pelai...@ornl.gov> wrote: > Hi, > > I am trying to call a function with a return value defined in an Oracle > database. I found legacy EOF notes indicating that it was possible to do so by > adding an argument named "returnValue" to the EO stored procedure, but this > results in the following exception: > [exec] PLS-00306: wrong number or types of arguments in call to > 'LOGBOOK_ENTRY_WORK_ORDER_ASSOC' > > Has anyone been able to call function on an Oracle database? If so, how? > > I've defined my stored procedure in the model as: > { > arguments = ( > { > allowsNull = Y; > columnName = "p_log_entry_id"; > externalType = NUMBER; > name = "entryID"; > parameterDirection = 1; > valueClassName = NSNumber; > valueType = i; > }, > { > allowsNull = Y; > columnName = "p_work_order_number"; > externalType = NUMBER; > name = "workOrderID"; > parameterDirection = 1; > valueClassName = NSNumber; > valueType = i; > }, > { > name = "returnValue"; > parameterDirection = 2; > externalType = NUMBER; > parameterDirection = 2; > valueClassName = NSNumber; > valueType = i; > } > ); > externalName = "logbook.logbook_pkg.logbook_entry_work_order_assoc"; > name = linkToWorkOrder; > } > > > best regards, > tom > > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/webobjects-dev/pccdonl%40mac.com > > This email sent to pccd...@mac.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (Webobjects-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com