想要根据条件生成或假脱机HTML文件

时间:2017-05-10 13:31:36

标签: html sql spool

想要根据条件生成或假脱机HTML文件,例如在下面的情况下,只有当结果计数大于0假脱机html文件或否则

DECLARE 

VAL1 INT;

BEGIN

select count(*) into VAL1 from <tablename> where dbkey in (<key>);

IF VAL1 = 1 THEN

SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON -
HEAD "<TITLE>Document Title</TITLE> -
<STYLE type='text/css'> -
</STYLE>" -
BODY "TEXT='#000000'" -
TABLE "WIDTH='50%' BORDER='1'"

SPOOL D:\duplicate.html

COLUMN NAME HEADING 'columnName'
COLUMN SNAME HEADING 'columnName'
COLUMN DEPARTMENT HEADING 'columnName'

select <NAME>,<columnName>,<SNAME> from <tablename> where dbkey in (<key>);

SPOOL OFF

ELSE

END

END IF;

END;

0 个答案:

没有答案