On 11/19/2024 2:19 AM, Dave wrote:
Is there any way I can avoid this error when Inserting from a table to a
physical file? I would like the data to simply be truncated. A part from
adding the substring function of course.
'Easy' is always subject to interpretation, but I'll respond in the hope
that it triggers other ideas.
Create a new, temporary, empty table (CRTDUPOBJ will work) and then
ALTER TABLE to make the column(s) you need larger. INSERT INTO the
temporary table. CPYF FMTOPT(*MAP) from the temporary table to the
actual destination table.
This could be automated by reading SYSCOLUMNS and then generating ALTER
TABLE statements that are ridiculously long (ie LENGTH + 1000). Of
course if going this route, one could also write a program that
generates the INSERT statements to substring every character column...
Some ideas to kick around.
This mailing list archive is Copyright 1997-2026 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.