cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Mauro_Gerber
Level V

catch Sql Query error

Hello

I want to update a database via the New SQL Query function:

Names Default To Here( 1 );
obj = New SQL Query(
	Connection("DB connection string"),
	Custom SQL "
		UPDATE table
			SET Column_1 = 1
		where Column_2 = '2'
	")
);
Error_Msg = Log capture( obj << Run;);

I get the following error message:

""
Error running SQL Query:
[Server] Invalid object name table

Log Capture only get the empty "" string. So i don't know if the query was successful since it returns an empty string when no error occurs.

 

simmilar topic but with open database: https://community.jmp.com/t5/Discussions/Catching-database-error-message/m-p/6749#M6743

"I thought about our dilemma, and I came up with a solution that I honestly think works out best for one of both of us"
- GLaDOS
11 REPLIES 11
pmroz
Super User

Re: catch Sql Query error

You might want to surround your code with these statements to force all error messages to the log:

 

batch interactive(1);

<your code>

batch interactive(0);

Mauro_Gerber
Level V

Re: catch Sql Query error

Hello @pmroz 
THX, I was about to write a new entry because I run into the "JMP alert" message pop up and the log captured didn't work. I found the following entry: Post about JMP alert with your solution.

"I thought about our dilemma, and I came up with a solution that I honestly think works out best for one of both of us"
- GLaDOS

Recommended Articles