Page 1 of 1

SetEmptyStrToNull & TMyStoredProc

Posted: Fri 17 May 2013 17:37
by yurasek
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.

Re: SetEmptyStrToNull & TMyStoredProc

Posted: Mon 20 May 2013 14:21
by DemetrionQ
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;

Re: SetEmptyStrToNull & TMyStoredProc

Posted: Wed 22 May 2013 17:09
by yurasek
My problem is just the opposite - I need to pass an empty string, not NULL. How can I do this?

Re: SetEmptyStrToNull & TMyStoredProc

Posted: Thu 23 May 2013 09:17
by DemetrionQ
Hello.

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 := '';
And the function receives just the empty string, not NULL.