Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Creating a view with an updateable meaningless field
Message
De
05/05/2006 18:22:39
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
05/05/2006 13:32:50
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 6
OS:
Windows 2000 SP4
Network:
SAMBA Server
Database:
Visual FoxPro
Divers
Thread ID:
01119677
Message ID:
01119802
Vues:
14
>Hi Everyone:
>
>I'm not sure if this is going to make sense but I'll try anyway. I am creating a view using select statement. i'm using the view for a grid. the view will have email addresses, contact name, customer_id, and a checkbox. The checkbox allows the user to select all the people to send an email to in a group email.
>
>i'm trying to accomplish two things:
>1. add the field to the view to hold the value of the checkbox in the grid. this field has nothing to do with the tables that are being represented in the rest of the view. this field will only be used to store what the user selects in a grid from a check box. I would prefer not to have to add another field to a table to store this value.
>
>I don't know the way to do a select statement in which the field that will store the value of the checkbox is created. It is not coming from a table. I've tried to use a .null. value, and that didn't work. I've also tried "select .f. as f_chk", and although that works (ie it creates a field in the view with the proper datatype), it doesn't seem to be a "clean" solution. is there another way to do this?
>
>2. I know I will have problems making this portion (the checkbox value portion) of the view updateable. nothing else from the grid is updateable, just the results from the checkbox. I've used dbsetprop before updating table fields from view fields. However, I've done some searching in the MSDN library and cannot seem to find a case where only the view field is updated. Can anyone provide the dbsetprop language to update only a view field based on the value of the checkbox in a grid? I am thinking that it is only a one line item.
>
>Any help is greatly appreciated! Thanks.
>
>Paul

Paul,
But do you need a view for this??? If we suppose you do, simply update your base table joining with the view. ie:
select myView
scan for f_chk
 update myBase set something = somevalue where myBase.key == myView.Key
endscan
Instead you could use an SQL and add the logical field with alter table (or during select).
Or you might choose not to add a logical field and use another temp cursor with one logical field only.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform