1. Moshe Tangi
  2. PowerBuilder
  3. Thursday, 17 August 2017 06:19 AM UTC

Hi ,

 

I am working with MS sql 2008 ( and above ) with pb12.5 ( and now will be 2017 ) classic , Windows 7 , 10 (64 bit , 32 bit machines

Why the datawindow is saved to the  data base with the max length for each field full with spaces ?

Even if i put NULL for all fields  every time i opened a new row for each dw

It happens only for string type fields

This is unlike Sybase Sql Anywhere   where the data was saved only what the user wrote in the the dw fields

that forces me to review all dw and put the Trim() function to all  computed fields which uses string type fields

 

 

 

There is a way to solve it

 

Thanks

Moshe

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 17 August 2017 12:56 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Moshe;

  If you are using the native SS DB client driver, have you tried adding TrimSpaces=1 to the DBParm field of your SQLCA?

  If you are using the ODBC SS DB client driver, have you tried adding TrimSpaces='Yes' to the DBParm field of your SQLCA?

Regards ... Chris

 

Comment
  1. Moshe Tangi
  2. Friday, 18 August 2017 06:06 AM UTC
Hi Chris ,



Thanks but it still does not work.



my string is - SQLCA.DBParm = "Namespace='System.Data.SqlClient',DataSource='" + dbserver_name + "',TrustedConnection=1,Database='"+ database_name + "'" + "Delimitdentifier='NO'"   + "," + "TrimSpaces='1'"



the connection is via ADO.Net



but with SS it not working too.



by the way , the parameter - Delimitdentifier='NO' its not working as well , means , if i put the " sign in the dw syntax i am getting erorr message while retrieve



any ideas ?

  1. Helpful
  1. Moshe Tangi
  2. Friday, 18 August 2017 06:44 AM UTC
Hi again



It works , the digit 1 after the = sign does not need the ' sign before and after the digit



I wrote : TrimSpaces='1' and it does not work , but : TrimSpaces=1= works



 



Thanks a lot

  1. Helpful
There are no comments made yet.


There are replies in this question but you are not allowed to view the replies from this question.