1. EDS Database Choking 2
I think db_record_data( ) in database.e returns what it feels like,
Maybe it's my code! " doesnt look like it is "
This next problem I have is I am storing deleted names
in a seperate table and when my program starts up
it parses thru the Deleted Table for a list of user
deleted names so the user doesnt have to see them.
Sometimes this works, sometimes this doesnt....
Has anyone seen this problem and if so, have a
recommended fix?
Here's my code:
sequence names
names = db_table_list()
sequence delnames
delnames = {}
integer len
len = length(names)
if db_select_table("Deleted") != DB_OK then
puts(2, "Couldn't find table!\n")
abort(1)
end if
e = db_table_size()
if e = 0 then
else
for x = 1 to e do
delnames = append(delnames, db_record_data(x))
end for
for i = 1 to length(delnames) do
if find(delnames[i],names) then
if i = 1 then
names = names[2..length(names)]
else
names = names[1..i - 1] & names[i + 1..length(names)]
end if
names = append(names,{})
len -= 1
end if
end for
end if
names = names[1..len]
Euman
2. Re: EDS Database Choking 2
Yes, It was my code....!
I traced thru it again to find that sometime
in the process of writing the loop that I had
reversed delnames and names which threw
me off...
Sorry.
That prior problem with db_delete_table ()
still exist though.
Euman
----- Original Message -----
From: "Euman" <euman at bellsouth.net>
To: "EUforum" <EUforum at topica.com>
Sent: Saturday, June 09, 2001 21:50
Subject: EDS Database Choking 2
>
>
> I think db_record_data( ) in database.e returns what it feels like,
> Maybe it's my code! " doesnt look like it is "
>
> This next problem I have is I am storing deleted names
> in a seperate table and when my program starts up
> it parses thru the Deleted Table for a list of user
> deleted names so the user doesnt have to see them.
>
> Sometimes this works, sometimes this doesnt....
> Has anyone seen this problem and if so, have a
> recommended fix?
>
> Here's my code:
>
> sequence names
> names = db_table_list()
>
> sequence delnames
> delnames = {}
>
> integer len
> len = length(names)
>
> if db_select_table("Deleted") != DB_OK then
> puts(2, "Couldn't find table!\n")
> abort(1)
> end if
>
> e = db_table_size()
>
> if e = 0 then
> else
>
> for x = 1 to e do
> delnames = append(delnames, db_record_data(x))
> end for
>
> for i = 1 to length(delnames) do
> if find(delnames[i],names) then
> if i = 1 then
> names = names[2..length(names)]
> else
> names = names[1..i - 1] & names[i + 1..length(names)]
> end if
> names = append(names,{})
> len -= 1
> end if
> end for
>
> end if
>
> names = names[1..len]
>
> Euman
>
>
>
>
>
3. Re: EDS Database Choking 2
Someone asked how I fixed the last problem I had
so here it is just incase it might help someone else.
I wish I had a better slice routine (this is recursive)
but this seems to work OK...
now that I have it typed in right..
Here it is:
sequence names, delnames
integer e, len
names = db_table_list()
len = length(names)
delnames = {}
if db_select_table("Deleted") != DB_OK then
puts(2, "Couldn't find table!\n")
abort(1)
end if
e = db_table_size()
if e = 0 then
else
for x = 1 to e do
delnames = append(delnames, db_record_data(x))
end for
for i = 1 to length(names) do
if find(names[i], delnames) then
names = names[1..i - 1] & names[i + 1..length(names)]
names = append(names,{})
len -= 1
end if
end for
end if
names = names[1..len]
Looks real similar to the last one doesnt it?
Well, thats Euphoria......... literally ;)
Euman
----- Original Message -----
From: "Euman" <euman at bellsouth.net>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, June 10, 2001 00:54
Subject: Re: EDS Database Choking 2
>
>
> Yes, It was my code....!
>
> I traced thru it again to find that sometime
> in the process of writing the loop that I had
> reversed delnames and names which threw
> me off...
>
> Sorry.
>
> That prior problem with db_delete_table ()
> still exist though.
>
> Euman
>
>
> ----- Original Message -----
> From: "Euman" <euman at bellsouth.net>
> To: "EUforum" <EUforum at topica.com>
> Sent: Saturday, June 09, 2001 21:50
> Subject: EDS Database Choking 2
>
>
> >
> >
> > I think db_record_data( ) in database.e returns what it feels like,
> > Maybe it's my code! " doesnt look like it is "
> >
> > This next problem I have is I am storing deleted names
> > in a seperate table and when my program starts up
> > it parses thru the Deleted Table for a list of user
> > deleted names so the user doesnt have to see them.
> >
> > Sometimes this works, sometimes this doesnt....
> > Has anyone seen this problem and if so, have a
> > recommended fix?
> >
> > Here's my code:
> >
> > sequence names
> > names = db_table_list()
> >
> > sequence delnames
> > delnames = {}
> >
> > integer len
> > len = length(names)
> >
> > if db_select_table("Deleted") != DB_OK then
> > puts(2, "Couldn't find table!\n")
> > abort(1)
> > end if
> >
> > e = db_table_size()
> >
> > if e = 0 then
> > else
> >
> > for x = 1 to e do
> > delnames = append(delnames, db_record_data(x))
> > end for
<snip>
>
>