|
Jankomatic Beginner
Joined: 17 Jul 2009 Posts: 12
|
Posted: Fri Apr 28, 2017 11:34 pm
SQL Query question |
Having issues making an alias to query my dB. I am a noob at this.
I want the alias to return all thing from the dB with legging in the name field.
#SQLDB stuff.db
row = %sql(stuff, "SELECT * FROM name LIKE '%legging%'")
#SHOW "Title: " @row.Item("Title")
CMUD gives me a syntax error saying argument expected.
Doing an alias with the following, which is from the help, also returns the same syntax.
#SQLDB sessions.db
row = %sql(sessions, "SELECT * FROM chardb")
#WHILE (!@row.Eof()) {#SHOW @row.Item("Title");#CALL @row.Next}
#SQLCLOSE sessions
Thanks in advance |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Sun Apr 30, 2017 5:22 am |
The table name is missing in your query - it should be "SELECT * FROM [table name] WHERE name LIKE '%legging%'". Although if you're getting the same error on the sample code, it sounds like a different issue and I don't know what would cause it, sorry.
|
|
|
|
Jankomatic Beginner
Joined: 17 Jul 2009 Posts: 12
|
Posted: Sun Apr 30, 2017 10:58 pm |
I thought name was the table, not sure what the table is then if not.
|
|
|
|
Jankomatic Beginner
Joined: 17 Jul 2009 Posts: 12
|
Posted: Tue May 02, 2017 12:14 am |
Anyone else got any other help? Surely I am missing something easy here.
|
|
|
|
screel88 Newbie
Joined: 12 Jun 2009 Posts: 6
|
Posted: Tue May 09, 2017 4:00 am |
Change the first line of the example from the helpfile to
#SQLDB sessions sessions.db
That should get you going again. |
|
|
|
|
|