1. Moshe Tangi
  2. PowerBuilder
  3. Thursday, 17 August 2017

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 Accepted Answer Pending Moderation
0
Votes
Undo

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
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. Moshe Tangi
  2. Friday, 18 August 2017
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. Moshe Tangi
  2. Friday, 18 August 2017
There are no comments made yet.
  1. Thursday, 17 August 2017
  2. PowerBuilder
  3. # Permalink


There are replies in this question but you are not allowed to view the replies from this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies. Learn More