Hello everyone,
Say I have a stored proc with a parameter that takes a null value and a user has a typo in the parameter. Is there any way in Sybase 12.x at the stored procedure level to catch this mistake. As far as I know, Sybase just ignores spurious params.
Here's a simple example :
create procedure myProc
(@theId numeric(12),
@updateTS datetime=null,
@debug tinyint=0
)
as
if @updateTS is null
begin
select * from MyTable where TheId = @theId
end
else
begin
select * from MyTable where TheId = @theId and UPD_TS < @updateTS
end
go
For instance, the user types:
exec myProc @theId = "123", @updateTime = "20030101"
and is perplexed by results.
I can't redesign the proc. It's in wide use and the procedure is well-documented. The real example is more complex. (It uses dynamic sql, has about 20 params with most of the params defaulting to null. )
Thanks for your help,
Grandpa