plainblack.com
Username Password
search
Bookmark and Share

    

SQL macro doesn't work?

User elnino
Date 12/7/2006 5:32 pm
Views 2246
Rating 16    Rate [
|
]
Previous · Next
User Message
elnino

I don't know if it's the example I'm using (it looks right based on the help and db schema), or if the SQL macro doesn't work...

I've created an article, and put the following in the description. 

^SQL("select count(*) from users","There are ^0; users on this system.");

But it simply prints out as such, and it doesn't run the macro. I'm able to run other macros and can create macros.

 So either Im missing somethign, or SQL doesn't work. I'm running 7.2.1.

Thanks!

LN 

--- (Edited on 12/ 7/2006 5:32 pm [GMT-0600] by elnino) ---



Back to Top
Rate [
|
]
 
 
isaac

Have you enabled the macro in the config?  The SQL macro is not enabled by default.  You need this line in the config:

"SQL" : "SQL" ,

 In the macro area. 

--- (Edited on 12/ 7/2006 5:41 pm [GMT-0600] by isaac) ---



Back to Top
Rate [
|
]
 
 
elnino
yeah... I JUST thought of that. You beat me to it. That was the problem. Thank you!

--- (Edited on 12/ 7/2006 5:53 pm [GMT-0600] by elnino) ---



Back to Top
Rate [
|
]
 
 
nikkimercier
but how do you select to use  database for which you have created a link with ^SQL. I'm trying to enumerate a list of options from SQL using select Country from Data GROUP BY Country to get a unique list to return to the system but I can't seem to get it to look elsewhere other than the WG DB! :<

--- (Edited on 12/10/2006 3:00 am [GMT-0600] by nikkimercier) ---



Back to Top
Rate [
|
]
 
 
colink
by default, it only uses the WebGUI database.  If you check in the contribs section, you'll see a macro which extends the SQL macro to also do other databases.

--- (Edited on 12/10/2006 4:09 pm [GMT-0600] by colink) ---



Back to Top
Rate [
|
]
 
 
    



© 2010 Plain Black Corporation | All Rights Reserved