|
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Wilt, Charles
Sent: Tuesday, June 24, 2008 1:31 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: GENERATE UNIQUE() and CPYTOIMPF
Mike,
I'd be willing to bet that CPYTOIMPF simply isn't designed to work with a
FOR BIT DATA column.
You might try submitting a DCR, but I wonder how exactly would that
work???
Other options:
1) Don't use CPYTOIMPF, it's a poor solution particularly if the other DB
is internal to your company.
Instead, consider using a ODBC/OLE/JDBC link back to the System I and
accessing the data directly.
2) Create a view that uses the HEX() function to convert the GUID field
into something the CPYTOIMPF
can handle. But this would mean that the other system will need to be
able convert it from hex string
binary data...a quick look at the System I SQL manual doesn't appear to
show a function that would
reverse the HEX() results.
HTH,
Charles Wilt
--
Software Engineer
CINTAS Corporation - IT 92B
513.701.1307
wiltc@xxxxxxxxxx
-----Original Message-----bounces@xxxxxxxxxxxx]
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
On Behalf Of MKirkpatrick@xxxxxxxxxxxxxxxxxrecs
Sent: Tuesday, June 24, 2008 12:27 PM
To: RPG programming on the AS400 / iSeries
Subject: GENERATE UNIQUE() and CPYTOIMPF
Thank Birgitta. That is what I was looking for. Now my next issue.
After I have inserted the rows with the GUIDs, I then use CPYTOIMPF to
export this table. The CPYTOIMPF completes normally but I have a few
where the GUID column now has extra characters (in the csv file). ThisI
causes an issue when someone on the PC side uses the IMPORT DB2 command.
believe this is due to the fact that the GUID column has a double quotein
it. I have tried different combinations of the STRDLM and STRESCCHRparm
on the CPYTOIMPF with no luck.combination
Does anyone have any suggestions on what STRDLM and STRESCCHR
to use, or is this is even the issue? Thanks.the
rpg400-l-bounces@xxxxxxxxxxxx wrote on 06/19/2008 10:15:47 PM:
Hi,
Too fast last time!
I assume the column was defined with CHAR(13) FOR BIT DATA, because
internalcolumn must be filled with an unique value where the timestamp isencrypted.
long
Since V5R4 SQL provides a scalar function GENERATE_UNIQUE(): The
GENERATE_UNIQUE function returns a bit data character string 13 bytes
(CHAR(13) FOR BIT DATA) that is unique compared to any other executionof
the same function.
The result of the function is a unique value that includes the
formTIMESTAMP
of the Universal Time, Coordinated (UTC) and the system serial number.The
result cannot be null.
This function differs from using the special register CURRENT
inan
that a unique value is generated for each instance of the function in
SQLthe
statement and each row of a multiple row insert statement or an insertresult
statement with a fullselect. The timestamp value that is part of the
of this function can be determined using the TIMESTAMP function with
NOTresult of GENERATE_UNIQUE as an argument.(Les
Example:
INSERT INTO MYTABLE (FLD1, FLD2, FLD3)
VALUES(Generate_Unique(),'ABC', 123);
SELECT Timestamp(Fld1), Fld1
From MyTable;
May be that's what you are looking for!
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the stars."
Brown)them
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not training
and keeping them!"[mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im
-----Ursprüngliche Nachricht-----
Von: rpg400-l-bounces@xxxxxxxxxxxx
Auftrag von MKirkpatrick@xxxxxxxxxxxxxxxxx
Gesendet: Thursday, June 19, 2008 20:46
An: RPG400-L@xxxxxxxxxxxx
Betreff: CHAR for BIT DATA fld
I have a column defined as CHAR FOR BIT DATA or CHAR(13) CCSID 65535
from
NULL. Why? Because this is the way it is defined in another table
pgm,
DB2 (Windows) that I am trying to duplicate/populate. W/in my RPG
isthe following stmt generates the correct data: CREDGUID =the
x'20080618090909123456202020';
My problem is I need to use a variable (TIMESTAMP + 3 chars) part of
value used to populate the CREDGUID column. I have tried stringing
together using the '+' char but when the data gets into the column it
of
truncated because the working variable is larger than the resultintended
(CREDGUID). I also tried using the HEX SQL BIF without success.
Any ideas or suggestions would be greatly appreciated. Thanks.
This email and any files transmitted with it are confidential and
solely for the use of the individual or entity to whom they areaddressed.
Unless you are the addressee (or authorized to receive for theaddressee),
you may not use, copy or disclose to anyone this email or anyinformation
contained in this email. If you have received this email in error,please
advise the sender by replying to this email, and delete this emailemail
immediately. Please note that any views or opinions presented in this
are solely those of the author and do not necessarily represent those
thisWestern Dental Services, Inc. Finally, the recipient should check
intendedemail and any attachments for the presence of viruses. Western Dentallist
Services, Inc. accepts no liability for any damage caused by any virus
transmitted by this email.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,unsubscribe, or
change list options,list
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
This email and any files transmitted with it are confidential and
solely for the use of the individual or entity to whom they areaddressed.
Unless you are the addressee (or authorized to receive for theaddressee),
you may not use, copy or disclose to anyone this email or anyinformation
contained in this email. If you have received this email in error,please
advise the sender by replying to this email, and delete this emailWestern
immediately. Please note that any views or opinions presented in this
email are solely those of the author and do not necessarily represent
those of Western Dental Services, Inc. Finally, the recipient should
check this email and any attachments for the presence of viruses.
Dental Services, Inc. accepts no liability for any damage caused by anylist
virus transmitted by this email.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
This e-mail transmission contains information that is intended to be
confidential and privileged. If you receive this e-mail and you are not a
named addressee you are hereby notified that you are not authorized to
read, print, retain, copy or disseminate this communication without the
consent of the sender and that doing so is prohibited and may be unlawful.
Please reply to the message immediately by informing the sender that the
message was misdirected. After replying, please delete and otherwise
erase it and any attachments from your computer system. Your assistance
in correcting this error is appreciated.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
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.