Delete in EUSql

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

This is a multi-part message in MIME format.

------=_NextPart_000_0066_01C305E2.C44A5760
	charset="iso-8859-1"

 I use set_parameters to create a value to insert a record using Eusql =
into EDB database.

In another procedure I read the EDB using Eusql and display the data in =
a List including the key value whic is not readable format.
I then select the record by clicking on it,  I get the index and use it =
to select the record to be deleted.
The record is not deleted.  These are the way I create the record then =
list the recod and find the record to delete
I also want to use code to  create a number for the KEYID value.
****add Record**********
i =3D  1 --length( PEOPLE ) do
 setText(dbText, i)
rtn_code =3D message_box("Show I",
    "remind for Win98", MB_ICONWARNING+MB_OK)

   set_parameter( "ARG0", i)
    set_parameter( "ARG1", hlname)
    set_parameter( "ARG2", hfname)
set_parameter( "ARG3", haddress)
set_parameter( "ARG4", hstreet)
set_parameter( "ARG5", hcity)
set_parameter( "ARG6", hstate)
set_parameter( "ARG7", hzip)
set_parameter( "ARG8", hphone)

   -- ok =3D run_query( sql )
    --if atom(ok) then
     --   puts(1, get_sql_err( ok ) )
      --  ? 1/0
 --   end if=20
 ok =3D run_sql( "INSERT INTO PEOPLE PEOPLE.KEYID, =
PEOPLE.LNAME,PEOPLE.FNAME," &
  "PEOPLE.ADDRESS,  PEOPLE.STREET," &
  "PEOPLE.CITY, PEOPLE.STATE, PEOPLE.ZIP, PEOPLE.PHONE " &
      "VALUES([ARG0], [ARG1],[ARG2], [ARG3],[ARG4],[ARG5],[ARG6], =
[ARG7],  [ARG8])")
     rtn_code =3D message_box(" added  record",
     "remind for Win98", MB_ICONWARNING+MB_OK)
    loadList()
*************Select list record****************
rocedure List1_onClick (integer self, integer event, sequence =
params)--params is ()
 sequence linex, liney, linet
 integer   indx
 indx =3D getIndex(List1)
 linex =3D getItem(List1,indx)
linet =3D linex

gxkey =3D (linex[1])

setText(dbText, gxkey)
 rtn_code =3D message_box("List1 click line",
    "remind for Win98", MB_ICONWARNING+MB_OK)
end procedure
**** DElete Record********************
rocedure btnDel_onClick (integer self, integer event, sequence =
params)--params is ()
 integer junk, rec, f, key
  rtn_code =3D message_box("Start delete ",
    "remind for Win98", MB_ICONWARNING+MB_OK)
  setText(dbText, gxkey)

rtn_code =3D message_box("Did dbyext loadlist ",
    "remind for Win98", MB_ICONWARNING+MB_OK)
 set_parameter( "ARG0", (gxkey))
***************I have tried the set parameter value but had no delete of =
record*****************
ok =3D run_sql( "DELETE FROM PEOPLE WHERE PEOPLE.KEYID =3D 1")
if atom(ok) then
    puts(1, get_sql_err( ok ))
--    ? 1/0
end if

rtn_code =3D message_box("Did sql ",
    "remind for Win98", MB_ICONWARNING+MB_OK)
  loadList()
    rtn_code =3D message_box("Did loadlist ",
    "remind for Win98", MB_ICONWARNING+MB_OK)
