|
https://www-912.ibm.com/r_dir/ReqDesChange.nsf/Request_for_Design_Change?OpenForm
------------------------------
message: 5
date: Thu, 22 May 2008 14:04:42 -0500
from: Doug Palme <D>
subject: Re: Question on SQL Table (DDL) with date and
time fields
Rob,
I just spent four hours chasing that down :) and I will
be slowly getting
rid of the writes and changing it out with the
insert......but I am
probably going to upset a few more people in doing so
LOL......
From:
r
To:
RPG programming on the AS400 / iSeries
<>
Date:
05/22/2008 01:59 PM
Subject:
Re: Question on SQL Table (DDL) with date and time fields
The problem is that UPDATE, in rpgle, supports %fields.
However WRITE
does not. Therefore you have to write out the whole
buffer. And, if you
never initialized those fields it will write out low
values.
Dump WRITE, adopt SQL's INSERT instead.
I suppose you could create a DCR that WRITE support
%fields.
Another option is:
phdate=%date();
phtime=%time();
write record;
Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
Dock 108
6928N 400E
Kendallville, IN 46755
Doug Palme <DP>
Sent by: r@xxxxxxxxxxxx
05/22/2008 12:40 PM
Please respond to
RPG programming on the AS400 / iSeries
<>
To
RPG programming on the AS400 / iSeries
<@midrange.com>
cc
Subject
Re: Question on SQL Table (DDL) with date and time fields
Here is what I added to the DDL:
0002.00 PHDATE DATE WITH DEFAULT CURRENT DATE,
0003.00 PHTIME TIME WITH DEFAULT CURRENT TIME,
....
When using DBU it works perfectly....however, when a
program writes a
record those fields end up with a default date of
00001-01-01 and a
default time of 00.00.00......obviously I am doing
something wrong.....
From:
R Bruce Hoffman <@>
To:
RPG programming on the AS400 / iSeries
<@>
Date:
05/22/2008 10:07 AM
Subject:
Re: Question on SQL Table (DDL) with date and time fields
create table ... ( .... date with default current date
... )
Only defaults on insert when the field is not specified
in the insert
list. Updates leave it unaffected.
Doug Palme wrote:
is there a way to auto populate a date / time fieldwith the current
date
and time without actually having code to do it? IE: Isthere a default
setting within the DDL spec that would cause the datefield to be
filled?
on subsequent
Although as I think about this, that might be a problem
updates......
As an Amazon Associate we earn from qualifying purchases.
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.