From: Shreekar J. <Shr...@kp...> - 2007-11-14 09:41:00
|
Hi =20 While passing parameters to a stored procedure in .Net code, why is it important to pass them in the same order as defined in the stored procedure? Cannot the driver determine the correct order based on the schema and the parameter names supplied? =20 Also, any parameter name is accepted as a valid name. This behaviour seems consistent with the driver expecting the order to be correct rather than the parameter names to be correct. =20 My question is: Is there any way in which I can stop worrying about the order in which the parameters are defined and simply add all the parameters with the correct names as in the schema via the Firebird.Net provider? =20 Of course, all the above information could be completely wrong as it is based on my limited knowledge of the Firebird database and the Firebird.Net provider.=20 =20 Shreekar Joshi=20 KPIT Cummins Infosystems Ltd.| Ph: +91 020 6652 5000 extn. 2001=20 http://www.kpitcummins.com <http://www.kpitcummins.com>=20 Disclaimer: This message contains information that may be privileged or confidential and is the property of KPIT Cummins. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins does not accept any liability for virus infected mails. =20 |
From: Carlos <car...@gm...> - 2007-11-14 09:49:38
|
SGVsbG86Cgo+IFdoaWxlIHBhc3NpbmcgcGFyYW1ldGVycyB0byBhIHN0b3JlZCBwcm9jZWR1cmUg aW4gLk5ldCBjb2RlLCB3aHkgaXMgaXQKPiBpbXBvcnRhbnQgdG8gcGFzcyB0aGVtIGluIHRoZSBz YW1lIG9yZGVyIGFzIGRlZmluZWQgaW4gdGhlIHN0b3JlZCBwcm9jZWR1cmU/CgpCZWNhdXNlIHRo ZXJlIGlzIG5vIHdheSB0byBrbm93IHRoZSBjb3JyZWN0IG9yZGVyIGJhc2VkIG9ubHkgb24gdGhl CnBhcmFtZXRlciBuYW1lICggcmVtZW1iZXIgdGhhdCBGaXJlYmlyZCAqaGFzbid0KiBzdXBwb3J0 IGZvciBuYW1lZApwYXJhbWV0ZXJzLCB0aGF0IGlzIHNvbWV0aGluZyBpbXBsZW1lbnRlZCBpbiB0 aGUgcHJvdmlkZXIgKQoKCgotLSAKQ2FybG9zIEd1em3DoW4gw4FsdmFyZXoKVmlnby1TcGFpbgoK QmxvZwkJOiBodHRwOi8vY2FybG9zZ2Eud29yZHByZXNzLmNvbS8KRmlyZWJpcmRDbGllbnQJOiBo dHRwOi8vd3d3LmZpcmViaXJkc3FsLm9yZy8KWE1QUCBDbGllbnQJOiBodHRwOi8vY29kZS5nb29n bGUuY29tL3AveG1wcGNsaWVudC8K |
From: Jiri C. <di...@ci...> - 2007-11-14 09:52:55
|
If you will use "select ... from SP ..." and not CommandType.StoredProcedure, you can use named parameters. Getting parameters names from stored procedure is possible, but it's a one roundtrip to database, which isn't good for performace. -- Jiri {x2} Cincura (Microsoft Student Partner) http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com |
From: Shreekar J. <Shr...@kp...> - 2007-11-15 05:23:48
|
Thanks for that. However, since the SP I am trying to execute does not return any values, (only insert/update/delete in the SP), select... from SP is not an option. Actually, I am stuck on this issue with NHibernate where NHibernate cannot successfully execute the SP which does not return a value. But, I tested with SQL Server and NHibernate successfully executes the SP which does not return a value when SQL Server is used.=20 Hence, I was wondering if this had something to do with the provider.=20 About getting names and order of parameters from database, is it a good idea to cache the SP params and orders at application level (maybe in a singleton class hashtable)? This implementation will be in a windows forms application and not web based. Shreekar Joshi=20 -----Original Message----- From: fir...@li... [mailto:fir...@li...] On Behalf Of Jiri Cincura Sent: Wednesday, November 14, 2007 3:23 PM To: For users and developers of the Firebird .NET providers Subject: Re: [Firebird-net-provider] Order of parameters to stored procedure If you will use "select ... from SP ..." and not CommandType.StoredProcedure, you can use named parameters. Getting parameters names from stored procedure is possible, but it's a one roundtrip to database, which isn't good for performace. --=20 Jiri {x2} Cincura (Microsoft Student Partner) http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com ------------------------------------------------------------------------ - This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Firebird-net-provider mailing list Fir...@li... https://lists.sourceforge.net/lists/listinfo/firebird-net-provider |
From: Jiri C. <di...@ci...> - 2007-11-15 09:12:45
|
On 11/15/07, Shreekar Joshi <Shr...@kp...> wrote: > Thanks for that. > > However, since the SP I am trying to execute does not return any values, > (only insert/update/delete in the SP), select... from SP is not an > option. Execute procedure ... > About getting names and order of parameters from database, is it a good > idea to cache the SP params and orders at application level (maybe in a > singleton class hashtable)? This implementation will be in a windows > forms application and not web based. In provider? If so, so it's definetely wrong idea. This can bring more problems than benefits (i.e. altered procedure). -- Jiri {x2} Cincura (Microsoft Student Partner) http://blog.vyvojar.cz/jirka/ | http://www.ID3renamer.com |
From: Dean H. <dea...@dl...> - 2007-11-16 00:39:53
|
Jiri Cincura wrote: > On 11/15/07, Shreekar Joshi <Shr...@kp...> wrote: >> About getting names and order of parameters from database, is it a good >> idea to cache the SP params and orders at application level (maybe in a >> singleton class hashtable)? This implementation will be in a windows >> forms application and not web based. > > In provider? If so, so it's definetely wrong idea. This can bring more > problems than benefits (i.e. altered procedure). Yeah, I don't think you'd want to do it at the provider level, but your application could do it in your data access code if you really wanted to. I can see how it might be useful in a generic ORM library, but you could still run into problems unless you were able to also control the DDL that was being executed... Dean. |
From: Ivan A. <int...@da...> - 2008-04-15 10:00:17
|
Hi, Do you think introducing the overhead and processing time to determine the parameter order is worth? I mean . getting the schema on each procedure call and parsing it seems like "harder work" than just ordering the parameters at design time. A sort of a workaround you could use is inserting the parameters in a temp table (where you call the columns by name) and executing the procedure with no parameters (except maybe some ID). I know it doesn`t sound too graceful, but it could be implemented overnight J From: fir...@li... [mailto:fir...@li...] On Behalf Of Shreekar Joshi Sent: Wednesday, November 14, 2007 11:38 AM To: For users and developers of the Firebird .NET providers Subject: [Firebird-net-provider] Order of parameters to stored procedure Hi While passing parameters to a stored procedure in .Net code, why is it important to pass them in the same order as defined in the stored procedure? Cannot the driver determine the correct order based on the schema and the parameter names supplied? Also, any parameter name is accepted as a valid name. This behaviour seems consistent with the driver expecting the order to be correct rather than the parameter names to be correct. My question is: Is there any way in which I can stop worrying about the order in which the parameters are defined and simply add all the parameters with the correct names as in the schema via the Firebird.Net provider? Of course, all the above information could be completely wrong as it is based on my limited knowledge of the Firebird database and the Firebird.Net provider. Shreekar Joshi KPIT Cummins Infosystems Ltd.| Ph: +91 020 6652 5000 extn. 2001 <http://www.kpitcummins.com> http://www.kpitcummins.com Disclaimer: This message contains information that may be privileged or confidential and is the property of KPIT Cummins. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message. KPIT Cummins does not accept any liability for virus infected mails. |