473,699 Members | 3,360 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cannot change column name.

I inadvertantly named a field "in"

mysql> select * from guestbook;
+----+-------+-------+-----------------+----------------+
| id | fname | lname | comments | in |
+----+-------+-------+-----------------+----------------+
| 1 | Mick | White | Test 123 | 20050208000000 |
| 2 | Ann | White | Hello World | 20050213101948 |
| 3 | | | It's a nice day | 20050213102405 |
+----+-------+-------+-----------------+----------------+
mysql> select in from guestbook;
ERROR 1064: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'in from guestbook' at line 1

But I can't seem to be able to change it:
mysql> alter guestbook change in time_in;
ERROR 1064: You have an error in your SQL syntax. Check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'guestbook change in time_in' at line 1

The table:
mysql> desc guestbook;
+----------+-----------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------+-----------------+------+-----+---------+----------------+
| id | int(4) unsigned | | PRI | NULL | auto_increment |
| fname | varchar(10) | | PRI | | |
| lname | varchar(10) | | | | |
| comments | text | | | | |
| in | timestamp(14) | YES | | NULL | |
+----------+-----------------+------+-----+---------+----------------+

Any takers?
Mick
Jul 23 '05 #1
2 2298
On Sun, 13 Feb 2005 18:56:29 GMT, in mailing.databas e.mysql Mick White
<mw***********@ rochester.rr.co m> wrote:
| I inadvertantly named a field "in"
|
| mysql> select * from guestbook;
| +----+-------+-------+-----------------+----------------+
| | id | fname | lname | comments | in |
| +----+-------+-------+-----------------+----------------+
| | 1 | Mick | White | Test 123 | 20050208000000 |
| | 2 | Ann | White | Hello World | 20050213101948 |
| | 3 | | | It's a nice day | 20050213102405 |
| +----+-------+-------+-----------------+----------------+
| mysql> select in from guestbook;
| ERROR 1064: You have an error in your SQL syntax. Check the manual that
| corresponds to your MySQL server version for the right syntax to use
| near 'in from guestbook' at line 1
|
| But I can't seem to be able to change it:
| mysql> alter guestbook change in time_in;
| ERROR 1064: You have an error in your SQL syntax. Check the manual that
| corresponds to your MySQL server version for the right syntax to use
| near 'guestbook change in time_in' at line 1
|
| The table:
| mysql> desc guestbook;
| +----------+-----------------+------+-----+---------+----------------+
| | Field | Type | Null | Key | Default | Extra |
| +----------+-----------------+------+-----+---------+----------------+
| | id | int(4) unsigned | | PRI | NULL | auto_increment |
| | fname | varchar(10) | | PRI | | |
| | lname | varchar(10) | | | | |
| | comments | text | | | | |
| | in | timestamp(14) | YES | | NULL | |
| +----------+-----------------+------+-----+---------+----------------+
|


ALTER TABLE `t2` CHANGE COLUMN `in` `time_in` TIMESTAMP(14);
---------------------------------------------------------------
jn******@yourpa ntsyahoo.com.au : Remove your pants to reply
---------------------------------------------------------------
Jul 23 '05 #2
Jeff North wrote:


ALTER TABLE `t2` CHANGE COLUMN `in` `time_in` TIMESTAMP(14);

Thanks, Jeff, that did the trick.
Mick
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
5473
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
1
4232
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get the example to work. I created the following two classes, provided with the example: *-*-**-*-*-*-*-*-*-*-*-*-**-*-*-*-*-CheckBoxColumn Class:-*-*-*-*-*-*-*-*-*-*-**-*-*-*-*-**-*-*-*
3
1373
by: Lori Markle via .NET 247 | last post by:
(Type your message here) Hi, I'm having a problem with binding a textbox to a dataset. Cananybody figure out what's going on here? I simply want to update a record. Type in a permit number andsave it to the database. I get the "cannot bind to columnpermitnumber on datasource" error, or if I add the tablename.column name into the binding, a permit number that alreadyexists pops up. Here is my code: Dim dbConn As...
6
10675
by: Aaron Smith | last post by:
Ok. I have a dataset that has multiple tables in it. In one of the child tables, I have a column that I added to the DataSet (Not in the DataSource). This column does not need to be stored in the data on the datasource. It simply gets the first name and last name of an instructor and displays it in the grid. I have two major problems.... One, it doesn't display in the column until the row is saved, (Even after calling a refresh on the...
6
13187
by: ssailor | last post by:
Hi, everybody, I am rusty with VB. In the following code, ------------------------------------------------------ Dim dbCmd1 As OleDbCommand = New OleDbCommand("UPDATE tblLogin SET Password = '1'") ' WHERE UserID = 'Admin'") Dim dbCmd1 As OleDbCommand = New OleDbCommand("SELECT * FROM tblLogin WHERE UserID = 'Admin'") '" + g_userID + "'") dbCmd1.Connection = g_loginConn dbCmd1.Connection = g_loginConn
3
15019
by: kjqua | last post by:
Hi all, I am newbie in c# and i have a question regarding DataGridView I have a Table with 3 Columns (0)IdLeggiSeriale <Is Primary key> (1)ValoreSeriale <Is Integer> (2)DataAcquisizione <Is DateTime>
3
11219
by: Coll | last post by:
I inherited a database. On one of the forms, a bunch of fields on the form are to be updated with data from a combo box containing many columns after one particular field is updated. I'm receiving an error message "Field cannot be a zero length string." I do have some records with null values for a few fields - no way around that. How can I prevent the error message from occurring? Here's a sample of the code... Me! = Me!.Column(9) Me!...
2
5768
by: bogie | last post by:
Hello I have some problem to change my column data type in my table property from character(15) to character(100). I use Postgresql 7.4. The problem is I try to make new column with charcater(100) then i copy the data from teh original column to the new column, then i try to drop the column but i get the following ERROR : Cannot drop table invention column invention_cite because the other objects depend on it. Is any body can help me to...
5
16941
by: captainphoenix | last post by:
visual basic 2005, this is my code: Dim frminterfacea As New frmInterface frminterfacea.Show() this loaded up the form frminterface until today. it worked fine yesterday, no change in code, now i get this message at runtime: ArgumentException was unhandled Cannot bind to the property or column Item Name on the DataSource. Parameter name: dataMember
0
8623
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9187
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8936
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8894
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7776
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6540
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.