Default Parameters set to null by default

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
xtaoth
Posts: 2
Joined: Tue 25 Feb 2014 10:35

Default Parameters set to null by default

Post by xtaoth » Tue 25 Feb 2014 10:55

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.

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Default Parameters set to null by default

Post by AlexP » Wed 26 Feb 2014 12:02

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

xtaoth
Posts: 2
Joined: Tue 25 Feb 2014 10:35

Re: Default Parameters set to null by default

Post by xtaoth » Wed 26 Feb 2014 17:00

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: )

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Re: Default Parameters set to null by default

Post by AlexP » Thu 27 Feb 2014 11:17

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.

Post Reply