Re: Antw: Using StoredProcedure
Re: Antw: Using StoredProcedure
- Subject: Re: Antw: Using StoredProcedure
- From: email@hidden
- Date: Wed, 29 Jun 2011 16:36:39 +0200 (CEST)
- Message-context: email-message
Hi Andri,
Thanks for your help,
I want to know the temporary table, it's a class or it's a virtual table create automatically by EOFetchSpecification.
a little example code of your tempory table is welcome.
Ray
========================================
Message du : 29/06/2011
De : "Andri vonAllmen " <email@hidden>
A : email@hidden
Copie à :
Sujet : Antw: Using StoredProcedure
'loha,
I'm doing it this way:
The stored procedures I'm using do not return data, but they fill (temporary) tables. If the procedure returns data, it's always an array filled with dictionaries and you'll have to cast the data. If using (temporary) tables, you'll just have to execute the procedure and you'll be able to fetch the data as usual afterwards.
Some code:
--
// some dictionary taking the parameters for executing the stored procedure
NSMutableDictionary dict = new NSMutableDictionary();
// add some parameters (if there are any)
dict.setObjectForKey(someObject, "keyForSomeObject");
// execute the stored procedure filling some (temporary) table
EOUtilities.executeStoredProcedureNamed(editingContext(), "yourStoredProcName", dict);
// fetch your data
results = editingContext().objectsWithFetchSpecification(new EOFetchSpecification("TemporaryTableFilledByStoredProcedure", null, null));
--
Regards
Andri
PS: My e-mails don't get on the mailing list because of some reason...just don't care about that...
>>>
schrieb am Mittwoch, 29. Juni 2011 um 13:32 in
Nachricht <27064366.520171309347169380.JavaMail.www@wsfrf1212>:
> Hi,
>
> I want to know how to use a stored procedure in WO. I created a configurable
> stored procedure that returns more than 2000 data. My question is,
> data returned would be EOF or should I cast to an entity? Could these data
> be stored in a WODisplayGroup? What should contain my method to execute the
> stored procedure? A few bits of code would be welcome.
>
> Thanks a lot
--- Disclaimer: --------------------------------------------------------- This email and contents is for use only by the intended recipient. If you are not the individual or entity to whom it is addressed, you are hereby formally notified that any use, copying or distribution of this email and attachments, in whole or in part, is strictly prohibited. If you have received this email in error, please notify the sender and delete the message and attachment(s) from your system. Any views, opinions or information, expressed or contained in this email, are those of the sender and not necessarily reflect those of CEDES. To help protect our environment, please avoid printing out this information unnecessarily.
_______________________________________________
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