How do I Run Update query from Servoy to mySQL

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

How do I Run Update query from Servoy to mySQL

Postby ApeWare » Fri Apr 15, 2005 6:44 am

I need to run an update query from Servoy on a mySQL table. I am using mySQL 4.x so stored procedures are not possible at this time.
I have written a method but the only thing I could find to run a query is "getDataSetByQuery" Is there another way to execute a SQL query from Servoy? or am I going to have to loop through records in Servoy to do this update? If that is the case I can, but I was hoping to run an update query for speed.
User avatar
ApeWare
 
Posts: 114
Joined: Sat Aug 28, 2004 11:49 am
Location: Richmond, VA

Postby pbakker » Fri Apr 15, 2005 8:45 am

Servoy doesn't support custom update queries, due to the fact that servoy does datachange braodcasting.

When you would be able to run any custom update query yourself, the cached data would become updated, 'causing who know what kind of trouble.

First option would be: Try using the FoundSet updater (look under the DatabaseManager node). This allows updating multiple records at the same time.

If that doesn't work for you, I guess you have to loop through the records yourself.

Running updates from DB Stored Procedures is the third option. Then you have to take care of refreshing cached data yourself after executing the SP. But, I guess you say mySQL 4.x doesn't support running updates from SP's? mySQL 4.x is not my cup of tea, so I wouldn't know.

A fourth option would be building a plugin to get a connection to the database and perform the update over that. Still then you have to take care of the cached data refresh in Servoy.

Hope this gives you some ideas of the options available.

Paul
pbakker
 
Posts: 2822
Joined: Wed Oct 01, 2003 8:12 pm
Location: Amsterdam, the Netherlands

Postby ApeWare » Fri Apr 15, 2005 4:31 pm

Thanks Paul. I think the foundSet updater will do what I need.

There are so many options that often times I have difficulty finding the "right" way to do something.
User avatar
ApeWare
 
Posts: 114
Joined: Sat Aug 28, 2004 11:49 am
Location: Richmond, VA


Return to Web Development

Who is online

Users browsing this forum: No registered users and 4 guests