Default Parameters in Procedures

From: Tommy Wareing <p0070621_at_oxford-brookes.ac.uk>
Date: 22 Jun 1993 04:24:57 -0500
Message-ID: <C90Mry.J5E_at_uk.ac.brookes>


All quotes are from memory: My apologies for errors. Hardware: Sun Sparkserver 630
Forms: 3.0.16
RDBMS 6.0.36.5.1 I've got a procedure for which this is the parameter definition:

   PROCEDURE indicate_row(attrib IN CHAR := 'BOLD',

                          attr_block IN CHAR :=SYSTEM.TRIGGER_BLOCK) IS
...
(it changes one row in the named block to the specified attribute)

Most of the time it's simply called as:
  indicate_row('NORMAL'); or indicate_row('BOLD'); This causes a problem under our configuration: the first time a trigger containing a call to this procedure is edited, no problems. The second time... Wham... core dump.
This is not good.
I contacted the Oracle Helpdesk here in the UK about it, and they said
(after the usual 3 day delay) 'Oh yeah, that happens on Vaxes. We didn't
know it happens under Unix too'.
They suggested that I changed the default values of the parameters to NULL, and then changed the NULLs to the correct value in the procedure.

   PROCEDURE indicate_row(attrib1 IN CHAR := NULL,

                          attr_block1 IN CHAR := NULL) IS
...
  attrib := NVL(attrib1, 'BOLD');
  attr_block := NVL(attr_block1, :SYSTEM.TRIGGER_BLOCK);

This does indeed stop the core dumps, but... When we run the forms we get error
  FRM-40738: PL/SQL error -- illegal NULL argument to procedure. It appears to me that NULL default parameters aren't allowed.

Conclusion: default parametes don't work???

Help?

--
  _________________________   _________________________
 /  Tommy Wareing          \ /                         \
|  p0070621_at_uk.ac.brookes   X   'Bugger!' said Piglet   |
 \  0865-483389            / \                         /
  ~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~
Received on Tue Jun 22 1993 - 11:24:57 CEST

Original text of this message