KirbyBase 2.3: Error: Table already has index record for recno: 1

B

basi

Hello,
During insert inside a loop, after the first insert was successful, the
second failed with this error: :

RuntimeError: Table already has index record for recno: 1
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:2514:in `add_index_rec'
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:491:in `add_to_indexes'
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:841:in `insert_record'
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:828:in
`with_write_locked_table'
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:828:in `insert_record'
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:1548:in `insert'
from (irb):36
from (irb):26:in `each'
from (irb):26
from :0

Here's the insert command:

tgl_texts.insert do |r|
r.source = lines[0]
r.sourcedate = lines[1]
r.title = lines[2]
r.author = lines[3]
r.type = lines[4]
r.filename = fn
r.text = text
end

The command is inside a files.each do ... end block.

Isn't recno managed automatically?

KirbyBase is an excellent lightweight highly accessible data storage
system!

gk
 
J

Jamey Cribbs

basi said:
Hello,
During insert inside a loop, after the first insert was successful, the
second failed with this error: :

RuntimeError: Table already has index record for recno: 1
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:2514:in `add_index_rec'
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:491:in `add_to_indexes'
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:841:in `insert_record'
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:828:in
`with_write_locked_table'
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:828:in `insert_record'
from c:/ruby/lib/ruby/site_ruby/kirbybase.rb:1548:in `insert'
from (irb):36
from (irb):26:in `each'
from (irb):26
from :0

Here's the insert command:

tgl_texts.insert do |r|
r.source = lines[0]
r.sourcedate = lines[1]
r.title = lines[2]
r.author = lines[3]
r.type = lines[4]
r.filename = fn
r.text = text
end

The command is inside a files.each do ... end block.

Isn't recno managed automatically?
Yes. An index is automatically created for recno and it should all be
transparent. I will check into this and get back to you.
KirbyBase is an excellent lightweight highly accessible data storage
system!
Thanks!

Jamey Cribbs

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.
 
J

Jamey Cribbs

basi said:
Hello,
During insert inside a loop, after the first insert was successful, the
second failed with this error: :
I just tried a quick test where I looped 100 times and inserted a record
each time. I tried it single-user and client/server. Both worked fine.

Could you possibly email me the script and table? Also, are you on
version 2.3 of KirbyBase?

If you do send the files, please email them to: (e-mail address removed)

Thanks.

Jamey

Confidentiality Notice: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and/or privileged information. If you are not the intended recipient(s), you are hereby notified that any dissemination, unauthorized review, use, disclosure or distribution of this email and any materials contained in any attachments is prohibited. If you receive this message in error, or are not the intended recipient(s), please immediately notify the sender by email and destroy all copies of the original message, including attachments.
 
B

basi

Hi,
Thanks for the quick assistance. Knowing that it is not KirbyBase that
is causing the failure, I will look even more closely at my code to see
if I can fix the problem myself. If I get desperate, I will take you on
your offer to send you the code.
Thanks again for the help and for KirbyBase.
gk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top