×
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.
At one time I did have an index, but I switched to a view.
WRKOBJ OBJ(ROB/OLDT*)
Object Type Library Attribute
OLDTABLE *FILE ROB PF
OLDTA00001 *FILE ROB LF
DSPDBR FILE(ROB/OLDTABLE)
Files Dependent On Specified File
Dependent File Library
OLDTA00001 ROB
DLTF FILE(ROB/OLDT*)
All 2 objects of type *FILE deleted.
STRSQL
CREATE TABLE ROB/OLDTABLE (OLDDATEASNBR DEC (8 , 0))
CREATE view ROB/oldtablel01 as (
select oldDateASNBR,
DATE(DIGITS(OLDDATEASNBR) CONCAT '000000') as trueDate
from rob/oldtable)
INSERT INTO ROB/OLDTABLE VALUES(20101231)
INSERT INTO ROB/OLDTABLE values(null)
INSERT INTO ROB/OLDTABLE VALUES(20101232)
Hey, you're right!
DELETE FROM ROB/OLDTABLE
CREATE INDEX ROB/oldtablel02
ON ROB/OLDTABLE
(DATE(DIGITS(OLDDATEASNBR) CONCAT '000000') AS OLDDATE)
RCDFMT OLDTL02R ADD ALL COLUMNS
Field File Type
OLDDATEASNBR OLDTABLEL02 DECIMAL
OLDDATE OLDTABLEL02 DATE
INSERT INTO ROB/OLDTABLE VALUES(20101231)
INSERT INTO ROB/OLDTABLE values(null)
INSERT INTO ROB/OLDTABLE VALUES(20101232)
Data conversion or data mapping error.
DLTF FILE(ROB/OLDT*)
Recompiled DDS
R OLDTABLER
OLDDATE 8S 0 ALWNULL
CREATE INDEX ROB/oldtablel02
ON ROB/OLDTABLE
(DATE(DIGITS(OLDDATE) CONCAT '000000') AS TRUEDATE)
RCDFMT OLDTL02R ADD ALL COLUMNS
INSERT INTO ROB/OLDTABLE VALUES(20101231)
INSERT INTO ROB/OLDTABLE values(null)
INSERT INTO ROB/OLDTABLE VALUES(20101232)
Data conversion or data mapping error.
So an index enforces the data type, a view does not. Regardless of DDS or
DDL.
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
This thread ...
Re: SQL join date field with numeric field, (continued)
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.