Murray, Pam
2007-04-23T15:25:00Z
I have a view created in SQL combining 2 tables. Contacts & Personnel. I set SQL permissions to select & update. It's a one to many (1 Contact with basic company address info) and Personnel (multiple personnel records containing contacts name, phone info etc.). I update the phone# for example, in Outlook. When I do a "store item", the SQL table is not updated.

Pam Murray
Sponsor
GeniusConnect documentation search (User Manual Downloads...)
Administrator
2007-04-23T15:29:00Z
Hi,

please see topics:
http://support.geniusconnect.com/topics/14- 

You will have to create instead of triggers on the View, or use custom stored procedures (Folder options->SQL commands) to update/insert or delete the data.
Murray, Pam
2007-04-23T15:35:00Z
So I would have 2 SQL statements in the folder: 1 to update fields on the Contacts table, and another to update fields on the personnel table?

Pam Murray
Administrator
2007-04-23T15:44:00Z
this depends on your view/datamodel.

The most fast en secure solution is to write 3 custom stored procedures (insert,update and delete),
GeniusConnect will send you all params, and you can write any statement you want inside the stored procedures.

see example stored procedures: Example MSSQL Server custom sp.sql (installation folder)
Murray, Pam
2007-04-23T16:54:00Z
How does Genius initiate the trigger? Triggers in SQL are activated only when and insert, update or delete command is issued. I guess I'm still unsure which table would have the trigger.
Administrator
2007-04-23T17:07:00Z
GeniusConnect does not initiate trigger.

Stored procedure is not a trigger, it is a procedure running in the database.
Murray, Pam
2007-04-23T17:10:00Z
I guess your first response was a bit confusting. I understand the difference between stored procedures and triggers, but where do I initiate the stored procedure?
Murray, Pam
2007-04-23T17:12:00Z
I see in your help files. I execute the procedure in the advanced SQL commands when setting up the folder. I'll give it a try. Thank you for all of your prompt responses.
Administrator
2007-04-23T17:16:00Z
If you don't want to write a store procedures, you can write instead of triggers on your View (if supported by DB).
When GeniusConnect executes a normal update/insert etc.. statement against the view, the trigger fires automatically and you can
split the data to multiple tables behind the view.