<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">W dniu 19.07.2013 10:48, Ludo Brands
pisze:<br>
</div>
<blockquote cite="mid:51E8FD63.2020702@free.fr" type="cite">
<pre wrap="">On 07/18/2013 05:40 PM, Paul wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hello,
I have problem with TSQLScript (?)
Script looks like that
SET TERM ^ ;
CREATE PROCEDURE GET_USER_PRIVILEGES (
USER_ACCOUNT VARCHAR(10))
RETURNS (
RESULT CHAR(1))
AS
BEGIN
FOR
SELECT DISTINCT RDB$PRIVILEGE
FROM RDB$USER_PRIVILEGES
WHERE (RDB$USER = :USER_ACCOUNT)
INTO :RESULT
DO
BEGIN
SUSPEND;
END
END
^
SET TERM ; ^
and the error message looks like that
{...}PrepareStatement
-Dynamic SQL Error
-SQL Error Code = -104
Token unknown - line 11, column 11
-?
line 11 -> INTO :RESULT
column 11-> :
FlameRobin does not have any problems with this piece of code
Any hints ?
</pre>
</blockquote>
<pre wrap="">
I think you have to set TSQLScript.UseSetTerm:=true. TSQLScript is
parsing the script and executes queries one by one and needs to know
what the "real" terminator is.
<a class="moz-txt-link-freetext" href="http://www.freepascal.org/docs-html/fcl/sqldb/tsqlscript.usesetterm.html">http://www.freepascal.org/docs-html/fcl/sqldb/tsqlscript.usesetterm.html</a>
Ludo
</pre>
</blockquote>
TSQLScript.OnException<br>
Exception.Message <small>shows statement to run like this</small><br>
<small>(without any terminator)</small><br>
<pre wrap="">CREATE PROCEDURE GET_USER_PRIVILEGES (
USER_ACCOUNT VARCHAR(10))
RETURNS (
RESULT CHAR(1))
AS
BEGIN
FOR
SELECT DISTINCT RDB$PRIVILEGE
FROM RDB$USER_PRIVILEGES
WHERE (RDB$USER = :USER_ACCOUNT)
INTO :RESULT
DO
BEGIN
SUSPEND;
END
END</pre>
Paul<br>
<br>
<br>
</body>
</html>