Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialKenneth Mentele
819 Pointserror executing query
I am receiving the error: Error formatting SQL query: empty string given as argument for !character
Has anyone else gotten this?
Kenneth Mentele
819 PointsInput: SELECT * FROM movies;
Output: Error: Error formatting SQL query: empty string give as argument for ! character
Thanks for the help!
9 Answers
Peter Anderovsky
2,602 PointsYou have to double click on database name in the left panel to become bold.
Andrei Gavrila
487 PointsThis helped me too!
Erich Stauffer
1,632 PointsThanks, Peter! This one had me stumped.
Sahil Arora
477 PointsThanks. Helped me too ! :)
Don Hamilton III
31,828 PointsWow. Seems so simple when you see it like this. Didn't know you had to double click until I saw this post. Thanks man.
Binitha Surendran
2,362 PointsThank you… this helped me
Janis Celms
44,170 PointsThank you :)
Ria Carmin
Courses Plus Student 11,848 PointsI also fixed it by double-clicking the database name ("treehouse_movie_db") on the left pane. I didn't even have to restart my computer.
Ryan Carson
23,287 PointsThe query should be just SELECT * FROM movies;
not Input: SELECT * FROM movies;
Kenneth Mentele
819 PointsSorry, I was trying to say that that's what I was inputting..
I still get the same error with
SELECT * FROM movies;
Javier Galindo
2,745 PointsLooks like the name of the table is different. I'm getting the same error. When clicking on the little grid box, next to the tool icon and information icons (under Schemas), you can see that the table is actually displayed. The code on it says: SELECT * FROM treehouse_movie_db.movies;
I don't know why the name is different though....
Hope it helps!
Kenneth Mentele
819 PointsAndres Oliva ran into the same problem - turns out the fix is very simple. Here's his answer that worked for me also.
"I don't know if you're in the exact same situation as me, but I was working on the project right after I installed the workbench. I restarted my computer and run the statement again, I only got an error that's fixed simply double clicking the database name "treehouse_movie_db" on the sidebar. Right now I am almost at the end of the course and I haven't had any more issues :)
Hope that helps!"
Thanks Andres!
John Mostert
731 PointsGot the same issue: "08:47:09 select * from movies LIMIT 0, 1000 Error: Error formatting SQL query: empty string given as argument for ! character" but having read these coments, i double clicked the movies db and it immediately ran fine.. probably need to explain in the script about selecting which db to work on or something? Sorry - complete beginner.
Regards,
John
cp88
5,039 PointsI got the same error also...I used to see this in SQL Server Management Studio too (but there was a drop-down box there so you could easily see which database you were selecting from). You have to select the database first before selecting from it, which as Peter says you can do my double-clicking it on the left-hand side under SCHEMAS. Thanks for that, Peter!
Aaron Carpenter
14,223 PointsI got the same error also, and found my answer here - needing to double-click the database name in order to select it prior to running the query. This is not all that dissimilar to phpmyadmin, for those who are familiar, in that you need to select a specific database before importing, exporting, or running a query.
Anthony Allgeier
9,184 PointsThanks that answer helped me too. Pretty glaring omission from the video for the folks at Treehouse.
Timothy James-Hammond
1,641 PointsThis helped me too - another great example of this awesome community - thanks.
Ryan Carson
23,287 PointsRyan Carson
23,287 PointsCan you please post your code?