Message-Id: <10502.106100@fatcity.com> From: David Turner Date: Fri, 19 May 2000 06:16:38 -0700 Subject: Re: Error checking in Views.. --------------48F48298ABC6298686E8970E Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit If you're running on 8 or above you can use instead of triggers. Dave Turner Venugopal V V S wrote: > Hello * > > 1. I am trying to develop a data table view that will allow me to view > the data indicated below. > > 2. The view works, and I can get the correct data, but it does not > include any "Error Checking". I am looking for ways to validate keyboard > input using the view . Any help rendered is greatly appreciated. > > Thank you .... > Venu > > CREATE VIEW vState > AS SELECT boid, bex, phone, orderdate, ORDERNUB, AVAILID,DECODE(0, > INSTR(SUBSTR(boid, 1, 1), '0123456789'), 'NOT A NUMBER', > INSTR(SUBSTR(boid, 2, 1), '0123456789'), 'NOT A NUMBER', > INSTR(SUBSTR(boid, 3, 1), '0123456789'), 'NOT A NUMBER', > DECODE(boid, '001', 0, 1), 'ARKANSAS', > DECODE(boid, '002', 0, 1), 'ARKANSAS', > DECODE(boid, '003', 0, 1), 'ARKANSAS', > DECODE(boid, '004', 0, 1), 'ARKANSAS', > DECODE(boid, '007', 0, 1), 'ARKANSAS', > DECODE(boid, '012', 0, 1), 'ARKANSAS', > DECODE(boid, '030', 0, 1), 'MISSOURI', > DECODE(boid, '035', 0, 1), 'MISSOURI', > DECODE(boid, '036', 0, 1), 'MISSOURI', > DECODE(boid, '050', 0, 1), 'OKLAHOMA', > DECODE(boid, '055', 0, 1), 'OKLAHOMA', > DECODE(boid, '060', 0, 1), 'TEXAS', > DECODE(boid, '131', 0, 1), 'TEXAS', > DECODE(boid, '231', 0, 1), 'TEXAS', > DECODE(boid, '065', 0, 1), 'NORTH CAROLINA', > DECODE(boid, '612', 0, 1), 'NORTH CAROLINA', > DECODE(2, DECODE(SIGN(TO_NUMBER(boid) - 613), 1, 0) + > DECODE (SIGN(675 - TO_NUMBER(boid)), 1, 0), 0, 1), 'GEORGIA', 'UNKNOWN') > STATE > FROM MYTEST > > -- > Author: Venugopal V V S > INET: venug@cse.iitb.ernet.in > > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 > San Diego, California -- Public Internet access / Mailing Lists > -------------------------------------------------------------------- > To REMOVE yourself from this mailing list, send an E-Mail message > to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in > the message BODY, include a line containing: UNSUB ORACLE-L > (or the name of mailing list you want to be removed from). You may > also send the HELP command for other information (like subscribing). -- Dave Turner, Senior Database Administrator, Linuxcare, Inc. 913.383.3052 tel, 913.579.3803 cel, 877.443.9553 pager dturner@linuxcare.com, http://www.linuxcare.com/ Linuxcare. Support for the revolution. -- --------------48F48298ABC6298686E8970E Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit If you're running on 8 or above you can use instead of triggers.

                                                                                                    Dave Turner

Venugopal V V S wrote:

Hello *

1. I am trying to develop a data table view that will allow me to view
the data indicated below.

2. The view works, and I can get the correct data, but it does not
include any "Error Checking". I am looking for ways to validate keyboard
input using the view . Any help rendered is greatly appreciated.

Thank you ....
Venu

CREATE VIEW vState
AS SELECT boid, bex, phone, orderdate, ORDERNUB, AVAILID,DECODE(0,
INSTR(SUBSTR(boid, 1, 1), '0123456789'), 'NOT A NUMBER',
INSTR(SUBSTR(boid, 2, 1), '0123456789'), 'NOT A NUMBER',
INSTR(SUBSTR(boid, 3, 1), '0123456789'), 'NOT A NUMBER',
DECODE(boid, '001', 0, 1), 'ARKANSAS',
DECODE(boid, '002', 0, 1), 'ARKANSAS',
DECODE(boid, '003', 0, 1), 'ARKANSAS',
DECODE(boid, '004', 0, 1), 'ARKANSAS',
DECODE(boid, '007', 0, 1), 'ARKANSAS',
DECODE(boid, '012', 0, 1), 'ARKANSAS',
DECODE(boid, '030', 0, 1), 'MISSOURI',
DECODE(boid, '035', 0, 1), 'MISSOURI',
DECODE(boid, '036', 0, 1), 'MISSOURI',
DECODE(boid, '050', 0, 1), 'OKLAHOMA',
DECODE(boid, '055', 0, 1), 'OKLAHOMA',
DECODE(boid, '060', 0, 1), 'TEXAS',
DECODE(boid, '131', 0, 1), 'TEXAS',
DECODE(boid, '231', 0, 1), 'TEXAS',
DECODE(boid, '065', 0, 1), 'NORTH CAROLINA',
DECODE(boid, '612', 0, 1), 'NORTH CAROLINA',
DECODE(2, DECODE(SIGN(TO_NUMBER(boid) - 613), 1, 0) +
DECODE (SIGN(675 - TO_NUMBER(boid)), 1, 0), 0, 1), 'GEORGIA', 'UNKNOWN')
STATE
FROM MYTEST

--
Author: Venugopal V V S
  INET: venug@cse.iitb.ernet.in

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru@fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

--
Dave Turner, Senior Database Administrator, Linuxcare, Inc.
913.383.3052 tel, 913.579.3803 cel, 877.443.9553 pager 
dturner@linuxcare.com, http://www.linuxcare.com/