Messages for SQL Exception
13/09/2017 11:47
Hi everybody,I have a mysql db where i call a user defined function named exception when a constraint fail occurs. The function exception executes a fetch on an empty cursor to generate the SQL exception. I would like to know if there is a way to pass a parameter to the function exception, so I can get the type of occuring error from the function and print a significative message on the screen.

Thanks for the help.

Dymios

Source is Usenet: comp.databases.mysql
Sign in to add a comment

Answer score: 5
13/09/2017 11:47 - Captain Paralytic <paul_lautman@yahoo.com> ha scritto nel messaggio news:64450303-5573-4617-bfbd-5e4fc9f345dc@p15g2000vbl.googlegroups.com...

IF testError() = TRUE THEN CALL exception();END IF; I would like to pass a parameter (a string, if possible) to exception() so that I can report a significative error from the function.

If I get a string from parameters in exception(), how I can report an error with this string for message?Thanks Dymios

Source is Usenet: comp.databases.mysql
Sign in to add a comment

Answer score: 5
13/09/2017 11:47 - On 17 Sep, 20:18, Dymios:64450303-5573-4617-bfbd-5e4fc9f345dc@p15g2000vbl.googlegroups.com...

nchoor More please What is testError()?What executes the IF statement?

Source is Usenet: comp.databases.mysql
Sign in to add a comment

Answer score: 5
13/09/2017 11:47 - On 17 Sep, 18:34, Dymios That may depend on how you are calling it. Can you show us?

Source is Usenet: comp.databases.mysql
Sign in to add a comment

Answer score: 5
13/09/2017 11:47 - Captain Paralytic <paul_lautman@yahoo.com> ha scritto nel messaggio news:c42440ad-55d5-4e74-a1a9-e3b2a11ac9b9@h30g2000vbr.googlegroups.com...

In my db I have some stored procedures and triggers that check if constraints will fail.

For example, I have a stored procedure used for input data in a table. Before execute the insert to statement in the procedure, I call the function testError() that check if data passed to the procedure is correct. If data is incorrect, testError() returns TRUE, then I call the exception function to block the insert operation.

I would like to print to screen why the system reported the error, passing this information when I call the exception function.


Source is Usenet: comp.databases.mysql
Sign in to add a comment

eDiscover
Helpforce eDiscover provides technical articles updated each dayHelpforce eDiscover RSS feed contains the latest technical articles in RSS
Click the logo to go back to the main page
Search eDiscover
  
Categories

Click an icon to go to that category

Helpforce eDiscover contains articles about Microsoft Windows Helpforce eDiscover contains articles about Apple products and MacOS Helpforce eDiscover contains articles about Linux and POSIX operating systems Helpforce eDiscover contains articles about Helpforce Helpforce has a large variety of technical information and articles for you to read Helpforce eDiscover contains articles about databases, MYSQL, SQL Server Oracle Helpforce eDiscover contains articles about Java, JVM and the JRE Helpforce eDiscover contains articles about the QNX operating system Helpforce eDiscover contains articles about Oracle Solaris and Open Solaris Helpforce eDiscover contains articles about RISC OS, Acorn and the BBC Micro Helpforce eDiscover contains articles about Amiga and AmigaOS

Type your comment into the box below