1. Home
  2. Knowledge Base
  3. Validating via an SQL Procedure Source Code

Validating via an SQL Procedure Source Code

mrc recommends using the Workflow Designer to validate user input going forward.

Source Code

create procedure mrcworklib.validdates
(inout i_error char(99),
 inout i_strdate decimal(8,0),
 inout i_enddate decimal(8,0))
LANGUAGE SQL
CASE
when i_strdate = 0 and i_enddate = 0 then
   set i_error = 'You have not entered any dates.';
when i_strdate = 0 then
   set i_error = 'You must enter a starting date.';
when i_enddate = 0 then
   set i_error = 'You must enter an ending date.';
when i_strdate > i_enddate then
   set i_error = 'Start date is later than end date.';
else
   set i_error = ' ';
END CASE

Updated on June 20, 2023

Was this article helpful?

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support