Associate Stored Procedure Parameter Datatypes with column datatype
This is a feature that Oracle has with PL/SQL. When creating a stored procedure and defining a parameter, there should be a way to define the datatype of the parameter and associate that with the column of a table. This way when a table column datatype size changes or type changes the stored procedure parameter is automatically changed to reflect the table change.
This would greatly help during development
Upvotes: 4<=-=Jul 21 2009 7:55AM=-=>
Thankyou for this suggestion. Makes good sense. (Of course, declaring @coldat to be typeof foo.col1 would still allow us to call get_foo with any argument of that type. That’s to say, it does not tie get_foo to work only with the particular column foo.col1)
(It’s also worth considering that typeof could apply, not just to a single column, but a set of columns)
Amazing really that such a simple idea (which is time-saving, and avoids spontaneous breakage down-the-line) was not included into the SQL language from the outset.
Anyhow, I’ll add it into the TODO list.
Jim Hogg<=-=Aug 18 2009 11:02AM=-=>
The was a great feature that Informix had almost 10 years ago. You never had to look up the exact column var type from the table. We get bugs all the time from column sizes being increased, but the sproc parameter never got updated to the increased size.<=-=Feb 28 2011 8:45PM=-=>
I have resolved your request as duplicate of one bleow:
Umachandar, SQL Programmability Team