473,320 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Modification of the length of a field in a database

I have a small problem or rather a question. I want to change the length of a column: e.g. from VARCHAR2(1) to VARCHAR2(4). The column stores values which are Primary Keys. Is there any problem to do the modification? I can't lose data.

I really need Your opinions.

Brgds.
Feb 7 '08 #1
5 1355
amitpatel66
2,367 Expert 2GB
I have a small problem or rather a question. I want to change the length of a column: e.g. from VARCHAR2(1) to VARCHAR2(4). The column stores values which are Primary Keys. Is there any problem to do the modification? I can't lose data.

I really need Your opinions.

Brgds.
Expand|Select|Wrap|Line Numbers
  1.  
  2. ALTER TABLE table_name MODIFY column_name VARCHAR2(4)
  3.  
  4.  
Feb 7 '08 #2
Expand|Select|Wrap|Line Numbers
  1.  
  2. ALTER TABLE table_name MODIFY column_name VARCHAR2(4)
  3.  
  4.  
Yes, I know that, but I wonder if there are any contraindications to it, as I have Primary Keys in that column.
Feb 7 '08 #3
amitpatel66
2,367 Expert 2GB
Yes, I know that, but I wonder if there are any contraindications to it, as I have Primary Keys in that column.
No not at all.
Go ahead and run the query.
Since the old column size is smaller than the new column size, you need not drop the data also
Feb 7 '08 #4
Thanks a lot. It really helped me :)
Feb 7 '08 #5
amitpatel66
2,367 Expert 2GB
Thanks a lot. It really helped me :)
You are always welcome with any kind of issues :)
We will try our best to help you out!!

MODERATOR
Feb 7 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: portraitmaker | last post by:
I found some drag and drop code on the web and modified it a little b taking out some of the stuff I didn't need. This sample allows you to drag an image in a table to another positio and swaps...
29
by: Frank Millman | last post by:
Hi all I am writing a multi-user accounting/business system. Data is stored in a database (PostgreSQL on Linux, SQL Server on Windows). I have written a Python program to run on the client,...
4
by: Mark | last post by:
How can i get the maximum allowed length for a field in a SQL database? ie the value defined when creating a text field in a table, in a SQL database. As i want to set the max length of a text...
3
by: philip | last post by:
hello i am new to asp.net and sql server 2005 programming. i am wondering how to code asp.net to prevent multiuser from modifying a share data (on sql server) at the same time. should i do some...
3
by: MarcJoseph | last post by:
I have a database that is shared my multiple users who enter and update records on a weekly basis. Is there a way I can add a field to my main data table that will automatically generate the...
1
by: kd8con | last post by:
Ok, I am writing an application in which - a user enters data into a field, then when leaving this field and going to the next field, I need to do a search on the access database for that data and...
2
by: SSG | last post by:
In my database table , I have field to store the text,.. I am tryinf to find the length of the filed in ASP like below response.write len(rs("cname1")) It is displaying the value , when the...
3
by: imtmub | last post by:
Hi All, I am facing some problem in the field data(Description field in Item table). In that table one field(Description field)data legth is 255 and type: nvarchar. In some operation this field data...
6
by: Neil | last post by:
I had a strange situation with a view in SQL 7, that I could use some input on. I had a very simple view -- select a, b, c from table1 where x=y and z=q. Field a in table1 originally was varchar...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.