Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sybase - Setting console output on for printing log statements

Does somebody know how to turn the console output on in Sybase. The usual statement like print 'Hello', is not working for me, it just says command executed successfully without printing the log statement.

like image 939
Gaurav Avatar asked Nov 06 '12 13:11

Gaurav


2 Answers

Are you using Interactive SQL in sybase? Or are you invoking dbisqlc with -nogui option and passing it an SQL file for it to run?

The 'message' method is only for interactive mode.

I'm trying to figure this out as well, but as far as I can tell the console output doesn't seem to work. I tried using 'select' statement such as:

SELECT "This is my message";

And it seems to work, but is a little too hacky for my tastes.

Please let me know if this works/you figured something better out :)

~Will

like image 138
Will Charlton Avatar answered Oct 20 '22 09:10

Will Charlton


It depends on your setup. If you are using SQL Anywhere, PRINT 'Hello' will not be written to the client window if you are connected from an embedded SQL or ODBC application. The printed message will however be visible in the Server Messages in Sybase Central.

In your case, you'll probably need MESSAGE 'Hello' type status to client as @toniedzwiedz mentioned.

like image 36
Bruno V Avatar answered Oct 20 '22 09:10

Bruno V