Page 1 of 1

Default Parameters set to null by default

Posted: Tue 25 Feb 2014 10:55
by xtaoth
Hello.

I'm migrating a project from an old Delphi to the new Delphi XE5 and we've taking advantage of this to abandon BDE and replace all those components using ODAC.

We didn't had any big problem until we arrived to the test phase. Then, we realized that the ODAC storeprocs, by default, sets to Null all parameters (unless you declare a default value in the storeproc param manually). That was messing with the program because we had some procedures declared with a DEFAULT 'N' (i.e.).

I know this is not a problem because you can manually set the default value manually in the storeproc param definition, but the program we're migrating is really big and if there's any way to get the PL/SQL procedure's param default value automatically we could really save a lot of developing time.

So that's my question. Is there any way to get the PL/SQL procedure's param default value automatically? or... there's any way to set any property of the storeproc to not set to null any undefined parameter?

Many thanks for your help.

Re: Default Parameters set to null by default

Posted: Wed 26 Feb 2014 12:02
by AlexP
Hello,

To retrieve the information about default values of procedure parameters, the OCI interface has no standard methods, therefore we don't fill in these values, as well as BDE (to retrieve such data, service tables should be used). Maybe in future we will consider the possibility to add such functionality

Re: Default Parameters set to null by default

Posted: Wed 26 Feb 2014 17:00
by xtaoth
Thanks for your comment.

We're starting to define the default data manually, but we got some problems that we cannot solve using this way (i.e. P_param1 IN DATE DEFAULT SYSDATE) because we don't know how to define SYSDATE as a default value in the storeproc param, so this issue forces us to navigate through all the source code we're migrating in order to set them at the moment it's called.

(you know, we can do it, but it's frustrating :wink: )

Re: Default Parameters set to null by default

Posted: Thu 27 Feb 2014 11:17
by AlexP
Unfortunately, it is impossible to set default values for DATE parameters in design-time, you can just change the procedure, and if a NULL value is returned - change it with a required one.