2
$\begingroup$

I am inserting data into server using SQLInsert. I want to store the error messages i encounter when data is not inserted. Apparently the error output is different from function output how do i store the error output rather than the function output $Failed.

$\endgroup$
  • $\begingroup$ Are $MessageList or MessageList any use to you? $\endgroup$ – aardvark2012 Jun 29 '17 at 10:53
  • $\begingroup$ The complete error is: JDBC::error: Conversion failed when converting date and/or time from character string. While MessageList[-1] produces {JDBC::error} and $MessageList gives {}. So nope. $\endgroup$ – user13892 Jun 29 '17 at 11:36
  • $\begingroup$ Question 134698 and the link it contains may be of help. $\endgroup$ – bbgodfrey Jun 29 '17 at 23:17
  • 1
    $\begingroup$ You will like my this post. :) $\endgroup$ – yode Jun 30 '17 at 4:38
1
$\begingroup$

To make my comment above more concrete, question 134698 gives the basic process for capturing the error messages as strings. For instance, the two error messages from

NDSolve[k y[x] + (y''[x] == 0, y, x]

can be captured by

t = "MessagesText" /. EvaluationData[NDSolve[k y[x] + (y''[x] == 0, y, x]];

t
(* {"NDSolve::ndlim : Range specification x is not of the form {x, xend} or 
        {x, xmin, xmax}.", 
    "NDSolve::ndnco : The number of constraints (0) (initial conditions) is not equal to 
         the total differential order of the system plus the number of discrete 
         variables (2)."} *)
| improve this answer | |
$\endgroup$
  • $\begingroup$ Thank you, it works for my case as well. $\endgroup$ – user13892 Jun 30 '17 at 6:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.