General information
Category:
Third party products
>I am attempting to move a backend from SQLServer to Postgres. I am able to use remove views for both SQLServer and Postgres to move data to Postgres. I am using the PostgresSQL30 ODBC driver with this connection string :
>
>Everything works fine except - All of the character fields (varchars in SQLServer and character varying in Postgres) end up padded with spaces to the maximum length of the fields. If a field has the value 'BOO' and it is put in a character varying field set to 10 then the data would actually transfer as 'BOO '. This won't work and I know that there must be some setting in the connection string that would keep this from happening but I can't find any documentation on it. Any help greatly appreciated!
I personally would use CA to work, because this allows customization of the SQL statements on various levels, so an Alltrim() could be added for variable length fields (as I doubt the ODBC driver knows about them). If you need to use the ODBC driver, setting explicit SQL Insert and update statements with Alltrim(VarLenCharField) should work. Setting the trimmed VarChar in the memvar would work *only* if you fill SQL Insert directly from memvar into Postgres Table with SPT calls referencing these memvars. You are writing into a table fields, thereby padding again - and so the tableupdate moves the padded fields across. But you could also update those fields in Postgre removing the blanks - not too tempting as Postgres uses delete/insert for updates, but you could skip learning about CursorAdapter. If you will continue to work with vfp you should IMHO get to know Cursoradapter or SPT to give you better control.
HTH
thomas
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only