[AccessD] Re-Invent The Wheel??

John Colby jwcolby at ColbyConsulting.com
Tue Oct 18 07:11:16 CDT 2005


Stuart,

Thanks for taking the time to read ad comment.

>Even in delimited fields you will still often need a format string

Yes you do.  This is one of those areas that gets deep quickly.  For
example, if it is fixed width, what do you pad with?  Do you pad left or
right (align to the left or the right?).  In the system I designed
previously, I placed into the fld record the starting position inside the
"big string" (as I called it) and the total width.  

As for placing the DS_FixedWidth in the field in the data set table - I
think we need a third table above the usystblDataSet, which is
usystblExport.  This table holds the information about whether the export of
a given data set is going to be fixed width or delimited, and the tablespec
of where to place the exported file.  Perhaps also information such as
whether this will be attached to an email (and if so an email address), or
FTPed (an FTP address/Username/password), faxed etc.  Thus usystblExport
would have a m-m between it and usystblDataSet so that you define exports to
destinations, and what data set(s) get exported to that destination.

The concept has a basic problem that all too often different sets of people
want the same data, with the fields formatted the same way, but the "big
string" formatted differently.

>Also:
DS_QuoteText		Yes/No		Whether text fields are quoted

>Possibly:
DS_TotalChars	Number	Record length for fixed width files
(easier than trying to calculate it from summing the fields Format
definitions )

So all of these would go in the usystblExport

>FLD_OutputFieldName	Text	Name of the field in the output file
					Default Null = same as in data
source

Yes, probably necessary.  In my original system I was given a big table with
the "expected format" which included their field name, start AND end
positions, field length and format, though the format was just a code such
as str or num.  It was from this that I expanded that table, added MY source
data field name, and an actual format string to use with the format()
function on each data field.

>Is there any such thing as delimited and fixed width? Surely that is an
either/or

Yes, there is such a thing.  Where there are idiots, there will be every
combination under the sun.

John W. Colby
www.ColbyConsulting.com 

Contribute your unused CPU cycles to a good cause:
http://folding.stanford.edu/

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
stuart at lexacorp.com.pg
Sent: Tuesday, October 18, 2005 12:29 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Re-Invent The Wheel??


On 17 Oct 2005 at 23:33, John Colby wrote:

> I propose a system of two tables:
> 
> usystblDataSource
> DS_ID                  Autonumber   PK
> DS_Source           Memo            Data source - can be a sql statement,
a
> query name or a table name
> DS_Type              Text               Source of the data (table, query
or
> SQL statement
> DS_FixedWidth   Yes/No           This data is a fixed width export - If
> true, then the format string in each field is responsible for getting 
> the width right

Even in delimited fields you will still often need a format string


> DS_Delimiter        Text               The delimiter between fields (if
any)
> 

Also:
DS_QuoteText		Yes/No		Whether text fields are quoted

Possibly:
DS_TotalChars	Number	Record length for fixed width files
(easier than trying to calculate it from summing the fields Format
definitions )
 
> 
> usystblFld
> FLD_ID               AutoNumber   Field ID
> FLD_IDDS          Number            Data Source ID
> FLD_Order          Number            The order that the field appears in
the
> output string
> FLD_FldName      Text                  Name of the field in the data
source

FLD_OutputFieldName	Text	Name of the field in the output file
					Default Null = same as in data
source


> Thus usystblDataSource represents the source of the data and whether 
> this export specification is going to be fixed width, delimited, or 
> both.

Is there any such thing as delimited and fixed width? Surely that is an
either/or


-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list