就像上面的标题一样,我试图使用按钮和下拉列表删除数据库中的一行,我已经这样做了,你可以在下拉列表中选择引用sql数据库的ID,但我不知道从哪里开始编码,我希望用户从下拉列表中选择一个ID,然后单击删除按钮以安全地删除该引用的行。救命??
procedure ALFRED_DELETE
IS
CURSOR selectcursor
IS
SELECT empid
FROM alfred_form_table;
BEGIN
--CSS and Title
htp.p ('
<html>
<p width = 100% align="left">
<form name ="deleteForm" action="alfred_first_package.Delete_Button" method="post" >
<table border="1" cellpadding="1" cellspacing="1" summary="">
<tr>
<H3>Delete Information</h3>
</tr>
<P> Please select an Empoyee ID to Delete from the database!!!</p>
<select> ');
for i in ( SELECT empid
FROM alfred_form_table)
loop
htp.p('
<option style="width:50" value="'||i.empid||'">'||i.empid||' </option>');
end loop;
htp.p('
</select>
</table>
<br>
<input type ="submit" name="DeleteInfo" value="Delete Information" align="right" />
</form>
</table>
</html>
');
end ALFRED_DELETE;
--------------------------------------------------------------------------------------------------
PROCEDURE Delete_Button(DeleteInfo in varchar2)
IS
BEGIN
null;
/*
htp.p('<html>
<body>
<p> You have deleted added '||EID||', '||JamesbondID||', and '||ENAME||' from the database! </p>
</body>
</html>
');
*/
end Delete_button;