Home » SQL & PL/SQL » SQL & PL/SQL » Problem while creating view
Problem while creating view [message #247244] Mon, 25 June 2007 04:14 Go to next message
rajesh_bhadu
Messages: 48
Registered: June 2007
Member
Hi all,

I am creating a view as below.

CREATE OR REPLACE VIEW xptest
AS
   SELECT NAME,
          CAST(nu_fnReplaceChar('CCNCHAR', ccnchar, s2.DIGEST, s2.cipher) AS NCHAR) ccnchar,
          CAST(nu_fnReplaceChar('CCNVARCHAR', ccnvarchar, s1.DIGEST, s1.cipher) AS NVARCHAR2) ccnvarchar,
          sample_val_column
     FROM xptest_enc ,
          CCNCHAR_shadow s2,
          CCNVARCHAR_shadow s1
     WHERE ccnchar_idx = s2.idx
             AND ccnvarchar_idx = s1.idx;


Function used in above code 'nu_fnReplaceChar','nu_fnReplaceChar' exist.

But i m getting below error.


Error starting at line 1 in command:
CREATE OR REPLACE VIEW xptest
AS
   SELECT NAME,
          CAST(nu_fnReplaceChar('CCNCHAR', ccnchar, s2.DIGEST, s2.cipher) AS NCHAR) ccnchar,
          CAST(nu_fnReplaceChar('CCNVARCHAR', ccnvarchar, s1.DIGEST, s1.cipher) AS NVARCHAR2) ccnvarchar,
          sample_val_column
     FROM xptest_enc ,
          CCNCHAR_shadow s2,
          CCNVARCHAR_shadow s1
     WHERE ccnchar_idx = s2.idx
             AND ccnvarchar_idx = s1.idx
Error at Command Line:5 Column:92
Error report:
SQL Error: ORA-00906: missing left parenthesis
00906. 00000 -  "missing left parenthesis"
*Cause:    
*Action:


Please tell me what is wrong I m doing.

Thanks

Rajesh
Re: Problem while creating view [message #247259 is a reply to message #247244] Mon, 25 June 2007 05:22 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
You need to ad a size to your cast to NVARCHAR2 --> NVARCHAR2(<size>)

MHE
Re: Problem while creating view [message #247267 is a reply to message #247244] Mon, 25 June 2007 05:40 Go to previous message
rajesh_bhadu
Messages: 48
Registered: June 2007
Member
Thanx Maheer, It's a small mistake i'll take care in future.
thanx again.
Previous Topic: Usage of triggers
Next Topic: No wait ..
Goto Forum:
  


Current Time: Fri Dec 09 13:57:00 CST 2016

Total time taken to generate the page: 0.16997 seconds