Re: EOF and Stored Procedure in MS-SQL
Re: EOF and Stored Procedure in MS-SQL
- Subject: Re: EOF and Stored Procedure in MS-SQL
- From: Michael Parlee <email@hidden>
- Date: Mon, 13 Dec 2004 09:39:00 -0800
Hi Sako,
The GetPK operation does not bind input parameters.
I think you will have to use a delegate to generate your key (http://developer.apple.com/documentation/WebObjects/Enterprise_Objects/index.html). You can use the code you've already written in step 6.
Mike
On Dec 13, 2004, at 7:16 AM, Sako! wrote:
Hello,
for a purpose i have to use SP(stored Procedure) to create a pk.
1. I use MS-SQL.
2. My Stored Procedure works fine (i tested it with sql).
3. SP is known in the EOF as "availablityPK".
4. the table Availabilty which should use this SP has the property
GetPK : availablityPK
5. the SP has the
in Argument : Customer_id
out : id
6. if i execute the SP from java like this
NSDictionary arguments = new NSDictionary(cId, "Customer_id");
NSDictionary result = EOUtilities.executeStoredProcedureNamed(ec, "availablityPK", arguments);
i get the correc answer and the log looks like this
---------------------------------------------------------
<x-tad-smaller>[2004-12-13 15:09:00 CET] <main> executeStoredProcedure: availablityPK withValues:{</x-tad-smaller>Customer_id<x-tad-smaller>= 200001; }</x-tad-smaller>
<x-tad-smaller>[2004-12-13 15:09:00 CET] <main> === Begin Internal Transaction</x-tad-smaller>
<x-tad-smaller>[2004-12-13 15:09:00 CET] <main> evaluateExpression: <com.webobjects.jdbcadaptor.MicrosoftPlugIn$MicrosoftExpression: "{ ? = call Availablity_P_K (?)}" withBindings: 1:<com.webobjects.foundation.NSKeyValueCoding$Null>(id), 2:200001(</x-tad-smaller>Customer_id<x-tad-smaller>)></x-tad-smaller>
<x-tad-smaller>[2004-12-13 15:09:00 CET] <main> === Commit Internal Transaction</x-tad-smaller>
---------------------------------------------------------
7. if i try to execute the procedure automatically, this mean when i
a. i create an Availability object
b. set the correct Customer_id
c. ec.saveChanges(); // this mean. EOF executes the SP when i try to insert an object in the Table Availabilty.
i get such a log // mention the null here.
---------------------------------------------------------
<x-tad-smaller>[2004-12-13 15:09:00 CET] <main> executeStoredProcedure: availablityPK withValues:</x-tad-smaller><x-tad-smaller>null</x-tad-smaller>
<x-tad-smaller>[2004-12-13 15:09:00 CET] <main> === Begin Internal Transaction</x-tad-smaller>
<x-tad-smaller>[2004-12-13 15:09:00 CET] <main> evaluateExpression: <com.webobjects.jdbcadaptor.MicrosoftPlugIn$MicrosoftExpression: "{ ? = call Availablity_P_K (?)}" withBindings: 1:<com.webobjects.foundation.NSKeyValueCoding$Null>(id), 2:<com.webobjects.foundation.NSKeyValueCoding$</x-tad-smaller><x-tad-smaller>Null</x-tad-smaller><x-tad-smaller>>(</x-tad-smaller>Customer_id<x-tad-smaller>)></x-tad-smaller>
<x-tad-smaller>[2004-12-13 15:09:00 CET] <main> === Commit Internal Transaction</x-tad-smaller>
---------------------------------------------------------
Anybody knows what do i do wrong?
thank you!
Sako.
_______________________________________________
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
_______________________________________________
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