0

I know that in SQL Server we can print message via operator PRINT, but PRINT doesn't work in IBExpert, and command OUTPUT too. Can someone help me?

enter image description here

I have this error when I run previous code:

enter image description here

Nika
  • 379
  • 2
  • 16
  • Please don't post screenshots of textual input or output, but post it as code formatted text. – Mark Rotteveel Feb 17 '22 at 20:16
  • Thanks for the advice. I'm a beginner in writing questions on this site. – Nika Feb 17 '22 at 20:54
  • Since your message text is static you might consider using (abusing?) events https://stackoverflow.com/questions/4338077 and i guess one can try to use Win32 `OutputDebugString` API as an UDF – Arioch 'The Feb 18 '22 at 14:13

1 Answers1

1

Firebird has no such feature. It is not possible to "print" or "output" messages in this way (nor does Firebird have a statement called OUTPUT1).

The only option you have in stored procedures is to return the message as the value of a return column. For triggers, there is no real option, though you could write things to a global temporary table and explicitly select from that GTT before transaction commit or something similar. However, that requires explicit action on your part to get the output.


1. The Firebird query tool ISQL has a command called OUTPUT, but that is purely for redirecting output of ISQL itself to a file.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
  • Thanks! I created some DebugLog table for writing information and now in my trigger I insert in table DebugLog date, time and message. Thank you!!! – Nika Feb 17 '22 at 20:57
  • @Nika should your `DebugLog` table retain the message if the transaction was rolled back, or should it cease to exist then ? – Arioch 'The Feb 18 '22 at 14:49
  • In my case, all I have to do is save the message. For me it is not important and that's why I think my table retain the message if the transaction was rolled back – Nika Feb 18 '22 at 18:00