Subject Re: [firebird-support] Strange database issue - invalid request BLR
Author Martijn Tonies
Hello Myles,

> The stored procedure that is executed is this:

As a complete side note...

> CREATE OR ALTER PROCEDURE LOG_WRITE_PRC (
> A_USER_ID INTEGER,
> A_IPADDRESS VARCHAR(20),
> A_SHORT VARCHAR(50),
> A_LONG VARCHAR(127))
> RETURNS (
> R_ID INTEGER)
> AS
> DECLARE VARIABLE NEW_ID INTEGER;
> begin
> /* Writes a record to the AUDIT_LOG */
> NEW_ID = GEN_ID(GEN_AUDIT_LOG_ID,1);
>
> insert into AUDIT_LOG (
> DA_ID,
> DA_DATE,
> DA_TEXT,
> DA_IPADDRESS,
> DA_TIMESTAMP,
> DA_LOGDETAIL,
> FK_USER_ID)
> values(
> :NEW_ID,
> cast('NOW' as date),
> :A_SHORT,
> :A_IPADDRESS,
> CAST ('NOW' AS TIMESTAMP),
> :A_LONG,
> :A_USER_ID);


Why a FOR SELECT to output the :NEW_ID into R_ID?

R_ID = NEW_ID;
SUSPEND;

would do just fine.

> for
> select :NEW_ID from RDB$DATABASE INTO :R_ID
> do
> begin
> suspend;
> end
> end^


Martijn Tonies
Database Workbench - tool for InterBase, Firebird, MySQL, NexusDB, Sybase
SQL Anywhere, Oracle & MS SQL Server
Upscene Productions
http://www.upscene.com
My thoughts:
http://blog.upscene.com/martijn/
Database development questions? Check the forum!
http://www.databasedevelopmentforum.com