MySQL Command Line Client: editing lines of a multiple line statement?
July 27, 2007 7:14 PM
Subscribe
Very very
very stupid MySQL command line client question: how do I edit an earlier line of a multiple line statement?
So say I've done this:
mysql> create table CUSTOMER_TBL
-> (
-> CUST_ID VARCHAR(!0) NOT NULL primary key,
-> CUST_NAME VARCHAR(30) NOT NULL,
-> CUST_CITY VARCHAR(20) NOT NULL, etc...
How do I get back to the third line and change "(!0)" to "(10)"? The help files for the tool don't have this level of novice information. The closest thing I've found is using "\c" to cancel the current statement and start over, but there must be something less draconian, right?
Also, is this specifically a MySQL issue or is this some basic command line convention I don't know? If it is, what else am I likely not to know as a newbie, and what's the best way to fill in the gaps?
posted by Lentrohamsanin to computers & internet (8 comments total)
It is a command-line convention, thanks to the "readline" library. At a bash prompt, if you typed
for flie in *; do
echo $file;
you can't go back and fix "flie" either!
posted by mendel at 7:18 PM on July 27, 2007