P
PRiya
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
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