manusatsangi
7th February 2003, 11:11
Hi,
We are on Oracle 8i.
I counted no of records of a table via GTM. Answer - 256 records.
But when counted the records via SQL Plus. Answer - 236 records.
Create a vanilla report which prints all the records of the table. It prints - 236 records.
How come GTM is giving the wrong no of records?
Has anyone encountered this situation before? Any suggestions?

Thanks in advance

- Manu

maxime
7th February 2003, 17:30
I have never encountered this problem.

You may also be looking at two different columns:

There is a column Row Length and Number of Rows. I once looked at Row Length (When i was sleepy) and mistook that for the Number of Rows. Please verify once again.

Another thing :Have you done the counting on the Same Company Number?

Maxime.

manusatsangi
8th February 2003, 07:16
Hi Maxime,
I am looking at the same company no. That's a nice observation you made, but I already ascertained that. :)
About, "Row Length and Number of Rows", I think I am counting rows via GTM using the standard drop down menu.. I don't think it counts row lenght.
There is one unique thing about this table, that data is not populated in this table by Baan directly, but by an oracle trigger.

dave_23
10th February 2003, 03:05
Are you using level 1 or level 2 driver?

manusatsangi
10th February 2003, 05:54
Hi,
How do I come to know which level of driver am I using?

Djie-En
10th February 2003, 12:46
Hi,

How many records do you get using session ttaad4222m000?

GN

manusatsangi
10th February 2003, 13:20
Hi GN,
Output of ttaad4222m000 is - 236 Records
Output of "Count Row" function in GTM - 256 Records

Then I ran "Reconfigure Tables" for the table.
Now the situation is :
Output of ttaad4222m000 is - 209 Records
Output of "Count Row" function in GTM - 209 Records

I think the problem was due to that fact that data is this table was written directly by an Oracle Trigger. The PK of the field was not defined in Oracle. As a matter of fact, none of the tables created by BaaN in Oracle implant the PK restriction in Oracle also.
Hence, probably more than one record for the same PK was being written by the trigger. And this was not being complained by BaaN. But difference ways to count the records (by BaaN) gave different results.

- Manu

norwim
10th February 2003, 13:20
Hi there,

I assume that you are using oracle level1 driver for baan.
This means that baan creates "invisible" columns (should be visible from oracle, but not from baan) which keep unique indices used to retrieve rows.
Hence nobody (here) seems to know how to generate these so called HASH columns, it generally is not possible to insert into or modify Baan Tables outsite of Baan. (As far as I understood the topic, it should be okay to modify date rows from outside of Baan, as long as no key field is changed? - Any comment would be appreciated here)
Additionally I am quite sure that Baan keeps a record counter somewhere which your trigger also will not update correctly.
This is no proper explanation why Baan "sees" MORE records than oracle, but perhaps someone has an assumption?

What you could do would be
a) Use the trigger to update a non key field in a table "properly" created by Baan or
b) from within a Baan session, issue a shell command to let oracle dump the table into a flat file and evaluate this file.

good luck

Norbert

manusatsangi
14th February 2003, 11:24
Hi,
I noticed the problem some time back. Did not get time to update the thread.
The problem is that though Baan considers 'Date' as 'Date without timestamp' and Oracle considers 'Date' as 'Date with timestamp'.
My table has Date field as part of PK. Hence if there are two records with same DD/MM/YYYY and different time, Oracle considers them as two records whereas Baan considers them as One.
Since this table is populated by Oracle trigger, it is embedding the timestamp also when writing the record.

My trigger reads something like

****************************************
begin
update table_name set a = :new.l, b = :new.m, date = :new.date
where date = :new.date ;
if sql%notfound then
insert into table_name values (:new.l, :new.m, :new.date) ;
end if;
end;
****************************************

These fields date & new.date are the date fields from different Baan tables.
Now how do I tell the oracle trigger to write the field 'date' without the timestamp. I do not ahve time to search the syntax on the net.

Thanks in advance

- Manu

NPRao
14th February 2003, 20:26
Someone on BB knows the hash algorithm - vinceco252 (http://www.baanboard.com/baanboard/showthread.php?s=&threadid=1525&highlight=hash)

timb25
6th March 2003, 17:22
In the session ttaad4222m000 Count Number of Records by Table, what does the column (number of recs * rowlength) / 1000 mean?

Is the rowlength given in a dba table? If so, which table? I'm curious about space.

I was analyzing some oracle tables vs. rows. I found that a table that contains only 1 record (Parameter table) has 1 MB of space allocated. I'm sure there are more instances like this. That seems ridiculous to me. Or am I wrong?



-Tim

victor_cleto
6th March 2003, 17:28
Space allocation has nothing to do with nr. of rows, it only depends on the settings of your ora_storage.
You probably have by default the initial extent set to 1MB, meaning that when the table is created, Oracle allocates as initial space 1 MB for it.

Imagine that, just to have small tables with small initial extents, you would need to add an entry for each table in ora_storage (2000+, doh). Your task as sys. admin is to keep a good balance of ora_storage, as a compromise between empty and non-empty tables. (you'll see that 1MB is nothing compared with certain tables...)