Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use SQL to generate a message box?

Status
Not open for further replies.

james0816

Programmer
Jan 9, 2003
295
US
Is there code that you can use to display a message box on the screen using SQL/Oracle? I know in VB I can MsgBox. I would imagine this can be done...just not sure how. Can someone assist? Thanks
 
Not exactly. The processes run on the server, & would therefore popup a message box on the server.

You can use the RAISERROR method to pass a message back to your application & handle it this way. BOL has further details...

James Goodman MCSE, MCDBA
 
I see. Here's what I am trying to do.

I am trying to create a trigger that will display an error custom error message but can not get the syntax correct. I thought it was something to the effect of:

...
begin
raiserror 999 ''You have encountered an error'';
end;

This unfortunately is not working. I have tried just a single quote and also double quotes. I can not get my trigger to compile without errors.
 
Are you looking for PL/SQL answers in oracle? SQL Server doesn't use ';'... Try an Oracle forum if that's the case.
 
you could do

exec master..xp_cmdshell 'net send COMPUTER A Message'

if you know the computer you want the message to display on.


But, it's better to catch the error in the client application. You'll have to check for an error after every execution and call an error routine to display a message box.


Another option is to have an errors table in which you log error messages. Then, view the table daily or after a big batch of transactions, to see if any failed.

-------------------------------------
A sacrifice is harder when no one knows you've made it.
 
James,
I beleive the code you are lookign for is
Code:
begin
    raiserror ('You have encountered an error', 16,1)
end
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top