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$
4
  • $\begingroup$ Are $MessageList or MessageList any use to you? $\endgroup$ Commented Jun 29, 2017 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
    Commented Jun 29, 2017 at 11:36
  • $\begingroup$ Question 134698 and the link it contains may be of help. $\endgroup$
    – bbgodfrey
    Commented Jun 29, 2017 at 23:17
  • 1
    $\begingroup$ You will like my this post. :) $\endgroup$
    – yode
    Commented Jun 30, 2017 at 4:38

1 Answer 1

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)."} *)
$\endgroup$
1
  • $\begingroup$ Thank you, it works for my case as well. $\endgroup$
    – user13892
    Commented Jun 30, 2017 at 6:56

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