{"id":1609,"date":"2010-02-10T03:45:36","date_gmt":"2010-02-10T09:45:36","guid":{"rendered":"http:\/\/www.mrc-productivity.com\/legacy\/?page_id=1609"},"modified":"2011-12-22T16:30:44","modified_gmt":"2011-12-22T22:30:44","slug":"validating-via-an-sql-procedure-source-code","status":"publish","type":"page","link":"https:\/\/www.mrc-productivity.com\/legacy\/form-validation-techniques\/validating-via-an-sql-procedure-source-code","title":{"rendered":"Validating via an SQL Procedure Source Code"},"content":{"rendered":"<p><!-- Begin Content --><\/p>\n<h1>Validating via an SQL Procedure Source Code<\/h1>\n<p>&nbsp;<\/p>\n<p><code>create procedure mrcworklib.validdates<br \/>\n(inout i_error char(99),<br \/>\n&nbsp;inout i_strdate decimal(8,0),<br \/>\n&nbsp;inout i_enddate decimal(8,0))<br \/>\nLANGUAGE SQL<br \/>\nCASE<br \/>\nwhen i_strdate = 0 and i_enddate = 0 then<br \/>\n&nbsp;&nbsp;&nbsp;set i_error = 'You have not entered any dates.';<br \/>\nwhen i_strdate = 0 then<br \/>\n&nbsp;&nbsp;&nbsp;set i_error = 'You must enter a starting date.';<br \/>\nwhen i_enddate = 0 then<br \/>\n&nbsp;&nbsp;&nbsp;set i_error = 'You must enter an ending date.';<br \/>\nwhen i_strdate > i_enddate then<br \/>\n&nbsp;&nbsp;&nbsp;set i_error = 'Start date is later than end date.';<br \/>\nelse<br \/>\n&nbsp;&nbsp;&nbsp;set i_error = ' ';<br \/>\nEND CASE<\/code><\/p>\n<p><!-- End Content --><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Validating via an SQL Procedure Source Code &nbsp; create procedure mrcworklib.validdates (inout i_error char(99), &nbsp;inout i_strdate decimal(8,0), &nbsp;inout i_enddate decimal(8,0)) LANGUAGE SQL CASE when i_strdate = 0 and i_enddate = 0 then &nbsp;&nbsp;&nbsp;set i_error = &#39;You have not entered any dates.&#39;; when i_strdate = 0 then &nbsp;&nbsp;&nbsp;set i_error = &#39;You must enter a starting date.&#39;; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1580,"menu_order":5,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1609","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/comments?post=1609"}],"version-history":[{"count":1,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1609\/revisions"}],"predecessor-version":[{"id":3428,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1609\/revisions\/3428"}],"up":[{"embeddable":true,"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/pages\/1580"}],"wp:attachment":[{"href":"https:\/\/www.mrc-productivity.com\/legacy\/wp-json\/wp\/v2\/media?parent=1609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}