Marty Bostick
|
| Posted: 10/07/2002, 1:00 PM |
|
I am just before purchasing CodeCharge Studio and have one major hangup to
stop me...."More than one field comprising the Primary Key".
Most of my Database models have composite primary keys in order to preserve
referential intregrity.
Can someone please give an example, rather than just stating that it can be
done for adding the additional columns making up the primary key?
Thank you
|
|
|
 |
Alexander
|
| Posted: 10/08/2002, 2:40 AM |
|
Hi Marty,
Some many-to-many relationships may have a table with multi-column primary
key.
For example, let's take a shopping cart system. We have table "Items" for
keeping sale items. Also we have table "Orders" for storing order details
(order date, user ip, etc.). Then we need to specify items included into the
user order. To do that we need table "OrderItems" with the following fields:
order_id, item_id, quantity. In this table order_id and item_id uniquely
specify the row. So, we have the multicolumn PK.
Regards,
Alex
"Marty Bostick" <Marty.Bostick@Protective.com> wrote in message
news:ansp4t$e16$1@news.codecharge.com...
> I am just before purchasing CodeCharge Studio and have one major hangup to
> stop me...."More than one field comprising the Primary Key".
>
> Most of my Database models have composite primary keys in order to
preserve
> referential intregrity.
>
> Can someone please give an example, rather than just stating that it can
be
> done for adding the additional columns making up the primary key?
>
> Thank you
>
>
|
|
|
 |
Alexander
|
| Posted: 10/08/2002, 5:08 AM |
|
Marty,
To example we can create CCS record form for editing the order details.
Please follow the following step-by-step instructions:
1. Create a database with three tables.
2. Create a new CCS project and create the database connection.
3. Start Grid Builder and create the Grid form using the Orders table.
4. Change order_id from Label to Link and add the "order_id" parameter
5. Start Grid Builder and create the Grid form using the OrderItems table
with 2 columns: item_id and quantity.
6. Add the "order_id" table parameter on the created form.
7. Change item_id from label to link and add the "order_id" and
"item_id" parameters to that link.
8. Create a Record form.
9. Set the connection property, set the datasource property to OrderItems.
10. Add two table parameters: order_id and item_id.
11. Change TextBox1 to ListBox, rename into item_id and set
fieldsource for item_id field.
12. Rename TextBox2 into quantity and set change fieldsource to quantity
field.
Then you should be able to change the quantity for existing orders by
selecting
order_id in the first table and item in the second.
For more sophisticated features you will need the custom (insert, update,
delete) operations.
Thanks,
Alex
"Alexander" <alexander.netkachev@yessoftware.com> wrote in message
news:anu975$3f8$1@news.codecharge.com...
> Hi Marty,
>
> Some many-to-many relationships may have a table with multi-column primary
> key.
> For example, let's take a shopping cart system. We have table "Items" for
> keeping sale items. Also we have table "Orders" for storing order details
> (order date, user ip, etc.). Then we need to specify items included into
the
> user order. To do that we need table "OrderItems" with the following
fields:
> order_id, item_id, quantity. In this table order_id and item_id uniquely
> specify the row. So, we have the multicolumn PK.
>
> Regards,
> Alex
>
>
> "Marty Bostick" <Marty.Bostick@Protective.com> wrote in message
>news:ansp4t$e16$1@news.codecharge.com...
> > I am just before purchasing CodeCharge Studio and have one major hangup
to
> > stop me...."More than one field comprising the Primary Key".
> >
> > Most of my Database models have composite primary keys in order to
> preserve
> > referential intregrity.
> >
> > Can someone please give an example, rather than just stating that it can
> be
> > done for adding the additional columns making up the primary key?
> >
> > Thank you
> >
> >
>
>
|
|
|
 |
Marty Bostick
|
| Posted: 10/08/2002, 2:27 PM |
|
Can you expand a little bit on how to work with just one table having a
primary key with multiple fields?
The Fields are "LocationName" and "Type", with the some other fields
containing describing information about a Branch Location or Locations.
Thank you so much for you assistance so far.
"Alexander" <alexander.netkachev@yessoftware.com> wrote in message
news:anuhrf$ion$1@news.codecharge.com...
> Marty,
>
> To example we can create CCS record form for editing the order details.
> Please follow the following step-by-step instructions:
>
> 1. Create a database with three tables.
> 2. Create a new CCS project and create the database connection.
> 3. Start Grid Builder and create the Grid form using the Orders table.
> 4. Change order_id from Label to Link and add the "order_id" parameter
> 5. Start Grid Builder and create the Grid form using the OrderItems table
> with 2 columns: item_id and quantity.
> 6. Add the "order_id" table parameter on the created form.
> 7. Change item_id from label to link and add the "order_id" and
> "item_id" parameters to that link.
> 8. Create a Record form.
> 9. Set the connection property, set the datasource property to OrderItems.
> 10. Add two table parameters: order_id and item_id.
> 11. Change TextBox1 to ListBox, rename into item_id and set
> fieldsource for item_id field.
> 12. Rename TextBox2 into quantity and set change fieldsource to quantity
> field.
>
> Then you should be able to change the quantity for existing orders by
> selecting
> order_id in the first table and item in the second.
> For more sophisticated features you will need the custom (insert, update,
> delete) operations.
>
> Thanks,
> Alex
>
> "Alexander" <alexander.netkachev@yessoftware.com> wrote in message
>news:anu975$3f8$1@news.codecharge.com...
> > Hi Marty,
> >
> > Some many-to-many relationships may have a table with multi-column
primary
> > key.
> > For example, let's take a shopping cart system. We have table "Items"
for
> > keeping sale items. Also we have table "Orders" for storing order
details
> > (order date, user ip, etc.). Then we need to specify items included into
> the
> > user order. To do that we need table "OrderItems" with the following
> fields:
> > order_id, item_id, quantity. In this table order_id and item_id uniquely
> > specify the row. So, we have the multicolumn PK.
> >
> > Regards,
> > Alex
> >
> >
> > "Marty Bostick" <Marty.Bostick@Protective.com> wrote in message
> >news:ansp4t$e16$1@news.codecharge.com...
> > > I am just before purchasing CodeCharge Studio and have one major
hangup
> to
> > > stop me...."More than one field comprising the Primary Key".
> > >
> > > Most of my Database models have composite primary keys in order to
> > preserve
> > > referential intregrity.
> > >
> > > Can someone please give an example, rather than just stating that it
can
> > be
> > > done for adding the additional columns making up the primary key?
> > >
> > > Thank you
> > >
> > >
> >
> >
>
>
>
>
|
|
|
 |
|