RE: [firebird-support] help with stored procedure: SYNTAX error

2012-06-08 Thread Svein Erling Tysvær
Dear List
Please help me understand where I am going wrong with creating the following 
procedure:

...
CREATE PROCEDURE TestProc 
...
  select cast('Now' as time) as TIME from rdb$database;
...
Token unknown - line 7, column 57 
;

What should Firebird do with TIME? You simply need an INTO clause and a local 
variable or return parameter before the semicolon.

HTH,
Set


Re: [firebird-support] help with stored procedure: SYNTAX error

2012-06-08 Thread Martijn Tonies
Hi,

 Please help me understand where I am going wrong with creating the 
 following procedure:

 SET TERM ^ ;

 CREATE PROCEDURE TestProc
 ( CatName CHAR(15) )
 AS
 BEGIN
  select cast('Now' as time) as TIME from rdb$database;
 END^

 SET TERM ; ^

 Engine Code: 335544569
 Engine Message :
 Dynamic SQL Error
 SQL error code = -104
 Token unknown - line 7, column 57
 ;

 Firebird 2.5.1 on Windows (SuperClassic)


A SELECT statement needs an INTO clause (into variables/(output) 
parameters).

With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!




Re: [firebird-support] help with stored procedure: SYNTAX error

2012-06-08 Thread Thomas Clarke
On Fri, Jun 8, 2012 at 7:37 AM, ktadimeti tadimetikes...@yahoo.com wrote:

 **


 Dear List
 Please help me understand where I am going wrong with creating the
 following procedure:

 SET TERM ^ ;

 CREATE PROCEDURE TestProc
 ( CatName CHAR(15) )
 AS
 BEGIN
 select cast('Now' as time) as TIME from rdb$database;
 END^

 SET TERM ; ^

 Engine Code : 335544569
 Engine Message :
 Dynamic SQL Error
 SQL error code = -104
 Token unknown - line 7, column 57
 ;

 Firebird 2.5.1 on Windows (SuperClassic)
 Many thanks

   Hi there,

Your stored procedure does nothing. If you want to return a time you could
try the following:

SET TERM ^ ;

create or alter procedure TEST_TIME
returns (
  the_time time)
as
begin

  the_time = Current_Time;

end^

SET TERM ; ^


[Non-text portions of this message have been removed]