Login
Register
Search
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Forums
Integration / Customization
S3 Customization/Development
Add a new column to an existing table while retaining table data
Home
Forums
Jobs
LawsonGuru
LawsonGuru Letter
LawsonGuru Blog
Worthwhile Reading
Infor Lawson News Feed
Store
Store FAQs
About
Who's On?
Membership:
Latest:
BDell92
Past 24 Hours:
0
Prev. 24 Hours:
0
Overall:
5275
People Online:
Visitors:
509
Members:
0
Total:
509
Online Now:
New Topics
Lawson S3 Financials
Applying credits to open AP invoices
4/28/2025 1:26 PM
Hello, I am new to the Lawson system and after ru
Lawson S3 Financials
Lawson APIA
4/28/2025 1:22 PM
Has anybody recently installed Lawson's APIA m
Lawson S3 Procurement
Tolerance Settings
3/31/2025 2:01 PM
I've been trying to set a tolerance for some t
Dealing with Lawson / Infor
Printing Solutions other than MHC
3/27/2025 1:00 PM
What are others using for printing solutions besid
Lawson S3 Procurement
Green check marks in Lawson 9.0.1
3/20/2025 4:55 PM
Hi, How to remove green check mark on items when o
Lawson S3 HR/Payroll/Benefits
Pay Rate History to Show All Positions
2/26/2025 3:34 PM
Does anyone know how to modify payratehistory.htm
Infor CloudSuite
How to build a Pre-Prod tenant
2/7/2025 1:28 AM
After we finished our implementation and ended our
Lawson S3 Procurement
Browser issue with RQC Shopping
1/28/2025 5:49 PM
Since the recent Chrome/Edge updates, our RQC shop
Lawson S3 Procurement
S3-Procurement New Company
1/22/2025 10:38 PM
My Accounting Department has created a new Company
S3 Customization/Development
JUSTIFIED RIGHT
1/15/2025 7:41 PM
Is there a way in Lawson COBOL to make a character
Top Forum Posters
Name
Points
Greg Moeller
4184
David Williams
3349
JonA
3291
Kat V
2984
Woozy
1973
Jimmy Chiu
1883
Kwane McNeal
1437
Ragu Raghavan
1375
Roger French
1315
mark.cook
1244
Forums
Filtered Topics
Unanswered
Unresolved
Announcements
Active Topics
Most Liked
Most Replies
Search Forums
Search
Advanced Search
Topics
Posts
Prev
Next
Forums
Integration / Customization
S3 Customization/Development
Add a new column to an existing table while retaining table data
Please
login
to post a reply.
6 Replies
0
Subscribed to this topic
17 Subscribed to this forum
Sort:
Oldest First
Most Recent First
Author
Messages
Woozy
Veteran Member
Posts: 709
10/15/2013 6:48 PM
I have a custom table that has been around for some time. The business has requested a modification which requires the addition of an additional column to the table. Can I make this change without losing the existing data in the table? If not, what is the best way to export/import the data that will work with a new table layout?
By the way, I will be making the table change in DEV which will then be promoted to PROD. I'm most concerned that the folks who do the promotion are told what to do to make this work without data loss.
Thanks for your help.
The.Sam.Groves
Veteran Member
Posts: 89
10/15/2013 7:10 PM
Split
The SQL statement to add a column to a table is:
[code]ALTER
ADD
[/code]
by default the add should not modify existing data in the table, however any existing rows will receive the default value you've defined (or not defined) for the column.
However you may run into unintended consequences that a DBA may be required to assist you on when doing this. These can include things such as the table needing to be reorganized by the server to reallocate the space it was assigned and 'defragment' the table into a new space.
Or am I misunderstanding the question?
Scott Perrier
Veteran Member
Posts: 39
10/15/2013 7:48 PM
Split
if the custom table is created with the lawson tools, then yes. Using DBDEF will allow you to add a column to the table. the blddbdict will create the table change file. Then the dbreorg will dump table in the old format and them load the table with the new column.
Woozy
Veteran Member
Posts: 709
10/15/2013 8:00 PM
Split
Thanks The.Sam.Groves and Scott Perrier,
Since we are under managed services, so we don't have access to do a direct SQL alter...I'd be much happier if I could do it that way. I just wanted to be sure that the Lawson utilities wouldn't truncate the data.
Scott - do I need to use a specific flag on the dbreorg to retain the data?
Thanks!
Scott Perrier
Veteran Member
Posts: 39
10/15/2013 8:50 PM
Split
it depends on the parms selected but the default is safe mode which is what you want to do.
dbreorg -S {productline}
Usage: To reorganize a database.
Syntax: dbreorg [-SCFYdin] [-W WFFile] {{-p DA} | PL}
dbreorg [-lcs] {{-p DA} | PL}
DA is DataArea and PL is ProductLine
S - Safe mode (default). Dump data before altering db tables
C - Conservative mode. Do not alter db tables
F - Fast mode. Do not dump data before altering db tables
Y - Yes. Do not prompt to continue in Fast mode (requires -F)
d - No physical database exists
i - Rebuild DataId dictionaries
n - Do not run srgen
p - Reorg just specified DA
G - Do Garbage collection. If GCFile is not specified, reorg
all files
l - List files to be reorganized; no reorg
c - Show file changes (requires -l)
s - List number of records in the files (requires -l)
Scott Perrier
Veteran Member
Posts: 39
10/15/2013 8:55 PM
Split
a friendly reminder that once you alter the table in your Dev system, you can no longer cleanly refresh that table/data from production. It can still be done but takes some rework just like when the CTP install has a table change. It is best to refresh the table before you convert it, when possible.
Woozy
Veteran Member
Posts: 709
10/15/2013 9:15 PM
Split
Perfect. Thanks Much!
Yep, we've run into the data refresh issue many times - mostly with new tables. Hopefully we can get the change in and promoted before the next data refresh. Fortunately, this is a very simple change.
I appreciate your help!
Please
login
to post a reply.