dbTalk Databases Forums  

sql 2000i trailing spaces on field update

comp.databases.btrieve comp.databases.btrieve


Discuss sql 2000i trailing spaces on field update in the comp.databases.btrieve forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sarah
 
Posts: n/a

Default sql 2000i trailing spaces on field update - 07-20-2006 , 03:11 PM






Hello,

I wrote a utility to fix some fields in a Pervasive SQL 2000i SP4
database used by software our company purchased (Maximizer Enterprise)
writing in Visual FoxPro. ( Note: Maximizer needs the db as is, so i
cant fool around with the Pervasive DB structure). Anyways, when I did
this, every field I updated has now been padded with trailing spaces.
I have tried running stored procedures, padding with nulls but
everything I do STILL pads the fields with spaces. Maximizer does not
pad the fields with spaces, I know this, since I can simply delete them
out through the maximizer UI, but i dont know how its doing it.

There are >4500 records, so i cant do all the fields manually, and out
users need these changes, so i HAVE to get rid of these trailing spaces
somehow... any ideas??


Reply With Quote
  #2  
Old   
Bill Bach
 
Posts: n/a

Default Re: sql 2000i trailing spaces on field update - 07-25-2006 , 10:49 PM






If the fields are defined as CHAR() fields, then these have trailing
spaces, as far as SQL is concerned. If Maximizer is not padding them
with spaces, then the DDF's do NOT match the Btrieve files, and any
time you update the field from SQL, you will introduce spaces.

You can try redefining the fields as VARCHAR fields (i.e.
null-terminated), but 1) this does not guarantee null-padded, and 2) A
field taking up the entire field length will be a problem, since there
will be no room for the NULL byte.

To truely address this, you'll need to either get Maximizer to fix
their code and/or DDF's, or you'll need to write lower-level Btrieve
API calls to update the database, then try to update it exactly as
Maximizer does.
Goldstar Software Inc.
Pervasive-based Products, Training & Services
Bill Bach
BillBach (AT) goldstarsoftware (DOT) com
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 07/2006 ***


Sarah wrote:

Quote:
Hello,

I wrote a utility to fix some fields in a Pervasive SQL 2000i SP4
database used by software our company purchased (Maximizer Enterprise)
writing in Visual FoxPro. ( Note: Maximizer needs the db as is, so i
cant fool around with the Pervasive DB structure). Anyways, when I
did this, every field I updated has now been padded with trailing
spaces. I have tried running stored procedures, padding with nulls
but everything I do STILL pads the fields with spaces. Maximizer
does not pad the fields with spaces, I know this, since I can simply
delete them out through the maximizer UI, but i dont know how its
doing it.

There are >4500 records, so i cant do all the fields manually, and out
users need these changes, so i HAVE to get rid of these trailing
spaces somehow... any ideas??


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.