473,387 Members | 1,545 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,387 software developers and data experts.

Update Statement

I've already ran across most of the SQL tutorial available in the net. But I've yet to find how to edit the no. of characters of a column.

Instruction:
To edit an attribute, which was initially set to "char(25)", to "char(40)".

Hope you guys can help me. Mostly, the tutorial available just show how to edit the value of an attribute. So what's the SQL statement should be? Anyone?
Jul 14 '07 #1
5 1655
missinglinq
3,532 Expert 2GB
You're trying to use a SQL statement to change the size of a field in a table?
Jul 14 '07 #2
ADezii
8,834 Expert 8TB
I've already ran across most of the SQL tutorial available in the net. But I've yet to find how to edit the no. of characters of a column.

Instruction:
To edit an attribute, which was initially set to "char(25)", to "char(40)".

Hope you guys can help me. Mostly, the tutorial available just show how to edit the value of an attribute. So what's the SQL statement should be? Anyone?
The following code will change the Maximum size of the [Company] Field in tblEmployees to 50. It was previously 25.
Expand|Select|Wrap|Line Numbers
  1. Dim MySQL As String
  2.  
  3. MySQL = "ALTER TABLE tblEmployees ALTER COLUMN Company TEXT (50);"
  4. DoCmd.RunSQL MySQL
Jul 14 '07 #3
Yes correct. Change the size of the field.

FYI guys, Im doing this SQL query using access.

You're trying to use a SQL statement to change the size of a field in a table?
Jul 14 '07 #4
Thanks mate. I get it right. =)

The following code will change the Maximum size of the [Company] Field in tblEmployees to 50. It was previously 25.
Expand|Select|Wrap|Line Numbers
  1. Dim MySQL As String
  2.  
  3. MySQL = "ALTER TABLE tblEmployees ALTER COLUMN Company TEXT (50);"
  4. DoCmd.RunSQL MySQL
Jul 14 '07 #5
ADezii
8,834 Expert 8TB
Thanks mate. I get it right. =)
You're welcome, mate.
Jul 14 '07 #6

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

Similar topics

7
by: Dave | last post by:
I have 2 tables, one with names, and another with addresses, joined by their CIVICID number (unique to the ADDRESSINFO table) in Oracle. I need to update a field in the NAMEINFO table for a...
8
by: Lauren Quantrell | last post by:
In VBA, I constructed the following to update all records in tblmyTable with each records in tblmyTableTEMP having the same UniqueID: UPDATE tblMyTable RIGHT JOIN tblMyTableTEMP ON...
1
by: Grant McLean | last post by:
Hi First a simple question ... I have a table "access_log" that has foreign keys "app_id" and "app_user_id" that reference the "application_type" and "app_user" tables. When I insert into...
19
by: Steve | last post by:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement I got ASP error number 13 when I use the SELECT...FOR UPDATE statement as below. However, if I use SELECT statement without...
3
by: Michel Esber | last post by:
Hi all, DB2 V8 LUW FP 15 There is a table T (ID varchar (24), ABC timestamp). ID is PK. Our application needs to frequently update T with a new value for ABC. update T set ABC=? where ID...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.