473,507 Members | 2,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Pro*c - Using c++ to retrieve unicode data

Hi,

The common examples provided under "Pro*C/C++ Programming with
Unicode" is
#include <sqlca.h>
main()
{
...
/* Change to STRING datatype: */
EXEC ORACLE OPTION (CHAR_MAP=STRING) ;
text ename[20] ; /* unsigned short type */
varchar address[50] ; /* Pro*C/C++ varchar type */

EXEC SQL SELECT ename, address INTO :ename, :address FROM emp;
/* ename is NULL-terminated */
printf(L"ENAME = %s, ADDRESS = %.*s\n", ename, address.len,
address.arr);
...
}

-----------------------------------------------------------------------------------------------------------------
#include <sqlca.h>
#include <sqlucs2.h>

main()
{
...
/* Change to STRING datatype: */
EXEC ORACLE OPTION (CHAR_MAP=STRING) ;
utext ename[20] ; /* unsigned short type */
uvarchar address[50] ; /* Pro*C/C++ uvarchar type */

EXEC SQL SELECT ename, address INTO :ename, :address FROM emp;
/* ename is NULL-terminated */
wprintf(L"ENAME = %s, ADDRESS = %.*s\n", ename, address.len,
address.arr);
....
}

However, wprintf - Does not hold good for Unix HP. Please find
attached the link which indicates the same -
http://www.linux.com/howtos/Unicode-HOWTO-6.shtml

Hence, left with only one option of using printf(L...But this gives the
following error -

Error 212: "wchar_print.c", line 13 # Argument type 'const wchar_t *'
does not
match expected parameter type 'const char *'.
printf (L"%s \n", "A string");

(a) What needs to be done? And what headers are needed? We do not have
wchar.h and trying to download that from web, runs into a sequence of
getting files like features etc also.

Regards
Priya

Apr 20 '06 #1
1 3641
PRiya wrote:
The common examples provided under "Pro*C/C++ Programming with
Unicode"


Pro*C/C++ is an attrocity.

C++ is sufficiently powerful to write real, clear, pure C++ statements that
query databases. There's no benefit, and amazing overhead, to "embedding SQL
in C". That's a pitch to your bosses, not to you.

Oh, and it's off-topic here, because you will get the best answers on a
forum like a Pro*C mailing list.

--
Phlip
http://www.greencheese.org/ZeekLand <-- NOT a blog!!!
Apr 20 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5251
by: Bill Eldridge | last post by:
I'm trying to grab a document off the Web and toss it into a MySQL database, but I keep running into the various encoding problems with Unicode (that aren't a problem for me with GB2312, BIG 5,...
3
4449
by: Achim Domma | last post by:
Hi, I want to pass raw binary data from a file to a COM object. I read the data from file like this: data = file('path_to_file','rb').read() If passed to a COM object, data is converted to...
1
7515
by: Daman | last post by:
Hi, I am currently facing difficulty displaying chinese, japanese, russian etc. characters. I am using VB 6 and ADO to query the DB2 Version 7.2 unicode database (UTF-8). The resultset that...
11
6551
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
5
2075
by: tjerk | last post by:
Hello, I am switching from VB to python. I managed to crank my files into a sqlite dbase, converting the original names to unicode with s=unicode(s,"latin-1"). Everything is working fine, but...
1
4834
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was...
0
1199
by: s13khan | last post by:
Hi, I'm using FCKEditor for my CMS based web site thru which I save my site data in HTML format and the site is developped using ASP and MS ACCESS as backend. So far the site was of single...
1
3845
by: Mudcat | last post by:
In short what I'm trying to do is read a document using an xml parser and then upload that data back into a database. I've got the code more or less completed using xml.etree.ElementTree for the...
3
6869
by: amollokhande1 | last post by:
Hi All, I am using Sql server 2005 as a backend for my application. I want to read/write the unicode data using sql query. When I am using insert into UnicodeData values('سي') command and...
0
7221
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7109
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.