TMyStoredProc, set null strings to empty string?
Posted: Mon 17 Mar 2014 12:12
I have ver 8.2.6 of TmyStoredProc.
I have a stored procedure in the database that returns two Varchars, one or both of which might be null.
The code below gives an exception in Delphi if the the parameter is null
Is there an easy way in TMyStoredProc to automatically convert null varchars to an empty string or do I have to alter my SQL with IFNULL(FieldName,"") and do it all in the procedure before returning any values?
I have a stored procedure in the database that returns two Varchars, one or both of which might be null.
The code below gives an exception in Delphi if the the parameter is null
Code: Select all
...
MyStoredproc1.Execute;
MyStringVar:= MyStoredproc1.ParamByName('MyParamName').AsString;
...
end;