× 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.



Hello, Matt:

What version/release of OS/400 or IBM i are you running on?

As of V5R4 and above,you could do it like this (in STRSQL or RUNSQLSTM, etc.):

create table qgpl/table2 like qgpl/table1 format(NEWFMT)

This will create the new table for you, "just like" the existing table, but with a different record format name. Of course you must still copy the data, etc.

QUESTION: Why do you need to rename the record format name(s) of some files or tables?

Are you using those tables in e.g. RPG/400 or ILE RPG IV (RPGLE) as "native" files, rather than using embedded SQL? If so, it is fairly easy to 'rename" the record format name within the program source (at compile-time), for the scope of that one program, e.g.:

In RPG/400:
FDSPGRPLFIF E K DISK
F QSYDSUPB KRENAMEGRPRCD

In RPGLE:
FDSPGRPLF IF E K DISK
F RENAME(QSYDSUPB:GRPRCD)

Hope this helps,

Mark S. Waterbury

> On 2/16/2017 9:42 AM, Matt Olson wrote:
I'll put in a requirement. The create table already has a rcdfmt option so no need to do below option if you remember about the record format name. The alter table rename however does not know about rcdfmt, but should.

Now I am stuck with creating new table, changing journaling properties, setting up permissions, copying data from old table into new table, deleting old table.

...(snip)...
> On 2/15/2017 11:24 AM, Matt Olson wrote:
All,

What is the rename command to change a record format name?

We have this SQL available to change the SQL Long Name, SQL Short Name (System Name), but I don't see RCDFMT name.

Example:
RENAME TABLE LongName TO LongTableName FOR SYSTEM NAME LongName;

But what about changing record format names?

Thanks


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.