Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to use “CREATE TABLE” to define a table structure for flat file with a fixed length?

0
Posted

How to use “CREATE TABLE” to define a table structure for flat file with a fixed length?

0

For instance, CREATE TABLE if not exists chk (businessmode CHAR(14),”first name” char(16), “last name” char(18), company char(50), trade CHAR(35), address char(30), address2 char(30), city char(19), flag char(2),ID char(7), serialNO numeric(6,0),_StuffedColumn char(2) default ‘\r\n’) will define a chk table structure, which the total row length is 229 byte. _StuffedColumn is a special column, which can be used to ignore all noise columns. For instance, you can use “_StuffedColumn char(8) default ‘abceed\r\n'”, or ‘_StuffedColumn char(8)” to ignore 8 byte information of every row. Default value can be omitted, or be a expression. The stuffed column of inserted new row will be set with the default value. BTW, for variable-length file, you shoud use longvarchar or longvarbinary with default value to indicate its terminator signature.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123