Home » Developer & Programmer » Forms » convert nvarchar2 to varchar2
convert nvarchar2 to varchar2 [message #86334] Wed, 22 September 2004 03:06 Go to next message
Balaji
Messages: 102
Registered: October 2000
Senior Member
Hi

I have a problem in compiling my procedure in forms. it is giving "Internal Error 1904" error while compiling. the problem is in a insert statement , that is selecting values from a table which has nvarchar2 datatype.

for example.

create table test (a varchar2(10);

create table test1(a nvarchar2(10);

insert into test (select * from test1)

the above insert statement gives "Internal error 1904"

if i change the test1 datatype to varchar2, it is compiling successfully. pls help

i tried converting the nvarchar2 to (to_char) and insert . still it is giving error.

Balaji
Re: convert nvarchar2 to varchar2 [message #86336 is a reply to message #86334] Wed, 22 September 2004 05:03 Go to previous messageGo to next message
chandana
Messages: 12
Registered: December 2002
Junior Member
hi check this,
SQL> create table test(name varchar2(10));

Table created.

SQL> insert into test values('vbvb');

1 row created.

SQL> ed
Wrote file afiedt.buf

1* insert into test values('vava')
SQL> /

1 row created.

SQL> ed
Wrote file afiedt.buf

1* insert into test values('dada')
SQL> /

1 row created.

SQL> ed
Wrote file afiedt.buf

1* insert into test values('kkkk')
SQL> /

1 row created.

SQL> commit;

Commit complete.

SQL> select * from test;

NAME
----------
vbvb
vava
dada
kkkk

SQL> create table testn(name nvarchar2(10));

Table created.

SQL> insert into testn select * from test;

4 rows created.

HTH
bye
Re: convert nvarchar2 to varchar2 [message #86342 is a reply to message #86336] Wed, 22 September 2004 21:22 Go to previous messageGo to next message
Balaji
Messages: 102
Registered: October 2000
Senior Member
yes. i knew. this will work in oracle sqlplus.
but not working from forms5.0. not compiling at all.

regards
balaji
Re: convert nvarchar2 to varchar2 [message #86348 is a reply to message #86334] Thu, 23 September 2004 01:36 Go to previous message
Himanshu
Messages: 457
Registered: December 2001
Senior Member
Hi,
You can convert explicitly between VARCHAR2 and NVARCHAR2 using TRANSLATE( x USING NCHAR_CS ) or TRANSLATE( x USING CHAR_CS ).

HTH
Regards
Himanshu
Previous Topic: how to print selected person only from form builder(runtime)?
Next Topic: Adding new fields to a block based on a view
Goto Forum:
  


Current Time: Mon Sep 09 20:19:22 CDT 2024