1. EUSQL deleting records

This is a multi-part message in MIME format.

------=_NextPart_000_0008_01C306BA.4D6934D0
	charset="iso-8859-1"

I am trying to delete and update records in my edb database. I am using =
the delete staement and the report shows the record deleted, but when I =
access the database again, the record is not deleted. This is the =
program that I used , a copy of the report program that cae with EUSQL
Jim
Why isn't the record deleted
************************************************************************
Demo Report
DELETE FROM PEOPLE WHERE PEOPLE.KEYID =3D 667=20

Parsed query in 0.01 seconds
{{"PEOPLE"},{{{1},{1}}},{{{1},{"KEYID",{}}}},{{-1,2}},{{23,{7,"PEOPLE_KEY=
ID",{1}},{1,{667},{}}},{{{-1,"PEOPLE_KEYID"}}}},{},{{},{}},0,{},{24,{}},{=
},{0}}

Retrieved 1 records in 0.00 seconds
{{"KEYID",{}}}
{667}
*************************************************************
***** SQLReport.ew modified***************************
*************************************************************************=
********
include print.e
with trace
include eusql.e

with type_check
--trace(1)
integer fout
sequence dbname, tablename
--db_close()
dbname =3D "sqla22.edb"
tablename =3D "PEOPLE"
fout =3D open( "demo.txt", "w")
EUSQLRESULT ok
ok =3D open_db( "sqla22.edb" )

procedure write_query( EUSQLRESULT query )
    atom t

    t =3D time()
ok =3D get_record_struct (  dbname,  tablename )
puts( fout, "\n" )
   =20
    query =3D run_query( query )
    t =3D time() - t
    printf( fout, "Retrieved %d records in %0.2f seconds\n",=20
        {length(query[2]), t})
   =20
    print( fout, query[1] )
    puts( fout, "\n" )
   =20
    query =3D query[2]
    for i =3D 1 to length( query ) do
        print( fout, query[i] )
        puts( fout, "\n" )
    end for
    puts( fout, "\n")
   =20
end procedure

function parse_query( EUSQLRESULT sql )
    atom t
    puts( fout, sql & "\n\n")
    t =3D time()
    sql =3D parse_sql( sql )
    t =3D time() - t
     puts(1," error creating")--=20
  puts(1,fout)--=20
    printf( fout, "Parsed query in %0.2f seconds\n", t )
    print( fout, sql ) puts( fout, "\n")


    return sql
end function

constant stmt =3D {
   =20
--    "SELECT MONTH.MONTH, PLATFORM.PLATFORM FROM MONTH INNER JOIN =
PLATFORM "
--    & " ON MONTH.ID =3D PLATFORM.ID"
--"select * from People where KEYID =3D 1"
  "DELETE FROM PEOPLE WHERE PEOPLE.KEYID =3D 667 " =20
--"select * from People "
--"delete_record ( dbname, tablename, 1 )"

    }
  =20
 =20
--   trace(1)=20
for i =3D 1 to length( stmt ) do
    write_query( parse_query( stmt[i] ) )
end for
ok =3D select_current( {}, "PEOPLE")
--ok =3D run_sql( "INSERT INTO PEOPLE PEOPLE.KEYID, PEOPLE.LNAME VALUES( =
121, 'XJANUARY')")
--ok =3D run_sql("Select KEYID from PEOPLE")
close(fout)
db_close() 
------=_NextPart_000_0008_01C306BA.4D6934D0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY style=3D"COLOR: #000000; FONT-FAMILY: " bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I am trying to delete and update =
records in my edb=20
database. I am using the delete staement and the report shows the record =

deleted, but when I access the database again, the record is not =
deleted. This=20
is the program that I used , a copy of the report program that cae with=20
EUSQL</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Jim</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Why isn't the record =
deleted</FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2>****************************************************************=
********</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Demo Report</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>DELETE FROM PEOPLE WHERE PEOPLE.KEYID =
=3D 667=20
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Parsed query in 0.01=20
seconds<BR>{{"PEOPLE"},{{{1},{1}}},{{{1},{"KEYID",{}}}},{{-1,2}},{{23,{7,=
"PEOPLE_KEYID",{1}},{1,{667},{}}},{{{-1,"PEOPLE_KEYID"}}}},{},{{},{}},0,{=
},{24,{}},{},{0}}</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Retrieved 1 records in 0.00=20
seconds<BR>{{"KEYID",{}}}<BR>{667}<BR>***********************************=
**************************</FONT></DIV><FONT=20
face=3DArial size=3D2>
<DIV>***** SQLReport.ew modified***************************</DIV>
<DIV>********************************************************************=
*************<BR>include=20
print.e<BR>with trace<BR>include eusql.e</DIV>
<DIV>&nbsp;</DIV>
<DIV>with type_check<BR>--trace(1)<BR>integer fout<BR>sequence dbname,=20
tablename<BR>--db_close()<BR>dbname =3D "sqla22.edb"<BR>tablename =3D=20
"PEOPLE"<BR>fout =3D open( "demo.txt", "w")<BR>EUSQLRESULT ok<BR>ok =3D =
open_db(=20
"sqla22.edb" )</DIV>
<DIV>&nbsp;</DIV>
<DIV>procedure write_query( EUSQLRESULT query )<BR>&nbsp;&nbsp;&nbsp; =
atom=20
t</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; t =3D time()<BR>ok =3D get_record_struct (&nbsp; =

dbname,&nbsp; tablename )<BR>puts( fout, "\n" )<BR>&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp; query =3D run_query( query =
)<BR>&nbsp;&nbsp;&nbsp; t =3D=20
time() - t<BR>&nbsp;&nbsp;&nbsp; printf( fout, "Retrieved %d records in =
%0.2f=20
seconds\n", <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
{length(query[2]),=20
t})<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; print( fout, query[1]=20
)<BR>&nbsp;&nbsp;&nbsp; puts( fout, "\n" )<BR>&nbsp;&nbsp;&nbsp;=20
<BR>&nbsp;&nbsp;&nbsp; query =3D query[2]<BR>&nbsp;&nbsp;&nbsp; for i =
=3D 1 to=20
length( query ) do<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; print( =
fout,=20
query[i] )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; puts( fout, =
"\n"=20
)<BR>&nbsp;&nbsp;&nbsp; end for<BR>&nbsp;&nbsp;&nbsp; puts( fout,=20
"\n")<BR>&nbsp;&nbsp;&nbsp; <BR>end procedure</DIV>
<DIV>&nbsp;</DIV>
<DIV>function parse_query( EUSQLRESULT sql )<BR>&nbsp;&nbsp;&nbsp; atom=20
t<BR>&nbsp;&nbsp;&nbsp; puts( fout, sql &amp; =
"\n\n")<BR>&nbsp;&nbsp;&nbsp; t =3D=20
time()<BR>&nbsp;&nbsp;&nbsp; sql =3D parse_sql( sql =
)<BR>&nbsp;&nbsp;&nbsp; t =3D=20
time() - t<BR>&nbsp;&nbsp;&nbsp; &nbsp;puts(1," error=20
creating")--&nbsp;<BR>&nbsp;&nbsp;puts(1,fout)--&nbsp;<BR>&nbsp;&nbsp;&nb=
sp;=20
printf( fout, "Parsed query in %0.2f seconds\n", t =
)<BR>&nbsp;&nbsp;&nbsp;=20
print( fout, sql ) puts( fout, "\n")</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp; return sql<BR>end function</DIV>
<DIV>&nbsp;</DIV>
<DIV>constant stmt =3D {<BR>&nbsp;&nbsp;&nbsp; <BR>--&nbsp;&nbsp;&nbsp; =
"SELECT=20
MONTH.MONTH, PLATFORM.PLATFORM FROM MONTH INNER JOIN PLATFORM=20
"<BR>--&nbsp;&nbsp;&nbsp; &amp; " ON MONTH.ID =3D =
PLATFORM.ID"<BR>--"select * from=20
People where KEYID =3D 1"<BR>&nbsp; "DELETE FROM PEOPLE WHERE =
PEOPLE.KEYID =3D 667=20
"&nbsp; <BR>--"select * from People "<BR>--"delete_record ( dbname, =
tablename, 1=20
)"</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp; <BR>&nbsp; <BR>--&nbsp;&nbsp; =
trace(1)=20
<BR>for i =3D 1 to length( stmt ) do<BR>&nbsp;&nbsp;&nbsp; write_query(=20
parse_query( stmt[i] ) )<BR>end for<BR>ok =3D select_current( {},=20
"PEOPLE")<BR>--ok =3D run_sql( "INSERT INTO PEOPLE PEOPLE.KEYID, =
PEOPLE.LNAME=20
VALUES( 121, 'XJANUARY')")<BR>--ok =3D run_sql("Select KEYID from=20

------=_NextPart_000_0008_01C306BA.4D6934D0--

new topic     » topic index » view message » categorize

2. Re: EUSQL deleting records

--- sixs at ida.net wrote:

> I am trying to delete and update records in my edb database. I am using the
> delete staement and the report shows the record deleted, but when I access
> the database again, the record is not deleted. This is the program that I
> used , a copy of the report program that cae with EUSQL
> Jim
> Why isn't the record deleted

Yes, I just found this bug, too.  It's a result of some other changes I've been
making recently.  I've got it fixed, and should have an update here in a day or
two.  Sorry for the delay, but I've been rewriting the SELECT code (it runs A
LOT faster now) and I still have a few [known] bugs to squash before I can let
it loose.

Matt Lewis



__________________________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo
http://search.yahoo.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu