Creating a local view using CREATE SQL VIEW

Creating a local view using CREATE SQL VIEW

Post by Yuki Takizaw » Wed, 30 Sep 1998 04:00:00



I need to create a local view in a database using FoxPro/SQL commands.

I can create the view with fields & join conditions by:
    CREATE SQL VIEW viewname AS SELECT...
but I do not seem to have control over the items on the "Update Criteria"
tab in the View Designer.

How about copying a local view from one database to another?

I have seen reference to Stonefield (SDT) a number of times. Would it solve
my problem?

TIA,

yuki

 
 
 

Creating a local view using CREATE SQL VIEW

Post by Trey Walpo » Wed, 30 Sep 1998 04:00:00


For the updatable stuff, you'll have to use the DBSETPROP() command to
set this.

e.g.,
CREATE SQL VIEW myview AS ;
  SELECT * FROM customer ;
  WHERE clastname LIKE ?tc_LastName

DBSETPROP("myview", "view", "sendupdates", .t.)
DBSETPROP("myview.iprimarykey", "field", "keyfield", .t.)
DBSETPROP("myview.iprimarykey", "field", "updatable", .f.)  && or .T.

You can loop through and set the fields as updatable, if you want.

Copying from one DBC to another, we made some simple modifications to
the GENDBC.PRG that comes with VFP to pull out specific view or table
definitions.  It's easy to do, so I didn't put the code here. Then you
can open a database and run the generated PRG to put the view in the
new database.

On Tue, 29 Sep 1998 15:12:37 -0700, "Yuki Takizawa"


>I need to create a local view in a database using FoxPro/SQL commands.

>I can create the view with fields & join conditions by:
>    CREATE SQL VIEW viewname AS SELECT...
>but I do not seem to have control over the items on the "Update Criteria"
>tab in the View Designer.

>How about copying a local view from one database to another?

>I have seen reference to Stonefield (SDT) a number of times. Would it solve
>my problem?

>TIA,

>yuki

Trey Walpole
"Dream no small dreams, for they have no power to move men."
-- Goethe

 
 
 

Creating a local view using CREATE SQL VIEW

Post by Craig Berntso » Wed, 30 Sep 1998 04:00:00


Use the DBSETPROP() function.

--

Craig Berntson
http://www.xmission.com/~craigb
Microsoft Visual FoxPro MVP
Salt Lake City Fox User Group


>I need to create a local view in a database using FoxPro/SQL commands.

>I can create the view with fields & join conditions by:
>    CREATE SQL VIEW viewname AS SELECT...
>but I do not seem to have control over the items on the "Update Criteria"
>tab in the View Designer.

>How about copying a local view from one database to another?

>I have seen reference to Stonefield (SDT) a number of times. Would it solve
>my problem?

>TIA,

>yuki