I send my last message before I read this one - this is what I was looking for. Thanks again
J
On 6/21/2011 12:01 PM, A. Razzak Memon wrote:
At 11:42 AM 6/21/2011, J BLAUSTEIN wrote:

I have two simple question?
how do I get the record count for a table?

J,

There are two techniques to achieve this goal.

01. Use Enhanced DB Navigator to be associated with appropriate table.
    Make sure to enable the option for "Record Count".

02. Use the GETPROPERTY TABLE 'tablename->RECORDCOUNT' varname command

    -- Example
    -- RecordCount_RecNo_Code.RMD
    CLEAR VAR vRecordCount, vRecNo, vRecInfo
    SET VAR vRecordCount TEXT = NULL
    SET VAR vRecNo TEXT = NULL
    SET VAR vRecInfo TEXT = NULL
    GETPROPERTY TABLE 'Customer->RECORDCOUNT' vRecordCount
    GETPROPERTY TABLE 'Customer->RECNO' vRecNo
    SET VAR vRecInfo = ('  Record:'&.vRecNo&'of'&.vRecordCount)
    PROPERTY RBASE_FORM CAPTION .vRecInfo
    CLEAR VAR vRecordCount, vRecNo, vRecInfo
    RETURN

How do I make a form with a primary table - when I delete the primary
table all the sub table records are delete?

If I understand your question correctly ...

The best and most eloquent method is to use the "CASCADE" option for
the table with PRIMARY Key.

Using R:BASE eXtreme 9.1, there are two available options while in
Table Designer.

Cascade: [ ] Update [ ] Delete

Cascade - Maintains primary/foreign key relationships automatically.
A CASCADE can be applied to UPDATE, DELETE, or BOTH data set changes
for primary keys. For example, if you either UPDATE or DELETE a
primary key value from a table, the corresponding foreign key values
are updated or deleted automatically. CASCADE can only be added to
tables with primary keys.

· Update - enforces that when a primary key value is updated, the
  corresponding value in the foreign key table(s) will also be updated.

· Delete - enforces that when a primary key value is deleted, the
   corresponding value in the foreign key table(s) will also be deleted.

Separate UPDATE and DELETE data restrictions can allow a CASCADE to be
enforced for values that are updated, but not enforced when records are
deleted, in order to avoid an accidental or undesired record delete.

Hope that helps!

Very Best R:egards,

Razzak.





--

*J. Blaustein*

*J Blaustein Associates, Inc.*

* 12 Herrick Drive*

* Lawrence, NY 11559*

*516-371-3445 FAX 516-345-8009*

Reply via email to