end procedure
------=_NextPart_000_0066_01C305E2.C44A5760
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>&nbsp;I use set_parameters to create a =
value to=20
insert a record using Eusql into EDB database.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In another procedure I read the EDB =
using Eusql and=20
display the data in a List including the key value whic is not readable=20
format.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I then select the record by clicking on =
it,&nbsp; I=20
get the index and use it to select the record to be =
deleted.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>The record is not =
deleted.</FONT>&nbsp;<FONT=20
face=3DArial size=3D2> These are the way I create the record then list =
the recod and=20
find the record to delete</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I also want to use&nbsp;code to =
&nbsp;create a=20
number for the KEYID value.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>****add Record**********</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>i =3D&nbsp; 1 --length( PEOPLE )=20
do<BR>&nbsp;setText(dbText, i)<BR>rtn_code =3D message_box("Show=20
I",<BR>&nbsp;&nbsp;&nbsp;&nbsp;"remind for Win98",=20
MB_ICONWARNING+MB_OK)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; set_parameter( "ARG0",=20
i)<BR>&nbsp;&nbsp;&nbsp; set_parameter( "ARG1", =
hlname)<BR>&nbsp;&nbsp;&nbsp;=20
set_parameter( "ARG2", hfname)<BR>set_parameter( "ARG3",=20
haddress)<BR>set_parameter( "ARG4", hstreet)<BR>set_parameter( "ARG5",=20
hcity)<BR>set_parameter( "ARG6", hstate)<BR>set_parameter( "ARG7",=20
hzip)<BR>set_parameter( "ARG8", hphone)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;&nbsp; -- ok =3D run_query( sql=20
)<BR>&nbsp;&nbsp;&nbsp; --if atom(ok) then<BR>&nbsp;&nbsp;&nbsp;&nbsp;=20
--&nbsp;&nbsp; puts(1, get_sql_err( ok ) =
)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
--&nbsp; ? 1/0<BR>&nbsp;--&nbsp;&nbsp; end if&nbsp;<BR>&nbsp;ok =3D =
run_sql(=20
"INSERT INTO PEOPLE PEOPLE.KEYID, PEOPLE.LNAME,PEOPLE.FNAME,"=20
&amp;<BR>&nbsp;&nbsp;"PEOPLE.ADDRESS,&nbsp; PEOPLE.STREET,"=20
&amp;<BR>&nbsp;&nbsp;"PEOPLE.CITY, PEOPLE.STATE, PEOPLE.ZIP, =
PEOPLE.PHONE "=20
&amp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "VALUES([ARG0], [ARG1],[ARG2],=20
[ARG3],[ARG4],[ARG5],[ARG6], [ARG7],&nbsp; [ARG8])")<BR>&nbsp;&nbsp;=20
&nbsp;&nbsp;rtn_code =3D message_box(" added&nbsp; =
record",<BR>&nbsp;&nbsp;=20
&nbsp;&nbsp;"remind for Win98", MB_ICONWARNING+MB_OK)<BR>&nbsp;&nbsp;=20
&nbsp;loadList()<BR>*************Select list =
record****************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>rocedure List1_onClick (integer self, =
integer=20
event, sequence params)--params is ()<BR>&nbsp;sequence linex, liney,=20
linet<BR>&nbsp;integer&nbsp;&nbsp; indx<BR>&nbsp;indx =3D=20
getIndex(List1)<BR>&nbsp;linex =3D getItem(List1,indx)<BR>linet =3D=20
linex</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>gxkey =3D (linex[1])</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>setText(dbText, =
gxkey)<BR>&nbsp;rtn_code =3D=20
message_box("List1 click line",<BR>&nbsp;&nbsp;&nbsp;&nbsp;"remind for =
Win98",=20
MB_ICONWARNING+MB_OK)<BR>end procedure<BR>**** DElete=20
Record********************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>rocedure btnDel_onClick (integer self, =
integer=20
event, sequence params)--params is ()<BR>&nbsp;integer junk, rec, f,=20
key<BR>&nbsp; rtn_code =3D message_box("Start delete=20
",<BR>&nbsp;&nbsp;&nbsp;&nbsp;"remind for Win98",=20
MB_ICONWARNING+MB_OK)<BR>&nbsp; setText(dbText, gxkey)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>rtn_code =3D message_box("Did dbyext =
loadlist=20
",<BR>&nbsp;&nbsp;&nbsp;&nbsp;"remind for Win98",=20
MB_ICONWARNING+MB_OK)<BR>&nbsp;set_parameter( "ARG0", =
(gxkey))</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>***************I have tried the set =
parameter value=20
but had no delete of record*****************</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>ok =3D run_sql( "DELETE FROM PEOPLE =
WHERE=20
PEOPLE.KEYID =3D 1")<BR>if atom(ok) then<BR>&nbsp;&nbsp;&nbsp; puts(1,=20
get_sql_err( ok ))<BR>--&nbsp;&nbsp;&nbsp; ? 1/0<BR>end if</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>rtn_code =3D message_box("Did sql=20
",<BR>&nbsp;&nbsp;&nbsp;&nbsp;"remind for Win98",=20
MB_ICONWARNING+MB_OK)<BR>&nbsp;&nbsp;loadList()<BR>&nbsp; &nbsp; =
rtn_code =3D=20
message_box("Did loadlist ",<BR>&nbsp;&nbsp;&nbsp;&nbsp;"remind for =
Win98",=20

------=_NextPart_000_0066_01C305E2.C44A5760--

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

Search



Quick Links

User menu

Not signed in.

Misc Menu