Home » SQL & PL/SQL » SQL & PL/SQL » trim function to all char columns unix , oracle 10g (Merged)
trim function to all char columns unix , oracle 10g (Merged) [message #418222] Thu, 13 August 2009 08:50 Go to next message
dr46014
Messages: 48
Registered: February 2007
Member
is it possible write apply a trim function to all the varchar or character column of a table.There are around 600 columns in the table and out of which 500 are of char/varchar type.So i want to select all the columns with string type columns trimmed.

can i write less code like select trim(*) ....
something like this..
please suggest


Thanks
Deepak
Re: trim function to all char columns [message #418223 is a reply to message #418222] Thu, 13 August 2009 08:51 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Nope.
You could however generate your code.
trim function to all char columns [message #418224 is a reply to message #418222] Thu, 13 August 2009 08:53 Go to previous messageGo to next message
dr46014
Messages: 48
Registered: February 2007
Member
is it possible write apply a trim function to all the varchar or character column of a table.There are around 600 columns in the table and out of which 500 are of char/varchar type.So i want to select all the columns with string type columns trimmed.

can i write less code like select trim(*) ....
something like this..
please suggest


Thanks
Deepak
Re: trim function to all char columns [message #418226 is a reply to message #418224] Thu, 13 August 2009 08:54 Go to previous messageGo to next message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
Yes , write a SQL statement that writes 1 trim statement per column.
Re: trim function to all char columns [message #418419 is a reply to message #418226] Fri, 14 August 2009 23:00 Go to previous message
Kevin Meade
Messages: 2101
Registered: December 1999
Location: Connecticut USA
Senior Member
I was having a bad day when I wrote this but it can help is you are willing to read it.

The Phoenix Rises: a How-To for SQL FROM SQL

Good luck, Kevin
Previous Topic: Difference between the Following
Next Topic: update the char column to upper after insert or update to the same column
Goto Forum:
  


Current Time: Fri Dec 09 15:55:11 CST 2016

Total time taken to generate the page: 0.17182 seconds