Page 1 of 1
Write in PostgreSQL views.
Posted: Fri Dec 10, 2010 9:36 pm
by JuliusMax
I'm currently using a database under PostgreSQL massively using views to access my data.
These views include rules allowing me to update data directly by executing request on the view.
I'd like to interface it using Open Office but OO Base locks by default insert, update and delete attempts on views.
I can't find where to deactivate that or if it's event possible.
Anyone can enlighten me?
Re: Write in PostgreSQL views.
Posted: Sat Dec 11, 2010 10:09 am
by r4zoli
OOo Base UI only supports SELECTs in queries, no insert, update, and delete allowed. Only in Tools>SQL... command window you can use for scripts, you could not check it in interactive mode.
This is true not only for queries, but for views, too.
If you want to use views update, the Base not right tool for you.
May be some coding could help you, but it's out of my knowledge.
Re: Write in PostgreSQL views.
Posted: Fri Dec 17, 2010 2:38 pm
by peterdines
JuliusMax wrote:I'd like to interface it using Open Office but OO Base locks by default insert, update and delete attempts on views.
I can't find where to deactivate that or if it's event possible.
You mean using a form? I'm 99.999% sure Base can't do that at the moment. What I do is attach a main table to the form, then attach small related views as subforms for calculations and such. You can attach subforms with constraints (cascade on update / delete), so I think you could get most of the same functionality this way.
You can also run arbitrary SQL by using a macro connected to a form element like a button. But I shudder to think of the amount of work it'd take to hack in view writability.
Re: Write in PostgreSQL views.
Posted: Fri Dec 17, 2010 2:54 pm
by Villeroy
All views are read-only, even SELECT views in the "native" type of database. "Action queries" (insert, delete, update) can be triggered by macros.
Don't ask me why, why, why.
Base is the worst database tool on this planet. Before you start coding macros you should consider something else.
Re: Write in PostgreSQL views.
Posted: Fri Dec 17, 2010 11:15 pm
by peterdines
Oh well. Now that I know Base's limitations and some workarounds for them I quite like it. I've coded two billing systems on it with a MySQL back end and I'm about to start something more ambitious. But yeah, the macro API is an abomination spawned by the Elder Gods. I avoid macros whenever possible; I have 5 or 6 simple ones to do small tricks and that's about as far as I want to take it.