SQL - multiple statements

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

SQL - multiple statements

drfg2008
in our MySQL queries we have multiple statements and would like to run them within one single macro.
Unfortunately the macro only executes part of them although the settings are "allow multiple statements"

this is the order of commands:

1 DROP TABLE IF EXISTS
2 CREATE TABLE
3 DELETE FROM
4 SELECT

1-3 is executed and runs within one single macro without problems. But  "4. SELECT" is not executed.

I would like to know if  there is a way to have all statements within one macro.





Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: SQL - multiple statements

Ruben Geert van den Berg
Dear Frank,

I manage the MySQL Database underlying a website from within SPSS by using a self written Python module that uses Python's MySQLDB module. When I run one command, some 150 queries are run.

It works like a real charm. If you switch from macros to Python you'll regret you hadn't done so sooner.

HTH,

Ruben
Reply | Threaded
Open this post in threaded view
|

Re: SQL - multiple statements

David Marso
Administrator
In reply to this post by drfg2008
Once again you don't bother to post your syntax!
Not jumping into your rabbit hole!
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: SQL - multiple statements

drfg2008


@ David: Can paste the syntax here, but it is quite large. The problem occurs as soon as there is a SELECT statement. Same problem with Python and even without Macro. Settings are: allow multiple statements.

Dr. Frank Gaeth

Reply | Threaded
Open this post in threaded view
|

Re: SQL - multiple statements

David Marso
Administrator
No oe will bother to wade through your large syntax anyway!
CREATE A *VERY* SIMPLE EXAMPLE WHICH BREAKS!!!!!
drfg2008 wrote
@ David: Can paste the syntax here, but it is quite large. The problem occurs as soon as there is a SELECT statement. Same problem with Python and even without Macro. Settings are: allow multiple statements.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"