TABLE FILE CAR PRINT COUNTRY END - This returns only 5 rows ENGLAND,JAPAN,ITALY, WGERMANY, FRANCE.
TABLE FILE CAR PRINT BODYTYPE END - This returns all the 18 rows..with duplicate values..
TABLE FILE CAR PRINT * END - This returns all the rows.. with 18 rows.
Can anybody explain this..why can't i retriev all the rows when i do
TABLE FILE CAR PRINT COUNTRY END
Thanks in advance.
Prod: WF 7.6.10 windows. -- MRE/Dashboard/Self Service/ReportCaster - Windows XP
March 19, 2007, 04:29 PM
FrankDutch
Because you only use the country segment which in fact is a table with only 5 records. The bodytype segment is a second linked table.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
March 19, 2007, 04:40 PM
<JJI>
Hmmm, Focus files hé. Have you tried this :
TABLE FILE CAR
PRINT *
END
I think this should return around 40 rows. If it does, your ok. It's like Frank says you are only using one segment. If not, you can rebuild the CAR db with this : loadcar.fex in C:\ibi\apps\ibisamp. Maybe you need to tweak the USE command.
Also it would be helpfull if you could tell us what OS you're running on and what version of WF you're using. This message has been edited. Last edited by: <JJI>,
March 19, 2007, 04:42 PM
TryFocus
Frank How can i know the # of segments & how they are in structure in CAR file..?
We use SQL Passthrough..Once we retrieve the data from Database, I assume that entire data retrival is considered as single segment.
Please correct me if iam worng.
Thanks
Prod: WF 7.6.10 windows. -- MRE/Dashboard/Self Service/ReportCaster - Windows XP
March 19, 2007, 04:52 PM
Lusheng
* is a wild card to indicate all the fields you want to be printed in PRINT statement in a single segment file or a multiple segments with a single path. If you say PRINT COUNTRY, which means you only want to print the field COUNTRY. If you say PRINT SEG COUNTRY, it will print all the fields in the segment which contains the field COUNTRY.
March 19, 2007, 04:58 PM
FrankDutch
sql passthrough on a focus database????
why?
In a sql database you will have several tables and the essentials on a relational database is that you do not have all the data several times in on table.
So a table with country names holds 5 records and is linked to a table with bodytypes and a table with models etc.
The database is normalized for the sake of dataquality.
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
March 19, 2007, 05:06 PM
Francis Mariani
The CAR file is a Hierarchical database. Read all about the Hierarchical model:
There are parent/child releationships. If you access data from only a parent segment, the record count will be the number of parents found.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 19, 2007, 05:07 PM
Francis Mariani
By the way, where is
quote:
Minniapolis
?
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 19, 2007, 05:12 PM
FrankDutch
Francis
this Wikipedia artical proves that you can not trust op wiki data.... "well known databases" were is focus...
shall I change it?
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
March 19, 2007, 05:13 PM
<JJI>
The Car DB is a Focus DB which has a hierarchical structure. It's not the same as a relational DB. In a hierarchical DB you can have mulitple segments. One segment in a hierarchical DB like FOCUS can be seen as one table in a relation DB (like SQL, ORACLE, etc...) If you want to discover the structure of focus file you could type the following :
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
March 19, 2007, 05:36 PM
Francis Mariani
Ah, Underworld. Thanks.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
March 19, 2007, 05:39 PM
FrankDutch
Francis
I added Focus to the list of well known relational databases in the wikipedia page
Frank
Frank
prod: WF 7.6.10 platform Windows, databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7 test: WF 7.6.10 on the same platform and databases,IE7
March 19, 2007, 06:01 PM
susannah
Minneapolis to examine the structure of a focus database, examine its master file description (car.mas), which is the map to a focus file. A useful tool is the command CHECK FILE CAR PICTURE With the PICTURE option, the check file command will give you a quick schematic of a multi-segment file, of a joined collection of multi-segment files... you've stumbled across the coolest of all cool things about focus...the db structure.
oh.. wait. JJI already told you all this! Sorry, JJ
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
March 20, 2007, 05:38 AM
<JJI>
No problem Susannah,
We are here to help each other
March 20, 2007, 07:53 AM
Danny-SRL
Hello TryFocus,
To get info about a FOCUS database you can issue the following commands: ? FILE focusfilename ? FDT focusfile name
? FILE will give you a list of all the segments, the number of their occurences, the number of deleted occurences and dates of last transactions. You will also see the indexes and the total number of all segments, the total number of characters, the total number of pages.
? FDT will give you a list of all segments and indexes, the length of each segment in multiples of 4 bytes, the number of pages used by each segment
Here is what it looks like with the CAR file:
? FILE CAR
-RUN
0 STATUS OF FOCUS FILE: C:\ibi\apps\swatqa\car.foc ON 03/20/2007 AT 13.29.00
0 ACTIVE DELETED DATE OF TIME OF LAST TRANS
SEGNAME COUNT COUNT LAST CHG LAST CHG NUMBER
ORIGIN 5 02/20/2005 15.04.57 53
COMP 10 02/20/2005 15.04.57 53
CARREC 18 02/20/2005 15.04.57 53
BODY 18 02/20/2005 15.04.57 53
SPECS 18 02/20/2005 15.04.57 53
WARANT 8 02/20/2005 15.04.57 53
EQUIP 25 02/20/2005 15.04.57 53
*INDEXES*
COUNTRY 02/20/2005 15.04.57 53
0 TOTAL SEGS 102
TOTAL CHAR 3988
TOTAL PAGES 8
LAST CHANGE 02/20/2005 15.04.57 53
? FDT CAR
-RUN
0 DIRECTORY:C:\ibi\apps\swatqa\car.foc ON 03/20/2007 AT 13.29.00
DATE/TIME OF LAST CHANGE: 03/20/2007 13.29.00
0 SEGNAME LENGTH PARENT START END PAGES LINKS TYPE
1 ORIGIN 5 1 1 1 2
2 COMP 9 1 2 2 1 5
3 CARREC 9 2 3 3 1 3
4 BODY 12 3 4 4 1 3
5 SPECS 21 4 5 5 1 2
6 WARANT 12 2 6 6 1 2
7 EQUIP 12 2 7 7 1 2
COUNTRY 8 8 1 NEW
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
March 20, 2007, 10:05 AM
mgrackin
It seems that the confusion is over the fact that a FOCUS database is one physical file which contains one or more SEGMENTs. One easy way to see how many SEGMENTs are in a FOCUS database is to look at the Master File Description. Count the number of SEGNAME definition statements.
A SEGMENT could be thought of as a TABLE using RDBMS terminology. To stretch this analogy, you could think of a FOCUS database as a SCHEMA. A SCHEMA contains one or more related TABLES whereas a FOCUS database contains one or more related SEGMENTs.
The big difference is that the relationships between SEGMENTs in a FOCUS database are maintained by internal pointers and therefore the KEY FIELDs used in RDBMS TABLEs to maintain these relationships do not need to be repeated in each SEGMENT of a FOCUS database.
I hope this gives you a better understanding of a FOCUS database.
Thanks!
Mickey
FOCUS/WebFOCUS 1990 - 2011
March 20, 2007, 12:16 PM
TryFocus
Thank you guys..
Iam clear about Segments & Hierachial database.
Thank you
Prod: WF 7.6.10 windows. -- MRE/Dashboard/Self Service/ReportCaster - Windows XP