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: 24958
Registered: January 2009
Location: SoCal
Senior Member
>how can i do that?
Previous Topic: Problem Using table name in PLSQL fetched from cursor (merged)
Next Topic: difference between dropping and unusable index
Goto Forum:

Current Time: Sun Oct 23 05:10:12 CDT 2016

Total time taken to generate the page: 0.10154 seconds