× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On 2/14/11 10:59 AM, rob@xxxxxxxxx wrote:
<<SNIP>>

If the table OLDTABLE is created with SQL,
CREATE TABLE ROB/OLDTABLE (OLDDATEASNBR DEC (8 , 0))
adding the view
CREATE view ROB/oldtablel01 as (
select oldDate,
DATE(DIGITS(OLDDATE) CONCAT '000000') as trueDate
from rob/oldtable)
creates edit checking on the numeric date field
INSERT INTO ROB/OLDTABLE VALUES(20101231)
INSERT INTO ROB/OLDTABLE values(null)
INSERT INTO ROB/OLDTABLE VALUES(20101232)
SQL0802 - Data conversion or data mapping error.
6 -- Numeric data that is not valid.

CREATE VIEW will not impact the noted INSERT. Instead that would be the side effect from [apparently omitted] CREATE INDEX which would be origin for the error; i.e. the same expression in the derived-key INDEX could not be evaluated, effect a data mapping error, thus prevent the insert.

If, however, you created the table with DDS
R OLDTABLER
OLDDATE 8S 0 ALWNULL
then creating the view
CREATE view ROB/oldtablel01 as (
select oldDate,
DATE(DIGITS(OLDDATE) CONCAT '000000') as trueDate
from rob/oldtable)
no longer performs edit checking.

INSERT INTO ROB/OLDTABLE VALUES(20101231)
INSERT INTO ROB/OLDTABLE values(null)
INSERT INTO ROB/OLDTABLE VALUES(20101232)

select * from rob/oldtablel01
OLDDATE TRUEDATE
20,101,231 2010-12-31
- -
20,101,232 ++++++++++


As alluded above, I believe this outcome is no different than for not having created the INDEX. The same SELECT would fail against either VIEW, irrespective of DDS or DDL for the underlying database physical file\TABLE.

Regards, Chuck

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.