Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

updating datawindow with unicode value using sql server 2008

418 views
Skip to first unread message

Murat Yelkovan

unread,
Mar 18, 2009, 12:05:28 PM3/18/09
to
I migrated a database from Ase to MsSql server and made all changes in
powerbuilder 10.5 applications. First problem is datawindow cannot update
unicode value to mssql server. Actually it updates but after the next
retrieve all string data are ????.

The columns in tables are nvarchar. It was working fine with sybase ASE. (I
like ASE but what to do.)

I figured out that I have to execute sql statement with N prefix. Update X
set name=N'xxx'. I tried to modify all update and insert sql statements in
sqlpreview event but it does not work. Pb says datawindow has not update
capability.

I know if I use disablebind=0, I will solve the problem but a lot of
problems are coming with disablebind=0. For example if subqueries have
retrieve argument in datawindow, I get error 42000 and lost connection.

Is the situation is same in PB 11.5?
How can I solve this problem?

Thanks.


Chris Pollach

unread,
Mar 19, 2009, 7:08:53 AM3/19/09
to
Hi Murat;

Can you tell us how you are connecting to SS2008 and the connection
parameters you are using?

--
Regards ... Chris
ISUG - NA RUG Director
http://chrispollach.pbdjmagazine.com


"Murat Yelkovan" <muraty...@yahoo.com> wrote in message
news:49c11bc8@forums-1-dub...

Murat Yelkovan

unread,
Mar 19, 2009, 10:34:01 AM3/19/09
to
Hi Chris and everbody

I dont know if there is a another easy sollution but I solved the problem by
typing following script to the sqlpreview event. It adds N prefix to the
sqlstatements. I could not use disablebind=0 because I am replicating data
to another database in the application so I need to get the sql statements
with value. I tried oledb and native connection in powerbuilder 11.5 but
there is a same problem. If we have to send sql statement with N prefix to
the SQL server for unicode data, Sybase PowerBuilder had better generate sql
statement with N prefix for MS Sql Server.
What do you think about my sollution and about enchantment request regarding
this issue?.


//SQLPREVIEW EVENT
n_cst_string lnv_string

if sqlca.database="mssql" then
choose case sqltype
case PreviewInsert!
sqlsyntax= lnv_string.of_globalreplace(sqlsyntax ,"( '", "( N'")
sqlsyntax= lnv_string.of_globalreplace(sqlsyntax ,",'", ",N'")
this.setsqlpreview(sqlsyntax)


case PreviewUpdate!, PreviewDelete!
sqlsyntax= lnv_string.of_globalreplace(sqlsyntax ,"= '","= N'")
this.setsqlpreview(sqlsyntax)
end choose

end if


//This is my connection string;
ODBC=create n_tr_odbc
ODBC.DBMS = "OLE DB"
ODBC.AutoCommit = False
ODBC.DBPARM =
"PROVIDER='SQLNCLI10',DATASOURCE='KEDI-PC\MSSQL',PROVIDERSTRING='database=vinn_local',CommitOnDisconnect='No',OJSyntax='ANSI'"

"Chris Pollach" <cpol...@travel-net.com> wrote in message
news:49c227c5$1@forums-1-dub...

Paul Horan[Sybase]

unread,
Mar 19, 2009, 12:46:45 PM3/19/09
to
DisableBind can be changed "in flight", so you can leave it to 1 at
connection time, and flip it to 0 right before you update the Unicode fields
(provided it's not *every* update.)

--
Paul Horan[Sybase]
paulhoran.pbdjmagazine.com

"Murat Yelkovan" <muraty...@yahoo.com> wrote in message

news:49c257d9@forums-1-dub...

0 new messages