|
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. -- [ Picked text/plain from multipart/alternative ] so with varlen, if I define a record with 1024 characters but only use 50 characters for 100 records, and then 1000 characters for one record, is my file size. (50*100)+1000 = 6000 bytes or would it be 1024 * 101 = 103424 bytes I know there is additional overhead, but for the sake of the conversation... it would only use 6000 bytes of storage... thanks, tim > -----Original Message----- > From: Phil [SMTP:sublime78ska@yahoo.com] > Sent: Thursday, October 18, 2001 12:33 PM > To: midrange-l@midrange.com > Subject: RE: Dynamic Field Length... > > Tim, > > In SQL you can do this (for example): > > CREATE TABLE PHILWORK/PHILTEST > (FIELD1 INTEGER NOT NULL WITH DEFAULT, > DESCRIPTION FOR COLUMN DSCR VARCHAR (1024 ) ALLOCATE(25)) > > what this does is create a null-capable column named DESCRIPTION with an > alias called DSCR (to use in an RPG pgm so you don't have to reference it > as > DESCR00001) which is variable length but with 25 bytes allocated. This is > supposed to speed up processing if the length is usually 25 or under (or > whatever length you want to make it). Or don't use ALLOCATE. > > There's a good redbook - "SQL Cookbook" I believe it's called. It's for > UDB > DB2 V7 so not everything applies to the as/400 but enough of it does to > make > it valuable. > > In DDS you can do it this way: > > A R TESTR > A FIELD1 9B 0 > A DESCR 1024A ALIAS(DESCRIPTION) > A VARLEN(25) > A ALWNULL > > The big difference is the sql table's record format is the same as the > table > name and the dds file's record format is TESTR while the file name is > TEST. > > Say to those Sequel guys "Step back non-believers!" > > Phil > > > > > > Does our database have a memo type of field? > > > > ie: in Sequel, they can input text with variable lengths... With DDS, > we > > have to setup our database with a fixed number or characters... > > > > Either via SQL, or DDS (or both) is it possible to setup a field (ie: > > comment field) to accept an unlimited number of characters... > > This would be > > a non keyed field... > > > > > > thanks, tim > > > > _______________________________________________ > > This is the Midrange Systems Technical Discussion (MIDRANGE-L) > > mailing list > > To post a message email: MIDRANGE-L@midrange.com > > To subscribe, unsubscribe, or change list options, > > visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l > > or email: MIDRANGE-L-request@midrange.com > > Before posting, please take a moment to review the archives > > at http://archive.midrange.com/midrange-l. > > > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > _______________________________________________ > This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing > list > To post a message email: MIDRANGE-L@midrange.com > To subscribe, unsubscribe, or change list options, > visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l > or email: MIDRANGE-L-request@midrange.com > Before posting, please take a moment to review the archives > at http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.