List:Commits« Previous MessageNext Message »
From:paul Date:September 28 2006 5:01pm
Subject:svn commit - mysqldoc@docsrva: r3495 - in trunk: . refman-5.0 refman-5.1
View as plain text  
Author: paul
Date: 2006-09-28 19:01:25 +0200 (Thu, 28 Sep 2006)
New Revision: 3495

Log:
 r8710@frost:  paul | 2006-09-28 12:00:18 -0500
 Add section on stored routines/triggers and LAST_INSERT_ID().


Modified:
   trunk/refman-5.0/stored-procedures.xml
   trunk/refman-5.1/stored-procedures.xml

Property changes on: trunk
___________________________________________________________________
Name: svk:merge
   - 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:14099
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:8706
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:10466
   + 4767c598-dc10-0410-bea0-d01b485662eb:/mysqldoc-local/mysqldoc/trunk:14099
7d8d2c4e-af1d-0410-ab9f-b038ce55645b:/mysqldoc-local/mysqldoc:8710
b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:14218
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:10466


Modified: trunk/refman-5.0/stored-procedures.xml
===================================================================
--- trunk/refman-5.0/stored-procedures.xml	2006-09-28 16:30:18 UTC (rev 3494)
+++ trunk/refman-5.0/stored-procedures.xml	2006-09-28 17:01:25 UTC (rev 3495)
Changed blocks: 1, Lines Added: 56, Lines Deleted: 0; 2114 bytes

@@ -2108,6 +2108,62 @@
 
   </section>
 
+  <section id="stored-procedure-last-insert-id">
+
+    <title>Stored Procedures, Functions, Triggers, and
+      <literal>LAST_INSERT_ID()</literal></title>
+
+    <indexterm>
+      <primary>LAST_INSERT_ID() and stored routines</primary>
+    </indexterm>
+
+    <indexterm>
+      <primary>LAST_INSERT_ID() and triggers</primary>
+    </indexterm>
+
+    <indexterm>
+      <primary>stored routines</primary>
+      <secondary>LAST_INSERT_ID()</secondary>
+    </indexterm>
+
+    <indexterm>
+      <primary>triggers</primary>
+      <secondary>LAST_INSERT_ID()</secondary>
+    </indexterm>
+
+    <para>
+      Within the body of a stored routine (procedure or function) or a
+      trigger, the value of <literal>LAST_INSERT_ID()</literal> changes
+      the same way as for statements executed outside the body of these
+      kinds of objects (see <xref linkend="function_last_insert_id"/>).
+      The effect of a stored routine or trigger upon the value of
+      <literal>LAST_INSERT_ID()</literal> that is seen by following
+      statements depends on the kind of routine:
+    </para>
+
+    <itemizedlist>
+
+      <listitem>
+        <para>
+          If a stored procedure executes statements that change the
+          value of <literal>LAST_INSERT_ID()</literal>, the changed
+          value will be seen by statements that follow the procedure
+          call.
+        </para>
+      </listitem>
+
+      <listitem>
+        <para>
+          For stored functions and triggers that change the value, the
+          value is restored when the function or trigger ends, so
+          following statements will not see a changed value.
+        </para>
+      </listitem>
+
+    </itemizedlist>
+
+  </section>
+
   <section id="stored-procedure-replication-faq">
 
     <title>Stored Procedures, Functions, Triggers, and Replication: Frequently


Modified: trunk/refman-5.1/stored-procedures.xml
===================================================================
--- trunk/refman-5.1/stored-procedures.xml	2006-09-28 16:30:18 UTC (rev 3494)
+++ trunk/refman-5.1/stored-procedures.xml	2006-09-28 17:01:25 UTC (rev 3495)
Changed blocks: 1, Lines Added: 56, Lines Deleted: 0; 2114 bytes

@@ -2080,6 +2080,62 @@
 
   </section>
 
+  <section id="stored-procedure-last-insert-id">
+
+    <title>Stored Procedures, Functions, Triggers, and
+      <literal>LAST_INSERT_ID()</literal></title>
+
+    <indexterm>
+      <primary>LAST_INSERT_ID() and stored routines</primary>
+    </indexterm>
+
+    <indexterm>
+      <primary>LAST_INSERT_ID() and triggers</primary>
+    </indexterm>
+
+    <indexterm>
+      <primary>stored routines</primary>
+      <secondary>LAST_INSERT_ID()</secondary>
+    </indexterm>
+
+    <indexterm>
+      <primary>triggers</primary>
+      <secondary>LAST_INSERT_ID()</secondary>
+    </indexterm>
+
+    <para>
+      Within the body of a stored routine (procedure or function) or a
+      trigger, the value of <literal>LAST_INSERT_ID()</literal> changes
+      the same way as for statements executed outside the body of these
+      kinds of objects (see <xref linkend="function_last_insert_id"/>).
+      The effect of a stored routine or trigger upon the value of
+      <literal>LAST_INSERT_ID()</literal> that is seen by following
+      statements depends on the kind of routine:
+    </para>
+
+    <itemizedlist>
+
+      <listitem>
+        <para>
+          If a stored procedure executes statements that change the
+          value of <literal>LAST_INSERT_ID()</literal>, the changed
+          value will be seen by statements that follow the procedure
+          call.
+        </para>
+      </listitem>
+
+      <listitem>
+        <para>
+          For stored functions and triggers that change the value, the
+          value is restored when the function or trigger ends, so
+          following statements will not see a changed value.
+        </para>
+      </listitem>
+
+    </itemizedlist>
+
+  </section>
+
   <section id="stored-procedure-replication-faq">
 
     <title>Stored Procedures, Functions, Triggers, and Replication: Frequently


Thread
svn commit - mysqldoc@docsrva: r3495 - in trunk: . refman-5.0 refman-5.1paul28 Sep