Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | Questions | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

 
 
 
 Category : Home > Databases > Oracle > Replication     

Generate syntax for snapshots with rtrim for char columns


Script to generate column list with rtrim function for char type columns for Oracle snapshot
creation, these columns will be converted to varchar2 on the snapshot site. Run from sqlplus
on the master site (where the snapshot logs are).

set head off pagesize 0

select case 
	when data_type = 'CHAR'
		then 'rtrim (' || column_name || ') ' || column_name || ', '
	when data_type <> 'CHAR'
		then column_name || ', '
	end
from dba_tab_columns
where table_name = 'TADADDRFAST'
and owner = 'ADO999'
order by column_id asc
/


  Options
 
   del.icio.us  |  newsvine  |  digg  |  furl  |  google  |  yahoo  |  Ma.gnolia  |  vigillar  |  reddit  |  technorati  |  icerocket  |  pubsub

       Rate this tip:    

Start discussion or add comment to this tip

  Details
Tip reference : #116
views : 910
Added on : 09/22/06
Submited by : h8dk97
 
Send a message Send a message Printer friendly output Printer friendly output
Display this member's tips Display this member's tips (202)
 
 
<< Previous Next >>
 Most viewed tips 
  Databases > Oracle > Security : How to unlock Oracle user account  
  Databases > Oracle > Performance Tuning : How to enable trace in Oracle  
  Operating Systems > Unix : How to kill Unix user session  
  Databases > Oracle : Kill user session  
   
  All categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Mobile Phones / Tablets | Office Software
 
 

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com