reset password
Author Message
raywu64
Posts: 44
Posted 13:09 Nov 10, 2015 |

I'm getting this syntax error and I'm not sure why. I'm fairly certain I'm following the grammar.

Screenshot is attached. 

 

Attachments:
cysun
Posts: 2935
Posted 15:27 Nov 10, 2015 |

It's a bug in the client SQLInterpreter. The code tries to determine whether an SQL statement is a query or an update by checking whether the statement starts with "select" (case-sensitive). You can fix the bug by changing the code cmd.startsWith("select") to cmd.toLowerCase().startsWith("select").

raywu64
Posts: 44
Posted 15:31 Nov 10, 2015 |

Hello Dr. Sun, 

Thanks for the reply. Writing the query in all lower-case seems to work. I can see that it generates a result but the console quickly changes to display this: https://gyazo.com/5c6111e86daf5583d9cfc53c56d1674a 

I can only see the result for <1 second. 

cysun
Posts: 2935
Posted 15:48 Nov 10, 2015 |

Because you are running two programs (one client program and one server program), the console view will switch back and forth between two consoles. You can go back to the console for the client by selecting it in the drop-down list shown in the screenshot below:

raywu64
Posts: 44
Posted 15:57 Nov 10, 2015 |

Oh ok, I see. Thanks again.