Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: design question - stored procedures - best practice

RE: design question - stored procedures - best practice

From: <Paula_Stankus_at_doh.state.fl.us>
Date: Fri, 27 Aug 2004 16:39:40 -0400
Message-ID: <80D4A99A2715674EB2D256DAD89219F6044E8D18@dohsmail02.doh.ad.state.fl.us>


Guys,

I have a stored procedure that loads data and writes to an error log a = specific field/message when there are issues.

I know that a better design would be to modularize this code as I have = repetition/redundancy - yuck.

I don't return anything when I write to the log so I am thinking I = should have the parent procedure do the integrity check then a child = procedure (versus a function) write to the log.

Help - can someone provide advice on this????

here is a snippet. I check values in a field then write to a log table:

/***Test 1***/

	IF=20
         @AC_VENT_IMMED =3D 'T' AND
	 (@AC_VENT_30MIN =3D 'T' OR
	 @AC_VENT_MORE_6HR =3D 'T')
	BEGIN
	insert into acclaris_log

(state_file_number,field_name,
reason,create_date) values
(@STATE_FILE_NUMBER,'AC VENT','UNIQUE',getdate())
print 'FAILED TEST ON AC CHECK' END /***Test 2***/ IF=20 @AC_VENT_30MIN =3D 'T' AND (@AC_VENT_IMMED =3D 'T' OR @AC_VENT_MORE_6HR =3D 'T') BEGIN insert into acclaris_log
(state_file_number,field_name,
reason,create_date) values
(@STATE_FILE_NUMBER,'AC VENT','UNIQUE',getdate())
print 'FAILED TEST ON AC CHECK' END ----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
Received on Fri Aug 27 2004 - 16:11:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US