Oracle 5.0 Reference Manual page 981

Table of Contents

Advertisement

The intent of
SQL_CALC_FOUND_ROWS
be returned without a global LIMIT. The conditions for use of
are:
• The
SQL_CALC_FOUND_ROWS
• The value of
FOUND_ROWS()
used, duplicate removal occurs and the value of
• If no
is present in the UNION,
LIMIT
of rows in the temporary table that is created to process the UNION.
Beyond the cases described here, the behavior of
its value following a
SELECT
Important
FOUND_ROWS()
databases that are to be replicated.
LAST_INSERT_ID()
LAST_INSERT_ID()
the first automatically generated value that was set for an
recently executed
INSERT
generates an
AUTO_INCREMENT
mysql>
SELECT LAST_INSERT_ID();
-> 195
if a table contains an
updates (rather than inserts) a row, the value of
a workaround, see
Section 13.2.5.3,
The currently executing statement does not affect the value of
Suppose that you generate an
LAST_INSERT_ID()
with its own
AUTO_INCREMENT
stable in the second statement; its value for the second and later rows is not affected by the
earlier row insertions. (However, if you mix references to
LAST_INSERT_ID(expr)
If the previous statement returned an error, the value of
undefined. For transactional tables, if the statement is rolled back due to an error, the value
of
LAST_INSERT_ID()
LAST_INSERT_ID()
point of the ROLLBACK.
Within the body of a stored routine (procedure or function) or a trigger, the value of
LAST_INSERT_ID()
the body of these kinds of objects. The effect of a stored routine or trigger upon the value of
LAST_INSERT_ID()
• If a stored procedure executes statements that change the value of
the changed value is seen by statements that follow the procedure call.
• For stored functions and triggers that change the value, the value is restored when the function
or trigger ends, so following statements do not see a changed value. (Before MySQL 5.0.12, the
value is not restored and following statements do see a changed value.)
Information Functions
for
UNION
keyword must appear in the first
[960]
is exact only if
SQL_CALC_FOUND_ROWS
statement that fails with an error).
[960]
is not replicated reliably, and should not be used with
[961],
LAST_INSERT_ID(expr)
[961]
(with no argument) returns a
statement to affect such a column. For example, after inserting a row that
value, you can get the value like this:
column and
AUTO_INCREMENT
"INSERT ... ON DUPLICATE KEY UPDATE
AUTO_INCREMENT
[961]
in a multiple-row
column. The value of
[961], the effect is undefined.)
[961]
is left undefined. For manual ROLLBACK, the value of
[961]
is not restored to that before the transaction; it remains as it was at the
[961]
changes the same way as for statements executed outside
[961]
that is seen by following statements depends on the kind of routine:
961
is that it should return the row count that would
SQL_CALC_FOUND_ROWS
SELECT
is used. If
UNION ALL
[960]
FOUND_ROWS()
is ignored and returns the number
[960]
FOUND_ROWS()
[961]
(64-bit) value representing
BIGINT
AUTO_INCREMENT
INSERT ... ON DUPLICATE KEY UPDATE
LAST_INSERT_ID()
LAST_INSERT_ID()
value with one statement, and then refer to
statement that inserts rows into a table
INSERT
LAST_INSERT_ID()
LAST_INSERT_ID()
LAST_INSERT_ID()
with
of the UNION.
without
UNION
ALL
is only approximate.
is undefined (for example,
column by the most
[961]
is not meaningful. For
Syntax".
[961].
[961]
will remain
[961]
and
[961]
is
[961],
LAST_INSERT_ID()
UNION
is

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents