[Lazarus] Problem with TSQLScript
Ludo Brands
ludo.brands at free.fr
Fri Jul 19 10:48:35 CEST 2013
On 07/18/2013 05:40 PM, Paul wrote:
> 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 ?
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.
http://www.freepascal.org/docs-html/fcl/sqldb/tsqlscript.usesetterm.html
Ludo
More information about the Lazarus
mailing list