Discussion:
How to specify the CODEPAGE in SELECT SQL
(too old to reply)
Stoyan Malchev
2005-02-20 08:09:23 UTC
Permalink
Is it possible to specify the codepage for mytable in the statment
select * from mytable


Thanks in advance
Marek Hryceniak
2005-02-21 22:45:24 UTC
Permalink
Post by Stoyan Malchev
Is it possible to specify the codepage for mytable in the statment
select * from mytable
Thanks in advance
Hello Stoyan,

Maybe you should set your table's codepage once and perform "normal" ;-)
selects?

cMyTablePath = "C:\mytable.dbf"
nTableCodepage = 852
DO (HOME(1)+"Tools\CpZero\CpZero.prg") with cMyTablePath, nTableCodepage


If you can't do that , then look at the CPCONVERT( ) function.
--
Pozdrawiam,
Marek Hryceniak
Stoyan Malchev
2005-02-22 07:57:31 UTC
Permalink
Thanks, Marek
But I am looking for a way to set the codepage without modifying the source
table
Post by Marek Hryceniak
Post by Stoyan Malchev
Is it possible to specify the codepage for mytable in the statment
select * from mytable
Thanks in advance
Hello Stoyan,
Maybe you should set your table's codepage once and perform "normal" ;-)
selects?
cMyTablePath = "C:\mytable.dbf"
nTableCodepage = 852
DO (HOME(1)+"Tools\CpZero\CpZero.prg") with cMyTablePath, nTableCodepage
If you can't do that , then look at the CPCONVERT( ) function.
--
Pozdrawiam,
Marek Hryceniak
Anders Altberg
2005-02-22 16:41:49 UTC
Permalink
As of VFP9 you can add CODEPAGE=nCodepage to the CREATE TABLE and CREATE
CURSOR commands
CREATE CURSOR xx CODEPAGE=936 (id Integer, name Character, registered
Datetime. Mem Memo NoCPTrans )
INSERT INTO xx SELECT * FROM my_other_code_page_table

I haven't checked but the may be like performing a CPCONVERT() on all
character convertible fields.

-Anders
Post by Stoyan Malchev
Thanks, Marek
But I am looking for a way to set the codepage without modifying the source
table
Post by Marek Hryceniak
Post by Stoyan Malchev
Is it possible to specify the codepage for mytable in the statment
select * from mytable
Thanks in advance
Hello Stoyan,
Maybe you should set your table's codepage once and perform "normal" ;-)
selects?
cMyTablePath = "C:\mytable.dbf"
nTableCodepage = 852
DO (HOME(1)+"Tools\CpZero\CpZero.prg") with cMyTablePath,
nTableCodepage
Post by Stoyan Malchev
Post by Marek Hryceniak
If you can't do that , then look at the CPCONVERT( ) function.
--
Pozdrawiam,
Marek Hryceniak
Loading...