Key s(*.K*) - Need to build keys !!!Help please 
Author Message
 Key s(*.K*) - Need to build keys !!!Help please

Hi
I'm using CW2  for windows
I have clarion file(file driver) with no keys in,I import some huge data
from Access to the file.After the importing I want to build keys(not
dynamical keys) and ship the dat file with keys.I don't now if this is
possible with clarion.

I choose this routine as the same file with keys is slow during importing so
that's why I delete the keys and import data which is quiet fast.The trouble
is to build those key after importing.

Or if you had any suggesstion on how to import data without deleting keys
and still able to import my data quiet fast,I will appreciate any suggetion.

Thanks for your attention.



Mon, 02 Jun 2003 22:05:58 GMT  
 Key s(*.K*) - Need to build keys !!!Help please
How about OPEN(), STREAM(), APPEND() and BUILD()?  

Al

Quote:

> Hi
> I'm using CW2  for windows
> I have clarion file(file driver) with no keys in,I import some huge data
> from Access to the file.After the importing I want to build keys(not
> dynamical keys) and ship the dat file with keys.I don't now if this is
> possible with clarion.

> I choose this routine as the same file with keys is slow during importing so
> that's why I delete the keys and import data which is quiet fast.The trouble
> is to build those key after importing.

> Or if you had any suggesstion on how to import data without deleting keys
> and still able to import my data quiet fast,I will appreciate any suggetion.

> Thanks for your attention.



Tue, 03 Jun 2003 01:19:01 GMT  
 Key s(*.K*) - Need to build keys !!!Help please
Mphozazo,

Use the APPEND() instead of the ADD() command
to add the records to your Clarion file. After your
"append"-loop has finished, issue: BUILD(ClarionFile)
(where "ClarionFile" is the label of your file) to build
all your key's.
Also take a look at the STREAM() and FLUSH()
commands to speed up the writing.

--
Best regards,
Maarten
CDD3.1, C5EEb - ABC & C5.5EEgold
Certainly Clarion Developer



Tue, 03 Jun 2003 03:51:15 GMT  
 Key s(*.K*) - Need to build keys !!!Help please
Walter,

Quote:

>flush at the end.Starnge thing is when records is updated the
>key(*.K)file is updated too.I have a look at append in help file and
>they say the key file won't be updated when the records are updated.
>So I'm wondering if I miss something,here is my sample code:

>* Company has 2 keys
>  Stream(Company)
>  set(readfile)
>   loop 1 to eof(readfile)
>      Next(readfile)
>      Append(Company)
>!I handle the errors that are          !posted
> end  ! Loop
>  Build(company)
>  Flush(company)
>.
>But why thas the key files updated while company are updated ?Or is it
>suppose to do that or not ?

Are you sure your key files are being updated during the append()?
The "Build(Company)"-command builds your key's. Remove this
command to check this and start with an empty Company-file.
Beware that Clarion key-files are automatically build by your
app if they don't exist.

Your loop can be improved. Depending on how many records
you are reading, maintain a counter to flush your buffers,
because Clarion has a limit to it's buffer capacity. Also test
for EOF *inside* your loop. Clarion has to read one record
ahead each time to check for the EOF. And you have your
last Flush()/Build() commands in the reverse order.

Cntr = 0
Stream(Company)
set(readfile)
loop
    Next(readfile)
    IF ErrorCode() = 33 THEN BREAK  .    !Test for EOF
     Append(Company)
     !I handle the errors that are          !posted
    Cntr += 1
    IF NOT (Cntr % 100)                                !Every 100 records
        Flush(company)
        Stream(Company)
    END
end
Flush(company)
Build(company)

--
Best regards,
Maarten
CDD3.1, C5EEb - ABC & C5.5EEgold
Certainly Clarion Developer



Wed, 04 Jun 2003 03:32:06 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Need a key sequence for keys F8, SHIFT-F10, and F12 sending through Expect

2. Building Clarion(.dat) Keys !!!! Help

3. KEY PRESSED DETECT(@@@@ Help Please @@@@)

4. Date Key Problem - Please Help !!!

5. Please help me send a key!!!

6. .TPS keys and ODBC/SQL - PLEASE HELP !!!

7. PLEASE HELP - KEY Problem w/Btrieve and Batch ADDs

8. Help w/ list($key, $val) = each($arr) please!

9. F10 Key disabling the other keys

10. Set(Key,Key) Question

11. Set(key,key)

12. Making return key act like tab key

 

 
Powered by phpBB® Forum Software