For Programmers: Free Programming Magazines  


Home > Archive > Visual FoxPro Programming > June 2006 > Question on updating/retrieving chinese character in SQL server









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Question on updating/retrieving chinese character in SQL server
tham

2006-06-29, 8:03 am

Hi

I am trying to update and retrieve chinese character in the SQL server
The field to update/retrieve is 'cname' which is data type nchar(10)

The following is the code for updating:
---------------------------------------
lcSQL = "UPDATE system SET cname = '" + ALLTRIM(thisform.txtCTitle.Value) +
"'"
SQLEXEC(lnConn, lcSQL)

The following is the code for retrieving:
---------------------------------------
lcSQL = "SELECT cname FROM system"
SQLEXEC(lnConn, lcSQL, "tmpSystem")
SELECT tmpSystem
BROWSE


My Questions:
Q1. When I updated the 'cname' and set it to 10 chinese characters and then
tried to retrieve back, the tmpSystem cursor only show the first 5
character. When I viewed the table using enterprise manager, the 10
characters is there. Why is the data query get truncated.

Q2. If I have a field which data type is binary, what is the SQL syntax to
update this field?


Appreciate your help.

Tham


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com