SetEmptyStrToNull & TMyStoredProc
SetEmptyStrToNull & TMyStoredProc
When using TMyStoredProc not pass an empty string not looking of the fact that the property MyStoredProc.Options.SetEmptyStrToNull default False. Version MyDAC 7.6.11.
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: SetEmptyStrToNull & TMyStoredProc
Hello.
The SetEmptyStrToNull option affects only editing of the record set returned by TMyStoredProc. This option doesn't affect transferred parameters. If you want to transfer NULL as a parameter, you can do it using the TParam.Clear method, e.g.:
MyStoredProc1.ParamByName('param1').Clear;
The SetEmptyStrToNull option affects only editing of the record set returned by TMyStoredProc. This option doesn't affect transferred parameters. If you want to transfer NULL as a parameter, you can do it using the TParam.Clear method, e.g.:
MyStoredProc1.ParamByName('param1').Clear;
Re: SetEmptyStrToNull & TMyStoredProc
My problem is just the opposite - I need to pass an empty string, not NULL. How can I do this?
-
DemetrionQ
- Devart Team
- Posts: 271
- Joined: Wed 23 Jan 2013 11:21
Re: SetEmptyStrToNull & TMyStoredProc
Hello.
I couldn't reproduce the problem. I assign an empty string to the function parameter in the following way: And the function receives just the empty string, not NULL.
I couldn't reproduce the problem. I assign an empty string to the function parameter in the following way:
Code: Select all
MyStoredProc1.ParamByName('param1').AsString := '';