Subject MON$SQL_TEXT Blob column in MON$STATEMENTS table
Author Jerry Sands
When I open the MON$STATEMENT (SQL below) I am getting an "Invalid Blob ID"
error on most of the MON$SQL_TEXT columns when I hook them up to a TIB_Memo.
I am getting the same error when I set up a stream and read them. The code
works for a few of the rows (I must be doing something right) but I get the
error for most of them. Using the same query and reading the data with the
IBOBJECTS TIB_Query statements form I click on the MON$SQL_Text column
button in the grid and the sql text is displayed in a pop up dialog.
Additionally, when I use IB_Expert's SQL Editor with the same SQL I can read
all the MON$SQL_Text with no errors so I know the SQL Text is there.
Anybody got any ideas on what is causing the problem?



Jerry Sands



SELECT CASE ATT.MON$State

WHEN 0 THEN 'Idle'

WHEN 1 THEN 'Active'

END AS AttachmentState

, ATT.MON$Attachment_Name

, ATT.MON$REMOTE_ADDRESS

, ATT.MON$Remote_Process

, ATT.MON$Timestamp

, ATT.MON$Garbage_Collection

, STMT.MON$SQL_TEXT AS SQL_TEXT

, CASE STMT.MON$State

WHEN 0 THEN 'IDLE'

WHEN 1 THEN 'ACTIVE'

END AS StatementState

, STMT.MON$Transaction_ID AS TransactionId

, CASE

WHEN STMT.MON$STATE = 1 THEN STMT.MON$TIMESTAMP

ELSE NULL

END AS StatementStart

FROM MON$ATTACHMENTS ATT

JOIN MON$STATEMENTS STMT

ON ATT.MON$ATTACHMENT_ID = STMT.MON$ATTACHMENT_ID



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