~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/dynamic.rst

  • Committer: Monty Taylor
  • Date: 2011-02-13 17:24:18 UTC
  • mfrom: (2159.1.1 remove-lint)
  • mto: This revision was merged to the branch mainline in revision 2166.
  • Revision ID: mordred@inaugust.com-20110213172418-vd210j88hiwk8jih
Removed the lint stuff.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
Dynamic SQL allows you to execute DDL statements (and other SQL statements) that are not supported in purely static SQL programs.
7
7
 
8
8
In Drizzle you can use the EXECUTE command along with :doc:'user defined variables <variables>'
9
 
to create SQL in a dynamic manner on the server. An exmaple of this is:
10
 
 
11
 
.. code-block:: mysql
 
9
to create SQL in a dynamic manner on the server. An exmaple of this is: ::
12
10
 
13
11
        SET @var= "SELECT 1";
14
12
        EXECUTE @var;
15
13
 
16
 
You can also omit the variable and just insert the SQL directly:
17
 
 
18
 
.. code-block:: mysql
 
14
You can also omit the variable and just insert the SQL directly: ::
19
15
 
20
16
        EXECUTE "SELECT 1";
21
17
 
23
19
generated and no data will be returned by the execution of the statement.
24
20
 
25
21
If you want to launch the query in a separate session, you can do that with
26
 
the following:
27
 
 
28
 
.. code-block:: mysql
 
22
the following: ::
29
23
 
30
24
        EXECUTE "SELECT 1" CONCURRENT;
31
25
 
33
27
launched it. It can be killed via KILL and the system limit on total number
34
28
of sessions will be enforced.
35
29
 
36
 
.. todo::
37
 
 
38
 
   EXECUTE executes the statements inside an explicit transaction.
 
30
FIXME: EXECUTE executes the statements inside an explicit transaction.