Re: Possible problem in EDS

new topic     » goto parent     » topic index » view thread      » older message » newer message

Running this on Phix

?"cleanup first" 
 
{} = delete_file(current_dir() & "/" & "mydata.edb") 
 
?"-- create a new database------ " 
 
if db_create("mydata", DB_LOCK_NO)!=DB_OK then ?9/0 end if 
 
?"---- add tables with records to database ----------" 
 
for i=1 to 5 do 
    if db_create_table(sprintf("my_%d_table", i))!=DB_OK then ?9/0 end if 
 
    -- add some records  
    for j=1 to rand(20) do 
        if db_insert(j, rand(100))!=DB_OK then ?9/0 end if 
    end for 
end for 
 
sequence names = db_table_list() 
 
for i=1 to length(names) do 
--  printf(1, "%20s %d\n", {names[i], db_table_size( names[i] ) } )  
    if db_select_table(names[i])!=DB_OK then ?9/0 end if 
    printf(1, "%20s %d\n", {names[i], db_table_size()}) 
end for 
 
?"======== delete one table =============" 
 
db_delete_table("my_3_table") 
names = db_table_list() 
 
for i=1 to length(names) do 
    if db_select_table(names[i])!=DB_OK then ?9/0 end if 
    printf(1, "%20s %d\n", {names[i], db_table_size()}) 
end for 
 
?"--------- close and open the database" 
 
db_close() 
if db_open("mydata")!=DB_OK then ?9/0 end if 
 
names = db_table_list() 
 
for i=1 to length(names) do 
    if db_select_table(names[i])!=DB_OK then ?9/0 end if 
    printf(1, "%20s %d\n", {names[i], db_table_size()}) 
end for 

now gives me

"cleanup first" 
"-- create a new database------ " 
"---- add tables with records to database ----------" 
          my_1_table 15 
          my_2_table 7 
          my_3_table 19 
          my_4_table 14 
          my_5_table 17 
"======== delete one table =============" 
          my_1_table 15 
          my_2_table 7 
          my_4_table 14 
          my_5_table 17 
"--------- close and open the database" 
          my_1_table 15 
          my_2_table 7 
          my_4_table 14 
          my_5_table 17 

which looks fine to me

Pete

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu