Powered by Jitbit .Net Forum free trial version. dismiss

HomeProblems and issues

Post bug reports here. The forum is pre-moderated, your message will appear after being checked by us.

Editing a View Messages in this topic - RSS

falloutphil
falloutphil
Posts: 29


7/9/2017
falloutphil
falloutphil
Posts: 29
Hi,

I have a view in my underlying Postgres database that is a join of 2 tables.

I'm using INSTEAD OF to define a trigger to allow the view to support UPDATE, INSERT, and DELETE just like a regular table. This works fine when editting the view by running standard commands into the console (psql).

When I try to make this view editable SQLWallet, I'm getting the following error when trying to do update/insert or delete on it.

42601: syntax error at or near "["

I've filled in the following:

PK field name - I'm using a field in the view that is exclusive. Obviously a view need not have a primary key. I could include one from a table if needs be but not sure if this should be neccessary?

Main table name - The name of the view, not the underlying tables.


Given there should be no need to treat a view setup like this any differently to a regular table, would you expect it to be possible to edit it using SQLWallet? Any hints or tups?

Is there a way of seeing exactly what SQL SQLWallet is running? For example it it possible to create something like the run audit report that can show exactly what SQL is run when any edit has failed?

Cheers,

Phil.
edited by falloutphil on 7/9/2017
0 link
Gleb
Gleb
Administrator
Posts: 48


7/9/2017
Gleb
Gleb
Administrator
Posts: 48
The editable view should work fine. The purpose of the PK filed name is to uniquely identify each record, so you view should contain some unique column to be specified as PK in SQLwallet (does not have to be a real PK, unique is enough).

The error seems to be related to the PostrgreSQL syntax for escaping column names which is a double quote as opposed to square brackets in MS SQL.The fix should be quite straightforward, I will prepare a new build and let you know.
0 link
falloutphil
falloutphil
Posts: 29


7/10/2017
falloutphil
falloutphil
Posts: 29
Thanks very much Gleb!
0 link
Gleb
Gleb
Administrator
Posts: 48


7/11/2017
Gleb
Gleb
Administrator
Posts: 48
Fixed in 1.2.7
0 link
falloutphil
falloutphil
Posts: 29


7/11/2017
falloutphil
falloutphil
Posts: 29
Looks good now - thanks again for this and the other fixes in 1.2.7.
0 link






Powered by Jitbit Forum 8.3.8.0 © 2006-2013 Jitbit Software