Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Designing database and RVs for three related tables
Message
From
18/04/2004 02:28:00
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
18/04/2004 01:25:18
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00895888
Message ID:
00895898
Views:
15
This message has been marked as the solution to the initial question of the thread.
>Hi all,
>
>It's easy to implement an invoice-and-detail-invoice entry form. I used have this kind of remote views:
>CREATE SQL VIEW rv_the_invoice REMOTE CONNECTION "Conn" AS
>SELECT * FROM invoices WHERE invoice_pk = ?liInvoicePK
>
>CREATE SQL VIEW rv_det_invoice REMOTE CONNECTION "Conn" AS
>SELECT * FROM det_invoices WHERE invoice_pk = ?liInvoicePK
>
>and open both with BUffering = 5.
>I can design a form that allow the user to edit the fields in both views, and update the data latter when the user choose Save (it's TABLEUPDATE( ) from my program point of view)
>
>Problem is currently, I'm designing a database that needs the third detail. Say, the last one is the assembly items table (that makes it the detail of the det_invoices). Can I use a third remote views; something like this:
>
>CREATE SQL VIEW rv_det_of_det_invoice REMOTE CONNECTION "Conn" AS
>SELECT * FROM det_invoices INNER JOIN det_of_det_invoices
>ON det_invoices.det_invoice_pk = det_of_det_invoices.det_invoice_pk
>
>Otherwise; do you have any alternatives.
>
>I'm looking forward to hearing from you.
>
>TIA,
>Willianto

You could use as many views as you like. However since you'd update a single table per view it's wiser to have columns from one table only. ie: For 3rd :
CREATE SQL VIEW rv_det_of_det_invoice ;
   REMOTE CONNECTION "Conn" AS ;
   SELECT * FROM det_of_det_invoices ;
   where det_invoice_pk in ;
   (SELECT det_invoice_pk FROM det_invoices WHERE invoice_pk = ?liInvoicePK)
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform