Home > database >  PB9select string field result is empty
PB9select string field result is empty

Time:09-17

I am using PB9 database retrieval fields, the statement is this: the select * from unit_info where unitname='Peking union medical college hospital;
Data in the table have Peking union medical college hospital records, but by name retrieval is no results, the content of the stored in the database is no problem, wait for you action

CodePudding user response:

This there are many possible, such as a database field type is char (n), or a computer to use different character sets and database may be

If is SQL Server database can be according to the following steps to check:
1. Add a record, change the unitname to simple English letter such as: a
Then select * from unit_info where unitname='a' and see if I can get the results
If no results can be judged as basic database field for char (n)/nchar (n)
Modified method: select * from unit_info where unitname=rtrim (' a ')

2. The above method can find, but Chinese is not very trouble may be related to the machine and the server Settings
Can try to change the server field type to nvarchar (n), use the statement select * from unit_info where unitname=n 'Peking union medical college hospital; To have a try

CodePudding user response:

refer to the original poster yliu227 response:
I using PB9 even database retrieval fields, the statement is this: the select * from unit_info where unitname='Peking union medical college hospital;
Data in the table have Peking union medical college hospital records, but by name to retrieve is no results, the content of the stored in the database is no problem, waiting for you action


So try to write

Select * from unit_info where unitname like '% % union;

Doubt inside other characters

CodePudding user response:

Estimation is other characters! Upstairs method is recommended, character set may be small, mistakes can't see the directly, try the pl/SQL developer

CodePudding user response:

Try the original poster is the upstairs said, estimation is characters have Spaces and so on
  • Related