Dans son message précédent, bruno reiter [MVP] a écrit :
le message est clair, l'aide aussi
Ca au moins c'est une aide efficace .... Merci
-- J-L M. (Alphomega) ICQ: 149635116 Pour m'écrire, cliquer le lien ci-dessous http://cerbermail.com/?G5iYdBb2Ce
Patrice
Le principe est que tu ne peux pas modifier l'état de la base dans une fonction. Donc notamment pas d'appels de SP... ("grosse maille" cf l'aide pour les détails).
Patrice
--
"Jean-Luc M." a écrit dans le message de news:
Dans son message précédent, bruno reiter [MVP] a écrit : > le message est clair, l'aide aussi >
Ca au moins c'est une aide efficace .... Merci
-- J-L M. (Alphomega) ICQ: 149635116 Pour m'écrire, cliquer le lien ci-dessous http://cerbermail.com/?G5iYdBb2Ce
Le principe est que tu ne peux pas modifier l'état de la base dans une
fonction. Donc notamment pas d'appels de SP...
("grosse maille" cf l'aide pour les détails).
Patrice
--
"Jean-Luc M." <nospam@nospam.com> a écrit dans le message de
news:mn.abe07d5605b53821.1476@nospam.com...
Dans son message précédent, bruno reiter [MVP] a écrit :
> le message est clair, l'aide aussi
>
Ca au moins c'est une aide efficace .... Merci
--
J-L M. (Alphomega)
ICQ: 149635116
Pour m'écrire, cliquer le lien ci-dessous
http://cerbermail.com/?G5iYdBb2Ce
Le principe est que tu ne peux pas modifier l'état de la base dans une fonction. Donc notamment pas d'appels de SP... ("grosse maille" cf l'aide pour les détails).
Patrice
--
"Jean-Luc M." a écrit dans le message de news:
Dans son message précédent, bruno reiter [MVP] a écrit : > le message est clair, l'aide aussi >
Ca au moins c'est une aide efficace .... Merci
-- J-L M. (Alphomega) ICQ: 149635116 Pour m'écrire, cliquer le lien ci-dessous http://cerbermail.com/?G5iYdBb2Ce
bruno reiter [MVP]
pour etre plus clair, le message : "Seules les fonctions et les procédures étendues peuvent être exécutées à partir d'une fonction"
veut dire que dans une fonction on ne peut pas appeler une procédures stockée puisqu'on ne peut appeler qu'une fonction ou une procédure stockée étendue (ça aussi c'est dans l'aide, en anglais : extended stored procedure)
et dans l'aide à CREATE FUNCTION, on peut lire :
Remarks User-defined functions are either scalar-valued or table-valued. Functions are scalar-valued if the RETURNS clause specified one of the scalar data types. Scalar-valued functions can be defined using multiple Transact-SQL statements.
Functions are table-valued if the RETURNS clause specified TABLE. Depending on how the body of the function is defined, table-valued functions can be classified as inline or multi-statement functions.
If the RETURNS clause specifies TABLE with no accompanying column list, the function is an inline function. Inline functions are table-valued functions defined with a single SELECT statement making up the body of the function. The columns, including the data types, of the table returned by the function are derived from the SELECT list of the SELECT statement defining the function.
If the RETURNS clause specifies a TABLE type with columns and their data types, the function is a multi-statement table-valued function.
The following statements are allowed in the body of a multi-statement function. Statements not in this list are not allowed in the body of a function:
a.. Assignment statements.
b.. Control-of-Flow statements.
c.. DECLARE statements defining data variables and cursors that are local to the function.
d.. SELECT statements containing select lists with expressions that assign values to variables that are local to the function.
e.. Cursor operations referencing local cursors that are declared, opened, closed, and deallocated in the function. Only FETCH statements that assign values to local variables using the INTO clause are allowed; FETCH statements that return data to the client are not allowed.
f.. INSERT, UPDATE, and DELETE statements modifying table variables local to the function.
g.. EXECUTE statements calling an extended stored procedures.
J'espère que cette aide est plus efficace!
br
"Jean-Luc M." wrote in message news:
Dans son message précédent, bruno reiter [MVP] a écrit :
le message est clair, l'aide aussi
Ca au moins c'est une aide efficace .... Merci
-- J-L M. (Alphomega) ICQ: 149635116 Pour m'écrire, cliquer le lien ci-dessous http://cerbermail.com/?G5iYdBb2Ce
pour etre plus clair, le message :
"Seules les fonctions et les procédures étendues peuvent être exécutées
à partir d'une fonction"
veut dire que dans une fonction on ne peut pas appeler une procédures
stockée puisqu'on ne peut appeler qu'une fonction ou une procédure stockée
étendue (ça aussi c'est dans l'aide, en anglais : extended stored procedure)
et dans l'aide à CREATE FUNCTION, on peut lire :
Remarks
User-defined functions are either scalar-valued or table-valued. Functions
are scalar-valued if the RETURNS clause specified one of the scalar data
types. Scalar-valued functions can be defined using multiple Transact-SQL
statements.
Functions are table-valued if the RETURNS clause specified TABLE. Depending
on how the body of the function is defined, table-valued functions can be
classified as inline or multi-statement functions.
If the RETURNS clause specifies TABLE with no accompanying column list, the
function is an inline function. Inline functions are table-valued functions
defined with a single SELECT statement making up the body of the function.
The columns, including the data types, of the table returned by the function
are derived from the SELECT list of the SELECT statement defining the
function.
If the RETURNS clause specifies a TABLE type with columns and their data
types, the function is a multi-statement table-valued function.
The following statements are allowed in the body of a multi-statement
function. Statements not in this list are not allowed in the body of a
function:
a.. Assignment statements.
b.. Control-of-Flow statements.
c.. DECLARE statements defining data variables and cursors that are local
to the function.
d.. SELECT statements containing select lists with expressions that assign
values to variables that are local to the function.
e.. Cursor operations referencing local cursors that are declared, opened,
closed, and deallocated in the function. Only FETCH statements that assign
values to local variables using the INTO clause are allowed; FETCH
statements that return data to the client are not allowed.
f.. INSERT, UPDATE, and DELETE statements modifying table variables local
to the function.
g.. EXECUTE statements calling an extended stored procedures.
J'espère que cette aide est plus efficace!
br
"Jean-Luc M." <nospam@nospam.com> wrote in message
news:mn.abe07d5605b53821.1476@nospam.com...
Dans son message précédent, bruno reiter [MVP] a écrit :
le message est clair, l'aide aussi
Ca au moins c'est une aide efficace .... Merci
--
J-L M. (Alphomega)
ICQ: 149635116
Pour m'écrire, cliquer le lien ci-dessous
http://cerbermail.com/?G5iYdBb2Ce
pour etre plus clair, le message : "Seules les fonctions et les procédures étendues peuvent être exécutées à partir d'une fonction"
veut dire que dans une fonction on ne peut pas appeler une procédures stockée puisqu'on ne peut appeler qu'une fonction ou une procédure stockée étendue (ça aussi c'est dans l'aide, en anglais : extended stored procedure)
et dans l'aide à CREATE FUNCTION, on peut lire :
Remarks User-defined functions are either scalar-valued or table-valued. Functions are scalar-valued if the RETURNS clause specified one of the scalar data types. Scalar-valued functions can be defined using multiple Transact-SQL statements.
Functions are table-valued if the RETURNS clause specified TABLE. Depending on how the body of the function is defined, table-valued functions can be classified as inline or multi-statement functions.
If the RETURNS clause specifies TABLE with no accompanying column list, the function is an inline function. Inline functions are table-valued functions defined with a single SELECT statement making up the body of the function. The columns, including the data types, of the table returned by the function are derived from the SELECT list of the SELECT statement defining the function.
If the RETURNS clause specifies a TABLE type with columns and their data types, the function is a multi-statement table-valued function.
The following statements are allowed in the body of a multi-statement function. Statements not in this list are not allowed in the body of a function:
a.. Assignment statements.
b.. Control-of-Flow statements.
c.. DECLARE statements defining data variables and cursors that are local to the function.
d.. SELECT statements containing select lists with expressions that assign values to variables that are local to the function.
e.. Cursor operations referencing local cursors that are declared, opened, closed, and deallocated in the function. Only FETCH statements that assign values to local variables using the INTO clause are allowed; FETCH statements that return data to the client are not allowed.
f.. INSERT, UPDATE, and DELETE statements modifying table variables local to the function.
g.. EXECUTE statements calling an extended stored procedures.
J'espère que cette aide est plus efficace!
br
"Jean-Luc M." wrote in message news:
Dans son message précédent, bruno reiter [MVP] a écrit :
le message est clair, l'aide aussi
Ca au moins c'est une aide efficace .... Merci
-- J-L M. (Alphomega) ICQ: 149635116 Pour m'écrire, cliquer le lien ci-dessous http://cerbermail.com/?G5iYdBb2Ce
Fred BROUARD
Je vais lui mettre l'aide en français sinon il va râler :
" Les instructions suivantes sont autorisées dans le corps d'une fonction multi-instructions. Les instructions ne figurant pas dans la liste suivante ne sont pas autorisées dans le corps d'une fonction :
[...]
Instructions EXECUTE appelant des procédures stockées étendues "
L'explication est simple : une fonction ne peut encapsuler une transaction puisque'une fonction peut être utilisée par une requête qui est elle même une transaction, ou être utilisée par une procédure qui peut piloter un transaction.
En conclusion, une fonction ne peut être à la fois à l'intérieur et à l'extérieur d'une transaction !
A +
bruno reiter [MVP] a écrit:
pour etre plus clair, le message : "Seules les fonctions et les procédures étendues peuvent être exécutées à partir d'une fonction"
veut dire que dans une fonction on ne peut pas appeler une procédures stockée puisqu'on ne peut appeler qu'une fonction ou une procédure stockée étendue (ça aussi c'est dans l'aide, en anglais : extended stored procedure)
et dans l'aide à CREATE FUNCTION, on peut lire :
Remarks User-defined functions are either scalar-valued or table-valued. Functions are scalar-valued if the RETURNS clause specified one of the scalar data types. Scalar-valued functions can be defined using multiple Transact-SQL statements.
Functions are table-valued if the RETURNS clause specified TABLE. Depending on how the body of the function is defined, table-valued functions can be classified as inline or multi-statement functions.
If the RETURNS clause specifies TABLE with no accompanying column list, the function is an inline function. Inline functions are table-valued functions defined with a single SELECT statement making up the body of the function. The columns, including the data types, of the table returned by the function are derived from the SELECT list of the SELECT statement defining the function.
If the RETURNS clause specifies a TABLE type with columns and their data types, the function is a multi-statement table-valued function.
The following statements are allowed in the body of a multi-statement function. Statements not in this list are not allowed in the body of a function:
a.. Assignment statements.
b.. Control-of-Flow statements.
c.. DECLARE statements defining data variables and cursors that are local to the function.
d.. SELECT statements containing select lists with expressions that assign values to variables that are local to the function.
e.. Cursor operations referencing local cursors that are declared, opened, closed, and deallocated in the function. Only FETCH statements that assign values to local variables using the INTO clause are allowed; FETCH statements that return data to the client are not allowed.
f.. INSERT, UPDATE, and DELETE statements modifying table variables local to the function.
g.. EXECUTE statements calling an extended stored procedures.
J'espère que cette aide est plus efficace!
br
"Jean-Luc M." wrote in message news:
Dans son message précédent, bruno reiter [MVP] a écrit :
le message est clair, l'aide aussi
Ca au moins c'est une aide efficace .... Merci
-- J-L M. (Alphomega) ICQ: 149635116 Pour m'écrire, cliquer le lien ci-dessous http://cerbermail.com/?G5iYdBb2Ce
-- Frédéric BROUARD, MVP SQL Server. Expert SQL / spécialiste Delphi, web Livre SQL - col. Référence : http://sqlpro.developpez.com/bookSQL.html Le site du SQL, pour débutants et pros : http://sqlpro.developpez.com ************************ www.datasapiens.com *************************
Je vais lui mettre l'aide en français sinon il va râler :
"
Les instructions suivantes sont autorisées dans le corps d'une fonction
multi-instructions. Les instructions ne figurant pas dans la liste suivante ne
sont pas autorisées dans le corps d'une fonction :
[...]
Instructions EXECUTE appelant des procédures stockées étendues
"
L'explication est simple : une fonction ne peut encapsuler une transaction
puisque'une fonction peut être utilisée par une requête qui est elle même une
transaction, ou être utilisée par une procédure qui peut piloter un transaction.
En conclusion, une fonction ne peut être à la fois à l'intérieur et à
l'extérieur d'une transaction !
A +
bruno reiter [MVP] a écrit:
pour etre plus clair, le message :
"Seules les fonctions et les procédures étendues peuvent être exécutées
à partir d'une fonction"
veut dire que dans une fonction on ne peut pas appeler une procédures
stockée puisqu'on ne peut appeler qu'une fonction ou une procédure stockée
étendue (ça aussi c'est dans l'aide, en anglais : extended stored procedure)
et dans l'aide à CREATE FUNCTION, on peut lire :
Remarks
User-defined functions are either scalar-valued or table-valued. Functions
are scalar-valued if the RETURNS clause specified one of the scalar data
types. Scalar-valued functions can be defined using multiple Transact-SQL
statements.
Functions are table-valued if the RETURNS clause specified TABLE. Depending
on how the body of the function is defined, table-valued functions can be
classified as inline or multi-statement functions.
If the RETURNS clause specifies TABLE with no accompanying column list, the
function is an inline function. Inline functions are table-valued functions
defined with a single SELECT statement making up the body of the function.
The columns, including the data types, of the table returned by the function
are derived from the SELECT list of the SELECT statement defining the
function.
If the RETURNS clause specifies a TABLE type with columns and their data
types, the function is a multi-statement table-valued function.
The following statements are allowed in the body of a multi-statement
function. Statements not in this list are not allowed in the body of a
function:
a.. Assignment statements.
b.. Control-of-Flow statements.
c.. DECLARE statements defining data variables and cursors that are local
to the function.
d.. SELECT statements containing select lists with expressions that assign
values to variables that are local to the function.
e.. Cursor operations referencing local cursors that are declared, opened,
closed, and deallocated in the function. Only FETCH statements that assign
values to local variables using the INTO clause are allowed; FETCH
statements that return data to the client are not allowed.
f.. INSERT, UPDATE, and DELETE statements modifying table variables local
to the function.
g.. EXECUTE statements calling an extended stored procedures.
J'espère que cette aide est plus efficace!
br
"Jean-Luc M." <nospam@nospam.com> wrote in message
news:mn.abe07d5605b53821.1476@nospam.com...
Dans son message précédent, bruno reiter [MVP] a écrit :
le message est clair, l'aide aussi
Ca au moins c'est une aide efficace .... Merci
--
J-L M. (Alphomega)
ICQ: 149635116
Pour m'écrire, cliquer le lien ci-dessous
http://cerbermail.com/?G5iYdBb2Ce
--
Frédéric BROUARD, MVP SQL Server. Expert SQL / spécialiste Delphi, web
Livre SQL - col. Référence : http://sqlpro.developpez.com/bookSQL.html
Le site du SQL, pour débutants et pros : http://sqlpro.developpez.com
************************ www.datasapiens.com *************************
Je vais lui mettre l'aide en français sinon il va râler :
" Les instructions suivantes sont autorisées dans le corps d'une fonction multi-instructions. Les instructions ne figurant pas dans la liste suivante ne sont pas autorisées dans le corps d'une fonction :
[...]
Instructions EXECUTE appelant des procédures stockées étendues "
L'explication est simple : une fonction ne peut encapsuler une transaction puisque'une fonction peut être utilisée par une requête qui est elle même une transaction, ou être utilisée par une procédure qui peut piloter un transaction.
En conclusion, une fonction ne peut être à la fois à l'intérieur et à l'extérieur d'une transaction !
A +
bruno reiter [MVP] a écrit:
pour etre plus clair, le message : "Seules les fonctions et les procédures étendues peuvent être exécutées à partir d'une fonction"
veut dire que dans une fonction on ne peut pas appeler une procédures stockée puisqu'on ne peut appeler qu'une fonction ou une procédure stockée étendue (ça aussi c'est dans l'aide, en anglais : extended stored procedure)
et dans l'aide à CREATE FUNCTION, on peut lire :
Remarks User-defined functions are either scalar-valued or table-valued. Functions are scalar-valued if the RETURNS clause specified one of the scalar data types. Scalar-valued functions can be defined using multiple Transact-SQL statements.
Functions are table-valued if the RETURNS clause specified TABLE. Depending on how the body of the function is defined, table-valued functions can be classified as inline or multi-statement functions.
If the RETURNS clause specifies TABLE with no accompanying column list, the function is an inline function. Inline functions are table-valued functions defined with a single SELECT statement making up the body of the function. The columns, including the data types, of the table returned by the function are derived from the SELECT list of the SELECT statement defining the function.
If the RETURNS clause specifies a TABLE type with columns and their data types, the function is a multi-statement table-valued function.
The following statements are allowed in the body of a multi-statement function. Statements not in this list are not allowed in the body of a function:
a.. Assignment statements.
b.. Control-of-Flow statements.
c.. DECLARE statements defining data variables and cursors that are local to the function.
d.. SELECT statements containing select lists with expressions that assign values to variables that are local to the function.
e.. Cursor operations referencing local cursors that are declared, opened, closed, and deallocated in the function. Only FETCH statements that assign values to local variables using the INTO clause are allowed; FETCH statements that return data to the client are not allowed.
f.. INSERT, UPDATE, and DELETE statements modifying table variables local to the function.
g.. EXECUTE statements calling an extended stored procedures.
J'espère que cette aide est plus efficace!
br
"Jean-Luc M." wrote in message news:
Dans son message précédent, bruno reiter [MVP] a écrit :
le message est clair, l'aide aussi
Ca au moins c'est une aide efficace .... Merci
-- J-L M. (Alphomega) ICQ: 149635116 Pour m'écrire, cliquer le lien ci-dessous http://cerbermail.com/?G5iYdBb2Ce
-- Frédéric BROUARD, MVP SQL Server. Expert SQL / spécialiste Delphi, web Livre SQL - col. Référence : http://sqlpro.developpez.com/bookSQL.html Le site du SQL, pour débutants et pros : http://sqlpro.developpez.com ************************ www.datasapiens.com *************************
Jean-Luc M.
Patrice avait soumis l'idée :
Le principe est que tu ne peux pas modifier l'état de la base dans une fonction. Donc notamment pas d'appels de SP... ("grosse maille" cf l'aide pour les détails).
Merci
-- Jean-Luc M.
Patrice avait soumis l'idée :
Le principe est que tu ne peux pas modifier l'état de la base dans une
fonction. Donc notamment pas d'appels de SP...
("grosse maille" cf l'aide pour les détails).
Le principe est que tu ne peux pas modifier l'état de la base dans une fonction. Donc notamment pas d'appels de SP... ("grosse maille" cf l'aide pour les détails).
Merci
-- Jean-Luc M.
Jean-Luc M.
Merci ... en fait, ce que je n'avais pas pigé c'est cette notion de fonction étendue. Je ne suis pas spécialiste sql server ... juste programmeur delphi qui attaque une base sql server avec ODBC .... je n'avais rien trouvé dans l'aide. Sans doute mal cherché :)
-- Jean-Luc M.
Merci ... en fait, ce que je n'avais pas pigé c'est cette notion de
fonction étendue.
Je ne suis pas spécialiste sql server ... juste programmeur delphi qui
attaque une base sql server avec ODBC .... je n'avais rien trouvé dans
l'aide. Sans doute mal cherché :)
Merci ... en fait, ce que je n'avais pas pigé c'est cette notion de fonction étendue. Je ne suis pas spécialiste sql server ... juste programmeur delphi qui attaque une base sql server avec ODBC .... je n'avais rien trouvé dans l'aide. Sans doute mal cherché :)
-- Jean-Luc M.
Jean-Luc M.
Fred BROUARD a exposé le 21/06/2005 :
Je vais lui mettre l'aide en français sinon il va râler :
Merci ... mais non je râle pas .... :D
-- Jean-Luc M.
Fred BROUARD a exposé le 21/06/2005 :
Je vais lui mettre l'aide en français sinon il va râler :
Je vais lui mettre l'aide en français sinon il va râler :
Merci ... mais non je râle pas .... :D
-- Jean-Luc M.
bruno reiter [MVP]
procédure étendue, pas de pb ;-)
br
"Jean-Luc M." wrote in message news:
Merci ... en fait, ce que je n'avais pas pigé c'est cette notion de fonction étendue. Je ne suis pas spécialiste sql server ... juste programmeur delphi qui attaque une base sql server avec ODBC .... je n'avais rien trouvé dans l'aide. Sans doute mal cherché :)
-- Jean-Luc M.
procédure étendue, pas de pb ;-)
br
"Jean-Luc M." <alphomega@free.fr> wrote in message
news:mn.b3c17d569a77bd74.28556@free.fr...
Merci ... en fait, ce que je n'avais pas pigé c'est cette notion de
fonction étendue.
Je ne suis pas spécialiste sql server ... juste programmeur delphi qui
attaque une base sql server avec ODBC .... je n'avais rien trouvé dans
l'aide. Sans doute mal cherché :)
Merci ... en fait, ce que je n'avais pas pigé c'est cette notion de fonction étendue. Je ne suis pas spécialiste sql server ... juste programmeur delphi qui attaque une base sql server avec ODBC .... je n'avais rien trouvé dans l'aide. Sans doute mal cherché :)