PL/SQL novice needs help

From: Steven Husting <sh_at_pinck.ch>
Date: 1995/09/29
Message-ID: <DFns3r.15p_at_pinck.ch>#1/1


I am writing a PL/SQL script which validates some fields in a record. The record contains six fields (let's call them f1, f2, ... f6) and when a record is inserted, I retrieve the previous record and compare values. The problem is, the logic is specified as follows:

for field f in f1 ... f6

	compare f to old_record.f
	if old_record.f is NULL, compare to whichever
		old_record.f exists.

next f

It appears, after reading the PL/SQL and Application Developer's Guides, that there is no possibility in Oracle to treat these fields as an array, which would make life simple. I've written a very ugly brute force function, but it offends me. I could move the validation out of the database and into the front end (PowerBuilder), but that is also an unacceptable solution. Any suggestions as to an efficient and not particularly ugly solution would be appreciated. Oh, yes, the Oracle version is 7.1.6, running on HPUX 9.0.5.

-- 
Steven Husting         sh_at_pinck.ch
Pinck Softech AG       http://www.pinck.ch/pinck/
Reinach Switzerland
Received on Fri Sep 29 1995 - 00:00:00 CET

Original text of this message