Home > database >  Powerbuilder9.0, nvarchar data type
Powerbuilder9.0, nvarchar data type

Time:09-18

Project is Powerbuilder9.0 development at present, for the English version of Sql Server database, the database collation is: SQL_Latin1_General_CP1_CI_AS, field type nvarchar, now when saving data, increased: N 'Chinese', but saved to the database of Chinese or gibberish, and before and after N 'still, for example: I was in a input box input: N' China ', but saved for the N '?? 'and don't know how to solve, please comment, thank you.

CodePudding user response:

Database to store in Chinese, it is not necessary to add N 'transformation,
Try this Chinese_PRC_CI_AS
And what is your operating system language use? In Chinese?

CodePudding user response:

SQL Server database Server for English version, is also in English, built the customer database is SQL_Latin1_General_CP1_CI_AS by default, if you can not change the situation, is there any good way to solve, thank you.

CodePudding user response:

refer to the second floor yuyang1976 response:
database Server for English version, SQL Server is also in English, built the customer database is SQL_Latin1_General_CP1_CI_AS by default, if you can't change the situation, is there any good way to solve, thank you.


The pb version to upgrade to the pb10 try again, because since pb10 default is a unicode string

CodePudding user response:

Upgrade is too much trouble, think about if you have not to upgrade to the best, thank you.

CodePudding user response:

reference 4 floor yuyang1976 response:
upgrade too much trouble, think about if the best way to have not to upgrade, thank you.


You try in SQL server directly to write Chinese characters, whether to support, if not support, it may not be able to solve,


If support, it is recommended that you modify parameters for connection to the database, there is a language that is modified to useful try

CodePudding user response:

If you directly in the input box type N 'China' save, so what is your SQL statement, please?
Is:
Insert into table (name) values (: sle_1. Text)
Or:
String SQL
SQL="insert into table (name) values (" + sle_1. Text +") "
EXECUTE SQL using IMMEDIATE SQLCA;

If you are using the first method is not so sure; You can use the second method to try

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- I'm line -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
If you are in the data window of the edit box input that should also be no good, need in the data window updateend events with similar to the second kind of all update to

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The above method in the PB10 and above version should be no problem, if it is PB9 theory under the Chinese version of the client system is also no problem

CodePudding user response:

Missed, if you need to save the N 'SQL statements should be:
SQL="insert into table (name) values (N '" + sle_1. Text +")"

CodePudding user response:

PB, OLE DB connection are used in a SQL Server query analyzer used when inserting data Values (' China '), is both a question mark after insertion, use Values (N 'China'), can show Chinese normal after insertion, but the data window directly in front of the insert string plus N error, if change to "N 'China'", save the database to store the N 'China' after, very confused, thank you

CodePudding user response:

Suggest to switch to an ODBC connection
The tested OLE DB, not ideal
Finally using ODBC

CodePudding user response:

refer to the eighth floor yuyang1976 response:
PB, OLE DB connection are used in a SQL Server query analyzer used when inserting data Values (' China '), is both a question mark after insertion, use Values (N 'China'), can show Chinese normal after insertion, but the data window directly in front of the insert string plus N error, if change to "N 'China'", save the database to store the N 'China' after, very confused, thank you


But the data window directly in front of the insert string plus N error, if change to "N 'China'", save the database to store is N 'China' after the

Didn't see this sentence, you are how to operate, how the data window in front of the insert string with N?

CodePudding user response:

references to the tenth floor SDHP response:
Quote: refer to the eighth floor yuyang1976 response:

PB, OLE DB connection are used in a SQL Server query analyzer used when inserting data Values (' China '), is both a question mark after insertion, use Values (N 'China'), can show Chinese normal after insertion, but the data window directly in front of the insert string plus N error, if change to "N 'China'", save the database to store the N 'China' after, very confused, thank you


But the data window directly in front of the insert string plus N error, if change to "N 'China'", save the database to store is N 'China' after the

Didn't see this sentence, you are how to operate, how the data window in front of the insert string with N?

Update and insert SQL statement is automatically generated data window, that is to say, I input the data window box, if you have any Chinese changed to N 'China'

CodePudding user response:

11 references yuyang1976 response:
Quote: reference to the tenth floor SDHP response:

Quote: refer to the eighth floor yuyang1976 response:

PB, OLE DB connection are used in a SQL Server query analyzer used when inserting data Values (' China '), is both a question mark after insertion, use Values (N 'China'), can show Chinese normal after insertion, but the data window directly in front of the insert string plus N error, if change to "N 'China'", save the database to store the N 'China' after, very confused, thank you


But the data window directly in front of the insert string plus N error, if change to "N 'China'", save the database to store is N 'China' after the

Didn't see this sentence, you are how to operate, how the data window in front of the insert string with N?

Update and insert SQL statement is automatically generated data window, that is to say, I input the data window box, if you have any Chinese changed to N 'China'


I am a don't understand about this: "the data window directly in front of the insert string plus N error", maybe you can't save any data window N at the beginning of the string? It's unbelievable; If as you say: "if changed to" N 'China' ", save the database after save is N 'China' "that says you have reached the purpose of, right?

CodePudding user response:

I am a don't understand about this: "the data window directly in front of the insert string plus N error", maybe you can't save any data window N at the beginning of the string? It's unbelievable;
this may describe error at the time, I in the query analyzer using the insert table Values (N 'China'), can show Chinese normal after insert, so I want to write, when submitting this so I write directly in the pb insert table Values (N 'China'), but an error, if again add double quotation marks in the outside, in the data becomes a N '?? '
If as you say: "if changed to" N 'China' ", save the database after save is N 'China' "that says you have reached the purpose of, right?
it is N 'saved?????? '

CodePudding user response:

In front of me not to write, if you want to save in the database N 'China' only need to input in sle_1 N 'China' then execute:
String SQL
SQL="insert into table (name) values (N '" + sle_1. Text +"') "
EXECUTE SQL using IMMEDIATE SQLCA;
You write directly insert table Values (N 'China') PB there N grammar usage so complains

CodePudding user response:

On the 14th floor SDHP
reference response:
in front of me not to write, if you want to save in the database N 'China' only need to input in sle_1 N 'China' then execute:
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related