X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 2AFB4D1B49D for ; Fri, 28 Nov 2003 07:46:33 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 87850-08 for ; Fri, 28 Nov 2003 03:46:03 -0400 (AST) Received: from smtp.covadmail.net (mx05.covadmail.net [63.65.120.65]) by svr1.postgresql.org (Postfix) with SMTP id 67AF6D1B44E for ; Fri, 28 Nov 2003 03:46:01 -0400 (AST) Received: (covad.net 23799 invoked from network); 28 Nov 2003 07:45:47 -0000 Received: from unknown (HELO covad.net) (rncombs@68.165.41.64) by sun-qmail03 with SMTP; 28 Nov 2003 07:45:46 -0000 Message-ID: <3FC6FD17.4020300@covad.net> Date: Fri, 28 Nov 2003 01:45:27 -0600 From: Richard Combs User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Cristian Custodio Cc: pgsql-odbc@postgresql.org Subject: Re: Character invalid saving memo with UpdateSQL References: <005d01c3b50d$f1328c90$b301a8c0@ttcristian> In-Reply-To: <005d01c3b50d$f1328c90$b301a8c0@ttcristian> Content-Type: multipart/alternative; boundary="------------070103030102020104000400" X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200311/124 X-Sequence-Number: 3526 This is a multi-part message in MIME format. --------------070103030102020104000400 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit I just did a quick test using the following setup postgreSQL 7.4 running on Linux (SuSE 8.2) ODBC client 7.03.02.00 on W2K - SP4 MDAC 2.8 Borland D7 BDE 5.01 LANGDRIVER set to (blank - default setting none chosen) SQLQRYMODE set to SERVER This is the test database structure bigtest=# \encoding SQL_ASCII bigtest=# \d table1 Table "public.table1" Column | Type | Modifiers --------+-------------------------+----------- c1 | character(40) | v2 | character varying(4000) | Sample Delphi project type TForm1 = class(TForm) Table1: TTable; UpdateSQL1: TUpdateSQL; Query1: TQuery; Button1: TButton; DataSource1: TDataSource; DBGrid1: TDBGrid; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin // query1.ExecSQL; { the query is insert into table1 (c1,v2) values('characters',varchars) } updatesql1.ExecSQL(ukInsert); { updatesql1 is linked to Table1 the insert query is insert into table1 (c1,v2) values('characters-n','varchars-n') } end; end. All the above is linked through BDE to a user DSN Advanced options set to Use Declare/Fetch Parse Statements Unknown Sizes as Longest Updateable Cursors Server side prepare All else is default Results after several inserts bigtest=# select * from table1; c1 | v2 ------------------------------------------+------------ characters | varchars characters | varchars characters | varchars characters-n | varchars-n (4 rows) These results are seen in both psql on the server and in the DbGrid that is linked to the table. No "invalid" characters were found. I also tried changing the LANGDRIVER in the BDE to other encodings, while leaving postgreSQL at the above encoding, and got the same results. I can't replicate your problem. I upgraded to postgreSQL 7.4, and no longer have 7.3.4 running, so I don't know if that is the problem, or if it is a problem with BDE and D5. Also note, I'm using D7 Pro not D5, but I don't think the BDE components have changed all that much over the last few versions. One other thing check Borland's usage notes on the updatesql component, they indicate it should only be used for readonly datasets. You might also try Borland's newsgroups see if there is anything about the "invalid" characters in them. HTH Richard Cristian Custodio wrote: > I'll do this, thanks. > > Cristian > > > If you're converting an application from Oracle to PG, that > implies that in the Oracle DB you also had such large VARCHAR > fields. And since that didn't give trouble, it furthermore implies > that the problem is in the PG ODBC drivers. > > Perhaps you should file a bug against them? > >> I'm using delphi 5 and PG: 7.3.4 and BDE >> >> I have 1 varchar(4000) column. When I try post >> any value in this column >> using UpdateSQL it save very invalids caracters. >> Like this: ννννννννν. >> >> Any body could help me? >> >> Thanks, >> >> Cristian Luciano Custodio > --------------070103030102020104000400 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit I just did a quick test using the following setup

postgreSQL 7.4 running on Linux (SuSE 8.2)
ODBC client 7.03.02.00 on W2K - SP4
MDAC 2.8
Borland D7
BDE 5.01
    LANGDRIVER set to (blank - default setting none chosen)
    SQLQRYMODE set to SERVER
   

This is the test database structure

bigtest=# \encoding
SQL_ASCII

bigtest=# \d table1
            Table "public.table1"
 Column |          Type           | Modifiers
--------+-------------------------+-----------
 c1     | character(40)           |
 v2     | character varying(4000) |


Sample Delphi project

type
  TForm1 = class(TForm)
     Table1: TTable;
     UpdateSQL1: TUpdateSQL;
     Query1: TQuery;
     Button1: TButton;
     DataSource1: TDataSource;
     DBGrid1: TDBGrid;
     procedure Button1Click(Sender: TObject);
  private
     { Private declarations }
  public
     { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
//    query1.ExecSQL;
{ the query is
    insert into table1 (c1,v2)
    values('characters',varchars)
}
    updatesql1.ExecSQL(ukInsert);
{ updatesql1 is linked to Table1
  the insert query is
    insert into table1 (c1,v2)
    values('characters-n','varchars-n')
}
end;

end.

All the above is linked through BDE to a user DSN
Advanced options set to
    Use Declare/Fetch
    Parse Statements
    Unknown Sizes as Longest
    Updateable Cursors
    Server side prepare
All else is default

Results after several inserts

bigtest=# select * from table1;
                    c1                    |     v2
------------------------------------------+------------
 characters                               | varchars
 characters                               | varchars
 characters                               | varchars
 characters-n                             | varchars-n
(4 rows)

These results are seen in both psql on the server and in the
DbGrid that is linked to the table.

No "invalid" characters were found.

I also tried changing the LANGDRIVER in the BDE to other encodings,
while leaving postgreSQL at the above encoding, and got the
same results.

I can't replicate your problem.  I upgraded to postgreSQL 7.4, and
no longer have 7.3.4 running, so I don't know if that is the problem,
or if it is a problem with BDE and D5.  Also note, I'm using
D7 Pro not D5, but I don't think the BDE components have
changed all that much over the last few versions.

One other thing check Borland's usage notes on the updatesql
component, they indicate it should only be used for readonly
datasets.  You might also try Borland's newsgroups see if
there is anything about the "invalid" characters in them.

HTH

Richard


Cristian Custodio wrote:
I'll do this, thanks.
 
Cristian
 
If you're converting an application from Oracle to PG, that implies that in the Oracle DB you also had such large VARCHAR fields. And since that didn't give trouble, it furthermore implies that the problem is in the PG ODBC drivers.
 
Perhaps you should file a bug against them?
I'm using delphi 5 and PG: 7.3.4 and BDE
 
I have 1 varchar(4000) column. When I try post any value in this column
using UpdateSQL it save very invalids caracters. Like this: ííííííííí.
 
Any body could help me?
 
Thanks,
 
Cristian Luciano Custodio
--------------070103030102020104000400--