Home » SQL & PL/SQL » SQL & PL/SQL » selecting 12 char (oracle
selecting 12 char [message #394525] Fri, 27 March 2009 11:55 Go to next message
Messages: 56
Registered: August 2008

i have oracle database on and i am tring to do following:
I am trying to selecting the testid(varchar2(20)) and cast(testid as varchar(12)) but i get both column in result same rather than 12345678912100 and need 123456789121

select testid,test_NAME, cast(testid as varchar(12)) as New_ID from test.test_hrd
where test_name like '%mc%'

i get return but both new_ID and testid are same, the testid is 14 character and i need to select 12 in new column?

how can i do that?
Re: selecting 12 char [message #394526 is a reply to message #394525] Fri, 27 March 2009 11:57 Go to previous message
Messages: 25574
Registered: January 2009
Location: SoCal
Senior Member
>how can i do that?
Previous Topic: difference between dropping and unusable index
Next Topic: URGENT: ORA-24778 - Cannot open connections error
Goto Forum:

Current Time: Mon Aug 21 01:44:16 CDT 2017

Total time taken to generate the page: 0.04919 seconds