English 中文(简体)
FIREBIRD BLR DECODER
原标题:

folks. When i belived i was a genius and that metadata was my intelectual property, i developed a procedure in firebird to track changes on a single table, something with id´s and time stamps. So, i´ve done a mega clever move and deleted the source of this procedure.

Does anyone knows a BLR decoder, or the doc´s that i need to build one?

TIA.

最佳回答

I ve seen a BLR display tool (in Jason Wharton s IB admin tool), but it would only display BLR names, not transliterate back to SQL/proc language. I think what you re looking for doesn t exist.

You can get BLR documentation here, though.

问题回答

There is nice BLR (binary) to BLR (text) decoder in Firebird itself. You can enable it with set blob all (or set blobdisplay all). You can call it from ISQL:

SQL> set term !;
SQL> create procedure p1
CON> as
CON>   declare n integer = 1;
CON> begin
CON>   n = n * 2;
CON> end!
SQL> set term ;!
SQL> 
SQL> set blob all;
SQL> commit;
SQL> 
SQL> select rdb$procedure_blr from rdb$procedures where rdb$procedure_name =  P1 ;

RDB$PROCEDURE_BLR 
================= 
             1a:3 
==============================================================================
RDB$PROCEDURE_BLR:  
            blr_version5,
            blr_begin,
               blr_message, 1, 1,0,
                  blr_short, 0,
               blr_begin,
                  blr_declare, 0,0, blr_long, 0,
                  blr_assignment,
                     blr_literal, blr_long, 0, 1,0,0,0,
                     blr_variable, 0,0,
                  blr_stall,
                  blr_label, 0,
                     blr_begin,
                        blr_begin,
                           blr_assignment,
                              blr_multiply,
                                 blr_variable, 0,0,
                                 blr_literal, blr_long, 0, 2,0,0,0,
                              blr_variable, 0,0,
                           blr_end,
                        blr_end,
                  blr_end,
               blr_send, 1,
                  blr_begin,
                     blr_assignment,
                        blr_literal, blr_short, 0, 0,0,
                        blr_parameter, 1, 0,0,
                     blr_end,
               blr_end,
            blr_eoc

==============================================================================

If you still have the database there is a chance the procedure source is still there somewhere but marked as deleted. You may try to open the database file on a hex editor and search for the procedure name.





相关问题
FIREBIRD BLR DECODER

folks. When i belived i was a genius and that metadata was my intelectual property, i developed a procedure in firebird to track changes on a single table, something with id´s and time stamps. So, i´...

Get stored procedure parameters type

I need to read the stored procedures parameters type in Firebird database. I m able to read their name, if they are input or output parameters, but where can I get their type? Or how do you solve ...

Using Reserved Word TimeStamp as a field name (Firebird 2.5)

I am extending the data layer of an existing application to work with Firebird 2.5, in addition to MSSQL and SQLite, but I have hit a stumbling block. I have a field called TimeStamp which stores ...

Apache2, PHP5, and Interbase/Firebird on Windows 2003/XP

I have recently upgraded from Apache 1.26 and PHP 4.3 to 2.2.11 and 5.2.9 respectively. With my original setup I had a scheduled task set to run every Sunday for a weekly newsletter. It would connect ...

How to do a firebird SP, SELECT * FROM "TABLE"?

I m migrating from SQL Server to Firebird. In SQL Server CREATE PROCEDURE Departments_GetAll AS SELECT * FROM Departments I try in Firebird CREATE PROCEDURE DEPARTMENTS_DELETEALL AS BEGIN ...

Will embedded Firebird/Delphi cause a firewall hit ?

I m looking at porting an Interbase 6 / Delphi 7 application to embedded Firebird in Delphi 2007. One of the problems we have is getting our users (often quite an unskilled bunch, really - though I ...

Parameters in query with in clause?

I want to use parameter for query like this : SELECT * FROM MATABLE WHERE MT_ID IN (368134, 181956) so I think about this SELECT * FROM MATABLE WHERE MT_ID IN (:MYPARAM) but it doesn t work... ...

热门标签