Informix Error -24147: Source and destination database must be different.
Cause and resolution
Source and destination database must be different.
Use the MOVE TABLE command to move a table to a different database. Use the RENAME TABLE command to move a table within the same database.
Oninit® Troubleshooting Guidance
Reasons / Common Causes
-24147 fires when MOVE TABLE's source and destination databases are the same — per the
official guidance, RENAME TABLE is the correct statement for moving a table within a
single database.
MOVE TABLEused with identical source and destination databases, per the official guidance — the direct, only cause.
Solutions / Resolution
- Use
RENAME TABLEinstead, to move a table within the same database, per the official guidance.
Examples
MOVE TABLE within the same database
MOVE TABLE t1 TO DATABASE mydb;
-- -24147: t1 is already in mydb
Corrected
RENAME TABLE t1 TO t1_new;
Diagnostic Checks
- Check whether the source and destination databases are the same, and use
RENAME TABLEinstead ofMOVE TABLEif so.
Related Errors / Related Topics
- -24145 — "Only permanent(base) tables can be moved." A related
MOVE TABLEerror, on table type rather than same-database moves. - -24146 — "Username and rolename have conflicting permissions." A related
MOVE TABLEerror, on permission conflicts. - -24148 — "Cannot move a table from the sysmaster and sysutils databases." A related
MOVE TABLEerror, on system-database restrictions. - -24149 — "Owner name conflicts with role name in the destination database." A
related
MOVE TABLEerror, on owner/role-name conflicts. - -24150 — "Only users with DBA privileges can move the table." A related
MOVE TABLEerror, on privilege requirements.
MOVE TABLE's source and destination were the same database — use RENAME TABLE instead.