PB取得服务器系统时间的源代码

datetime ldt_date
string ls_sql

choose case lower(as_dbms)
case "oracle"
//oracle
ls_sql = "select sysdate fromsys.dual"
case "sqlserver"
//ms sql server
ls_sql = "select now() "
case "sybase","syc adaptive serverenterprise"
//sybase
ls_sql = "selectgetdate()"
case else
ls_sql = "select now() "
end choose
Declare l_cursor dynamic cursor for Sqlsa;
Prepare Sqlsa from :ls_sql;
Open dynamic l_cursor;
if Sqlca.SQLCode = 0 then
Fetch l_cursor into :ldt_date;
end if
if sqlca.SQLCode <> 0 then
ldt_date = Datetime(Today(), Now())
end if
Close l_cursor;

return ldt_date

你可能感兴趣的:(oracle,sql,SQL Server,Sybase)