SQL Views in 3.0

Release notes for Servoy betas

SQL Views in 3.0

Postby sdevlin » Fri Aug 25, 2006 8:50 pm

Are views working?
So far I cannot link a form to a view. I get this everytime:

Code: Select all
Cannot work without primaryKey on table


What Am I Missing?

-sean
sdevlin
 
Posts: 125
Joined: Tue Apr 13, 2004 3:33 am

Postby bcusick » Fri Aug 25, 2006 9:13 pm

Ummmm... your view doesn't have a primary key included in the query. Just add a PK to the view, and it should work fine.
Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA

views not accepting a primary key

Postby kions » Mon May 07, 2007 2:10 pm

i created a view using several unions and 2 base tables but i cannot create a primary key/row identifier on any of the columns/attributes..including the columns which were primary keys in the base tables...i tried the coalese function as well as 'distinct' key word and 'is not null' ,but nothing works...my code looks like this>>>
select distinct BatchNote_Types.BNT_Code,BatchNote_Types.BNT_Description, BNT_Fields.Field_No,BNT_Fields.Field_Name,BNT_Fields.Grouping_Function,
BNT_Fields.Field_Formula,BNT_Fields.Entry_Id,BNT_Fields.Item_id,
BNT_Fields.Entry_type,BNT_Fields.Other as other1,coalesce(BatchNote_Types.BNT_Code,BNT_Fields.Field_Name) from
BatchNote_Types,BNT_Fields where
BatchNote_Types.BNT_Code = BNT_Fields.BNT_Code and BatchNote_Types.BNT_Code is not null and BNT_Fields.Field_No is not null union
select BatchNote_Types.BNT_Code,BatchNote_Types.BNT_Description,
-99999999,'Total Amount',0,'Amount','*','*','*','*','*' from
BatchNote_Types
union
select BatchNote_Types.BNT_Code,BatchNote_Types.BNT_Description,
-99999998,'No of Entries',1,'N/A','*','*','*','*','*' from
BatchNote_Types

<<<<<
where bnt_code and fied_no are primary keys on the bnt_fields table and bnt_code is the primary key of the batch_notetypes table.
kions
 
Posts: 30
Joined: Wed Feb 21, 2007 4:05 pm

Postby rgansevles » Tue May 08, 2007 10:36 am

Hi,

Servoy will only be able to work with updatable views, unions and distinct in views usually means that they are not updatable.

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1927
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL

Postby srowe » Tue May 08, 2007 2:51 pm

I am also having an issue with using a SQL Server 2000 view to fill a value list. Is it possible to use a view in a value list. If the value list is filled from the table it works properly, but when I switch to the view the values are not filled.
srowe
 
Posts: 74
Joined: Wed May 02, 2007 3:01 pm
Location: USA Missouri


Return to Latest Releases

Who is online

Users browsing this forum: No registered users and 13 guests