Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Jankomatic
Beginner


Joined: 17 Jul 2009
Posts: 12

PostPosted: 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
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: 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.
Reply with quote
Jankomatic
Beginner


Joined: 17 Jul 2009
Posts: 12

PostPosted: Sun Apr 30, 2017 10:58 pm   
 
I thought name was the table, not sure what the table is then if not.
Reply with quote
Jankomatic
Beginner


Joined: 17 Jul 2009
Posts: 12

PostPosted: Tue May 02, 2017 12:14 am   
 
Anyone else got any other help? Surely I am missing something easy here.
Reply with quote
screel88
Newbie


Joined: 12 Jun 2009
Posts: 6

PostPosted: 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.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net