Geeks Talk

Prepare for your Next Interview




script

This is a discussion on script within the SQL forums, part of the Databases category; hi guys, i wanna change the type of a column i have in my table; for example from int(4) to varchar(20). any script to do that?? thanks in ...


Go Back   Geeks Talk > Databases > SQL

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 06-30-2008
Junior Member
 
Join Date: Jun 2008
Location: Lebanon
Posts: 12
Thanks: 1
Thanked 2 Times in 2 Posts
ronaldrahme is on a distinguished road
script

hi guys,

i wanna change the type of a column i have in my table;
for example from int(4) to varchar(20).
any script to do that??

thanks in advance
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-30-2008
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,432
Thanks: 8
Thanked 125 Times in 112 Posts
debasisdas will become famous soon enoughdebasisdas will become famous soon enough
Re: script

You need to alter the table for that.
Reply With Quote
  #3 (permalink)  
Old 06-30-2008
Expert Member
 
Join Date: Sep 2007
Posts: 754
Thanks: 22
Thanked 64 Times in 63 Posts
krishnaindia2007 is on a distinguished road
Re: script

Use alter table.

SQL> CREATE TABLE TEST_DATA ( X NUMBER);

Table created.

SQL> ALTER TABLE TEST_DATA MODIFY (X VARCHAR2(10));

Table altered.

You may not decrease the size of a columns or change its data type , unless it contains no data (especially for numeric data)
Reply With Quote
Reply

  Geeks Talk > Databases > SQL


Thread Tools
Display Modes


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to convert the QTP script as LR script... coolkrish LoadRunner 5 07-15-2008 10:49 AM
Conversion of QTP script in to Loadrunner script coolkrish LoadRunner 8 06-20-2008 05:22 AM
VB script within QTP test.ing59 QTP 1 05-23-2008 01:19 AM
Script which retrieves the current path of the test script niranjanbiswal QTP 1 07-18-2007 04:12 PM


All times are GMT -4. The time now is 02:52 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Copyright © 2008 GeekInterview.com. All Rights Reserved