News
On June 1, we’re asking you to select a content label when starting a new topic in the Discussions area. Read more to find out why.
Choose Language Hide Translation Bar
Highlighted
robot
Level VI

Capture Error Message Text

I am using JMP12 to pull data from ODBC.  Most of the time this works great, but sometimes an error is thrown and JMP will return an error message to the log.  Is there a way to capture the error text to display in a message box or something?

 

An example error message is below:

 

"[Microsoft][ODBC SQL Server Driver][SQL Server]The query processor ran out of internal resources and could not produce a query plan. This is a rare event and only expected for extremely complex queries or queries that reference a very large number of tables or partitions. Please simplify the query. If you believe you have received this message in error, contact Customer Support Services for more information."

 

Thanks!

0 Kudos
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
vince_faller
Super User

Re: Capture Error Message Text

If you run your database call inside of a Log Capture, you won't have to run through the entire log list. 

 

logtxt = LogCapture(
     databaseCall()
);

 

Vince Faller - Predictum

View solution in original post

3 REPLIES 3
Highlighted
mpl34
Level III

Re: Capture Error Message Text

If you know you are looking for an ODBC error like this you can search the log by using the getlog() function in your script, e.g.:

 

log=getlog();
for(i=1,i<=nitems(log),i++,
if(contains(log[i],"[Microsoft]")>0,
newwindow("Error",
<<modal,
vlistbox(align("center"),
textbox(log[i]),
buttonbox("OK")))
);
);

Highlighted
robot
Level VI

Re: Capture Error Message Text

Thanks!

0 Kudos
Highlighted
vince_faller
Super User

Re: Capture Error Message Text

If you run your database call inside of a Log Capture, you won't have to run through the entire log list. 

 

logtxt = LogCapture(
     databaseCall()
);

 

Vince Faller - Predictum

View solution in original post