Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Create view using CAST to change datatype

RE: Create view using CAST to change datatype

From: Igor Neyman <ineyman_at_perceptron.com>
Date: Fri, 19 Mar 2004 10:05:39 -0500
Message-ID: <001a01c40dc3$a4497d80$0704a8c0@development.perceptron.com>


Why not use to_number(decode(OB_OID, ' ', null, OB_OID)) Instead of CAST?

Igor Neyman, OCP DBA
ineyman_at_perceptron.com

-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Saira Somani-Mendelin
Sent: Friday, March 19, 2004 10:03 AM
To: oracle-l_at_freelists.org
Subject: RE: Create view using CAST to change datatype

Tom,

That's a great suggestion, but how could I do that in a view? Perhaps like this? CAST(RTRIM(OB_OID) AS NUMBER) OB_OID... would that work?

Here is the view definition:

CREATE OR REPLACE VIEW V_ITH_F
AS
(SELECT
  ITH_RID,
  TRANSACT,
  SKU,
  PKG,
  FROM_LOC,
  TO_LOC,
  TRANSACT_STT,
  WAVE,
  CAST(OB_OID AS NUMBER) OB_OID,
  OB_TYPE,
  CAST(IB_OID AS NUMBER) IB_OID,

  IB_TYPE, 
  OB_LNO, 
  IB_LNO, 

  ACT_QTY,
  WHSE,
FROM
ITH_F);
-----Original Message-----

From: oracle-l-bounce_at_freelists.org
[mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Mercadante, Thomas F Sent: March 19, 2004 9:54 AM
To: 'oracle-l_at_freelists.org'
Subject: RE: Create view using CAST to change datatype

Saira,

My first idea would be to trim the blanks from the column thus converting
the value to a null before casting. Would that work? What happens with the
Cast statement when a null value is involved? Can you show the Create View
Sql?

thanks

Tom Mercadante
Oracle Certified Professional



Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html


Please see the official ORACLE-L FAQ: http://www.orafaq.com

To unsubscribe send email to: oracle-l-request_at_freelists.org put 'unsubscribe' in the subject line.
--

Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
Received on Fri Mar 19 2004 - 09:02:10 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US