Re: [sqlite] UI question
John wrote: John wrote: Griggs, Donald wrote: Regarding: " Where I get tripped up is making a typo in a multiline query that may have destructive effects if I terminate with a ';' and allow the CLI to execute the query. To date I have aborted the CLI with a ^C (MS Windows). I would love have a means of escaping/cancelling back to the prompt without executing from a partially entered query. Perhaps the escape key is a good candidate for actioning this functionality should someone implement it." Why not just add the word "damnit;" (or almost anything) to the end of the query, resulting in a syntax error -- and no changes to your database? Probably because I didn't think of it at the time - thanks Donald, but I would still like to push one key and cancel the current entry like I can in a Cmd.exe CLI console. Is this feature not common in CLI consoles on other OS. Talking to myself - perhaps cmd.exe can do this because it only supports one line of entry, I understand (mainly from hearsay) that CLI consoles on other OS can support multiline entries and therefore (my supposition) may not be able to support cancellation of the current entry, so that feature may not be common in non Windows environments. If IRC it wasn't available in MSDOS command.com either, but one could always BS over the current line. Therein lies the problem - you can't edit a previous line in a multiline statement in the sqlite CLI before committing the statement for execution by terminating with ';' whether the line contains garbage to deliberately abort the interpreter or not. There is a host of GUI-based Sqlite tools which replace the command line program and satisfy your wishes. Try out a few and choose the one you like best. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
John wrote: Griggs, Donald wrote: Regarding: " Where I get tripped up is making a typo in a multiline query that may have destructive effects if I terminate with a ';' and allow the CLI to execute the query. To date I have aborted the CLI with a ^C (MS Windows). I would love have a means of escaping/cancelling back to the prompt without executing from a partially entered query. Perhaps the escape key is a good candidate for actioning this functionality should someone implement it." Why not just add the word "damnit;" (or almost anything) to the end of the query, resulting in a syntax error -- and no changes to your database? Probably because I didn't think of it at the time - thanks Donald, but I would still like to push one key and cancel the current entry like I can in a Cmd.exe CLI console. Is this feature not common in CLI consoles on other OS. Talking to myself - perhaps cmd.exe can do this because it only supports one line of entry, I understand (mainly from hearsay) that CLI consoles on other OS can support multiline entries and therefore (my supposition) may not be able to support cancellation of the current entry, so that feature may not be common in non Windows environments. If IRC it wasn't available in MSDOS command.com either, but one could always BS over the current line. Therein lies the problem - you can't edit a previous line in a multiline statement in the sqlite CLI before committing the statement for execution by terminating with ';' whether the line contains garbage to deliberately abort the interpreter or not. -- Regards John McMahon [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
Griggs, Donald wrote: Regarding: " Where I get tripped up is making a typo in a multiline query that may have destructive effects if I terminate with a ';' and allow the CLI to execute the query. To date I have aborted the CLI with a ^C (MS Windows). I would love have a means of escaping/cancelling back to the prompt without executing from a partially entered query. Perhaps the escape key is a good candidate for actioning this functionality should someone implement it." Why not just add the word "damnit;" (or almost anything) to the end of the query, resulting in a syntax error -- and no changes to your database? Probably because I didn't think of it at the time - thanks Donald, but I would still like to push one key and cancel the current entry like I can in a Cmd.exe CLI console. Is this feature not common in CLI consoles on other OS. -- Regards John McMahon [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] UI question
Regarding: " Where I get tripped up is making a typo in a multiline query that may have destructive effects if I terminate with a ';' and allow the CLI to execute the query. To date I have aborted the CLI with a ^C (MS Windows). I would love have a means of escaping/cancelling back to the prompt without executing from a partially entered query. Perhaps the escape key is a good candidate for actioning this functionality should someone implement it." Why not just add the word "damnit;" (or almost anything) to the end of the query, resulting in a syntax error -- and no changes to your database? - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
[EMAIL PROTECTED] wrote: Scott Derrick <[EMAIL PROTECTED]> wrote: This is probably a stupid question but has frustrated me a couple of times. When using the command line interface sqlite3, a couple of times I have forgotten to use the "." before a command. After that I get a "...>" prompt that I can't seem to escape from and accepts no commands? My only choice is to shut down that terminal and start a new one.. There must be an easy way to get back to the command mode? And what is the "...>" mode? Type a semicolon on a line by itself. You'll then get a syntax error and you will be back at the command prompt. Where I get tripped up is making a typo in a multiline query that may have destructive effects if I terminate with a ';' and allow the CLI to execute the query. To date I have aborted the CLI with a ^C (MS Windows). I would love have a means of escaping/cancelling back to the prompt without executing from a partially entered query. Perhaps the escape key is a good candidate for actioning this functionality should someone implement it. -- Regards John McMahon [EMAIL PROTECTED] - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
Joe Wilson wrote: --- [EMAIL PROTECTED] wrote: Joe Wilson <[EMAIL PROTECTED]> wrote: --- John Stanton <[EMAIL PROTECTED]> wrote: Sqlite3 will get into a tangle with certain sequences where it does not accept a semicolon as a terminator or obey a CTL c. To reproduce: 1. build sqlite3 without readline support. 2. run sqlite3 in an xterm 3. at the prompt, press cursor up 4. hit return Nothing you do at this point will work except for Ctrl-\ to kill the process. SQLite version 3.4.1 Enter ".help" for instructions sqlite> ^[[A ...> .q ...> ; ...> select 1; SQLite allows identifiers to be quoted using square brackets. Like this: CREATE TABLE [alpha]([beta],[gamma]); In the input above, SQLite sees the beginning of a quoted identifier in the "[A" but it never sees the terminating "]" so it keeps asking for more input. It things the semicolons you are feeding it are part of the identifier. To break out of the loop, enter "];". Works as designed It makes sense in hindsight. Even though [] would be an illegal first token in any shell or SQL command, you only attempt to tokenize/parse the line when you get to the end of statement ";". Would incremental tokenizing/parsing be easy to implement to catch this case? Lucky in this case I happened to be running in an xterm that echoed the ^[[A characters. Other terminal programs I've used (such as rxvt on cygwin) doesn't print the ^[[A to the screen at all, but instead moves the cursor up one line. In that case it is not obvious what is going on, or that ]; will take you out of that mode. I guess the user just has to know a little about terminal ascii escape sequences and sqlite token syntax. It didn't cross my mind that this effect could be an artifact of the [] delimiters. What xterm echoes should have been a clue. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
--- [EMAIL PROTECTED] wrote: > Joe Wilson <[EMAIL PROTECTED]> wrote: > > --- John Stanton <[EMAIL PROTECTED]> wrote: > > > Sqlite3 will get into a tangle with certain sequences where it does not > > > accept a semicolon as a terminator or obey a CTL c. > > > > To reproduce: > > > > 1. build sqlite3 without readline support. > > 2. run sqlite3 in an xterm > > 3. at the prompt, press cursor up > > 4. hit return > > > > Nothing you do at this point will work except for Ctrl-\ to kill the > > process. > > > > SQLite version 3.4.1 > > Enter ".help" for instructions > > sqlite> ^[[A > >...> .q > >...> ; > >...> select 1; > > SQLite allows identifiers to be quoted using square brackets. > Like this: CREATE TABLE [alpha]([beta],[gamma]); > > In the input above, SQLite sees the beginning of a quoted > identifier in the "[A" but it never sees the terminating "]" > so it keeps asking for more input. It things the semicolons > you are feeding it are part of the identifier. > > To break out of the loop, enter "];". > > Works as designed It makes sense in hindsight. Even though [] would be an illegal first token in any shell or SQL command, you only attempt to tokenize/parse the line when you get to the end of statement ";". Would incremental tokenizing/parsing be easy to implement to catch this case? Lucky in this case I happened to be running in an xterm that echoed the ^[[A characters. Other terminal programs I've used (such as rxvt on cygwin) doesn't print the ^[[A to the screen at all, but instead moves the cursor up one line. In that case it is not obvious what is going on, or that ]; will take you out of that mode. I guess the user just has to know a little about terminal ascii escape sequences and sqlite token syntax. Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. http://tv.yahoo.com/ - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
Joe Wilson <[EMAIL PROTECTED]> wrote: > --- John Stanton <[EMAIL PROTECTED]> wrote: > > Sqlite3 will get into a tangle with certain sequences where it does not > > accept a semicolon as a terminator or obey a CTL c. > > To reproduce: > > 1. build sqlite3 without readline support. > 2. run sqlite3 in an xterm > 3. at the prompt, press cursor up > 4. hit return > > Nothing you do at this point will work except for Ctrl-\ to kill the process. > > SQLite version 3.4.1 > Enter ".help" for instructions > sqlite> ^[[A >...> .q >...> ; >...> select 1; SQLite allows identifiers to be quoted using square brackets. Like this: CREATE TABLE [alpha]([beta],[gamma]); In the input above, SQLite sees the beginning of a quoted identifier in the "[A" but it never sees the terminating "]" so it keeps asking for more input. It things the semicolons you are feeding it are part of the identifier. To break out of the loop, enter "];". Works as designed -- D. Richard Hipp <[EMAIL PROTECTED]> - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] UI question
Simply put a ; there..it will finish the command and says invalid sqlite command and comes back to the commad mode again. -Original Message- From: Griggs, Donald [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 8:04 PM To: sqlite-users@sqlite.org Subject: RE: [sqlite] UI question -Original Message- From: Scott Derrick [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 10:22 AM To: sqlite-users@sqlite.org Subject: [sqlite] UI question This is probably a stupid question but has frustrated me a couple of times. When using the command line interface sqlite3, a couple of times I have forgotten to use the "." before a command. After that I get a "...>" prompt that I can't seem to escape from and accepts no commands? My only choice is to shut down that terminal and start a new one.. There must be an easy way to get back to the command mode? And what is the "...>" mode? Scott = Hi Scott, The command line utility thinks you are continuing a long SQL command. A semicolon (;) will terminate it, put you back to command mode, and allow you to .quit - To unsubscribe, send email to [EMAIL PROTECTED] - ** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify [EMAIL PROTECTED] ** - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
On Thu, 2 Aug 2007 14:16:28 -0700 (PDT), Joe Wilson wrote: >--- John Stanton <[EMAIL PROTECTED]> wrote: >> Sqlite3 will get into a tangle with certain sequences where it does not >> accept a semicolon as a terminator or obey a CTL c. >To reproduce: >1. build sqlite3 without readline support. >2. run sqlite3 in an xterm >3. at the prompt, press cursor up >4. hit return >Nothing you do at this point will work except for Ctrl-\ to kill the process. >SQLite version 3.4.1 >Enter ".help" for instructions >sqlite> ^[[A > ...> .q > ...> ; > ...> select 1; > ...> .q > ...> .h > ...> ; > ...> ; Is this a weakness in the scanner or its state table? Is readline() providing the command history feature that is so valuable during repetitive debugging? And for which the up arrow is an essential keystroke? - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
It seems to be connected with xterm. Joe Wilson wrote: --- John Stanton <[EMAIL PROTECTED]> wrote: Sqlite3 will get into a tangle with certain sequences where it does not accept a semicolon as a terminator or obey a CTL c. To reproduce: 1. build sqlite3 without readline support. 2. run sqlite3 in an xterm 3. at the prompt, press cursor up 4. hit return Nothing you do at this point will work except for Ctrl-\ to kill the process. SQLite version 3.4.1 Enter ".help" for instructions sqlite> ^[[A ...> .q ...> ; ...> select 1; ...> .q ...> .h ...> ; ...> ; Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. http://tv.yahoo.com/ - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
Sqlite3 will get into a tangle with certain sequences where it does not accept a semicolon as a terminator or obey a CTL c. Chris Peachment wrote: On Thu, 02 Aug 2007 08:21:30 -0600, Scott Derrick wrote: This is probably a stupid question but has frustrated me a couple of times. When using the command line interface sqlite3, a couple of times I have forgotten to use the "." before a command. After that I get a "...>" prompt that I can't seem to escape from and accepts no commands? My only choice is to shut down that terminal and start a new one.. There must be an easy way to get back to the command mode? And what is the "...>" mode? Scott Try typing the semi-colon to terminate the sql statement. You should get a syntax error report and no further action. The command prompt should appear on the next line. Chris - To unsubscribe, send email to [EMAIL PROTECTED] - - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
--- John Stanton <[EMAIL PROTECTED]> wrote: > Sqlite3 will get into a tangle with certain sequences where it does not > accept a semicolon as a terminator or obey a CTL c. To reproduce: 1. build sqlite3 without readline support. 2. run sqlite3 in an xterm 3. at the prompt, press cursor up 4. hit return Nothing you do at this point will work except for Ctrl-\ to kill the process. SQLite version 3.4.1 Enter ".help" for instructions sqlite> ^[[A ...> .q ...> ; ...> select 1; ...> .q ...> .h ...> ; ...> ; Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. http://tv.yahoo.com/ - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
> This is probably a stupid question but has frustrated me a couple of times. > > When using the command line interface sqlite3, a couple of times I have > forgotten to use the "." before a command. After that I get a "...>" > prompt that I can't seem to escape from and accepts no commands? My > only choice is to shut down that terminal and start a new one.. > > There must be an easy way to get back to the command mode? Drink a glass of water and have someone scare you. ...Umm, nevermind, that's for hiccups. Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center. http://autos.yahoo.com/green_center/ - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
It is a bug in sqlite3. You can kill the process from another channel or supend it with a CTL Z and then kill it locally. Scott Derrick wrote: This is probably a stupid question but has frustrated me a couple of times. When using the command line interface sqlite3, a couple of times I have forgotten to use the "." before a command. After that I get a "...>" prompt that I can't seem to escape from and accepts no commands? My only choice is to shut down that terminal and start a new one.. There must be an easy way to get back to the command mode? And what is the "...>" mode? Scott - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
also if the semicolon does not get you back to the prompt you may have an open quoted string so try a "; to close it and get you back. Quoting Dan Kennedy <[EMAIL PROTECTED]>: > On Thu, 2007-08-02 at 08:21 -0600, Scott Derrick wrote: > > This is probably a stupid question but has frustrated me a couple of > times. > > > > When using the command line interface sqlite3, a couple of times I have > > forgotten to use the "." before a command. After that I get a "...>" > > prompt that I can't seem to escape from and accepts no commands? My > > only choice is to shut down that terminal and start a new one.. > > > > There must be an easy way to get back to the command mode? And what is > > the "...>" mode? > > It means "keep typing, the SQL statement isn't finished yet". > > Add a semi-colon and press enter. The shell will figure the > SQL statement is complete and hand it off to the sqlite libary > for execution. The SQLite libary will tell you it's a syntax > error. > > Dan. > > > > > > Scott > > > > > - > To unsubscribe, send email to [EMAIL PROTECTED] > - > > - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
When using the command line interface sqlite3, a couple of times I have forgotten to use the "." before a command. After that I get a "...>" prompt that I can't seem to escape from and accepts no commands? My only choice is to shut down that terminal and start a new one.. There must be an easy way to get back to the command mode? And what is the "...>" mode? It's a continuation line, which allows your SQL statements to span multiple lines. Just hit ; and you'll receive an error that says "invalid sql" or something similar, and you'll be able to enter another command. - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
On Thu, 02 Aug 2007 08:21:30 -0600, Scott Derrick wrote: >This is probably a stupid question but has frustrated me a couple of times. >When using the command line interface sqlite3, a couple of times I have >forgotten to use the "." before a command. After that I get a "...>" >prompt that I can't seem to escape from and accepts no commands? My >only choice is to shut down that terminal and start a new one.. >There must be an easy way to get back to the command mode? And what is >the "...>" mode? >Scott Try typing the semi-colon to terminate the sql statement. You should get a syntax error report and no further action. The command prompt should appear on the next line. Chris - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
On Thu, 2007-08-02 at 08:21 -0600, Scott Derrick wrote: > This is probably a stupid question but has frustrated me a couple of times. > > When using the command line interface sqlite3, a couple of times I have > forgotten to use the "." before a command. After that I get a "...>" > prompt that I can't seem to escape from and accepts no commands? My > only choice is to shut down that terminal and start a new one.. > > There must be an easy way to get back to the command mode? And what is > the "...>" mode? It means "keep typing, the SQL statement isn't finished yet". Add a semi-colon and press enter. The shell will figure the SQL statement is complete and hand it off to the sqlite libary for execution. The SQLite libary will tell you it's a syntax error. Dan. > > Scott > - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
Scott Derrick <[EMAIL PROTECTED]> wrote: > This is probably a stupid question but has frustrated me a couple of times. > > When using the command line interface sqlite3, a couple of times I have > forgotten to use the "." before a command. After that I get a "...>" > prompt that I can't seem to escape from and accepts no commands? My > only choice is to shut down that terminal and start a new one.. > > There must be an easy way to get back to the command mode? And what is > the "...>" mode? > > Type a semicolon on a line by itself. You'll then get a syntax error and you will be back at the command prompt. -- D. Richard Hipp <[EMAIL PROTECTED]> - To unsubscribe, send email to [EMAIL PROTECTED] -
RE: [sqlite] UI question
-Original Message- From: Scott Derrick [mailto:[EMAIL PROTECTED] Sent: Thursday, August 02, 2007 10:22 AM To: sqlite-users@sqlite.org Subject: [sqlite] UI question This is probably a stupid question but has frustrated me a couple of times. When using the command line interface sqlite3, a couple of times I have forgotten to use the "." before a command. After that I get a "...>" prompt that I can't seem to escape from and accepts no commands? My only choice is to shut down that terminal and start a new one.. There must be an easy way to get back to the command mode? And what is the "...>" mode? Scott = Hi Scott, The command line utility thinks you are continuing a long SQL command. A semicolon (;) will terminate it, put you back to command mode, and allow you to .quit - To unsubscribe, send email to [EMAIL PROTECTED] -
Re: [sqlite] UI question
just enter a ; (semi-colon) to indicate that you have ended your command. SQLite will complain, and then will let you pick up and continue. On 8/2/07, Scott Derrick <[EMAIL PROTECTED]> wrote: > This is probably a stupid question but has frustrated me a couple of times. > > When using the command line interface sqlite3, a couple of times I have > forgotten to use the "." before a command. After that I get a "...>" > prompt that I can't seem to escape from and accepts no commands? My > only choice is to shut down that terminal and start a new one.. > > There must be an easy way to get back to the command mode? And what is > the "...>" mode? > > Scott > > -- > > - > As nightfall does not come at once, neither does oppression. In both > instances, there is a twilight when everything remains seemingly unchanged. > And it is in such twilight that we all must be most aware of change in the > air however slight lest we become unwitting victims of the darkness. > > William O. Douglas, Justice of the U.S. Supreme Court > > > > - > To unsubscribe, send email to [EMAIL PROTECTED] > - > > -- Puneet Kishor http://punkish.eidesis.org/ Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/ Open Source Geospatial Foundation http://www.osgeo.org/education/ S&T Policy Fellow, National Academy of Sciences http://www.nas.edu/ - collaborate, communicate, compete = - To unsubscribe, send email to [EMAIL PROTECTED] -