CodePudding user response:
Gf_server_date () - a custom functionCodePudding user response:
Yes, but I can't find where is the definition?CodePudding user response:
Browser - & gt; functionCodePudding user response:
Ha ha, rookie also many,CodePudding user response:
If your global function gf_server_date () returns the Datetime type:String (gf_server_date (), "hh: mm: ss")//returns the character type time
String (gf_server_date (), "yyyy. Mm. Dd hh: mm: ss")//returns the character type date/time
CodePudding user response:
If is the oracle database, you can write (sqlca has connected) :F_set_errinfo () is another custom functions, used to store the current error message
/*
Function:
Gets the time
Parameters:
There is no
The return value:
Successful return to time; Error returns an empty
*/
Datetime ldt_now
SetNull (ldt_now)
The select sysdate into: ldt_now from dual;
If the sqlca. Sqlcode=1 then f_set_ErrInfo (this, "f_get_servertime () ~ t" + sqlca. Sqlerrtext)
Return ldt_now
CodePudding user response:
As said, on the second floor gf_server_date () is a custom function, get inside the function to find theIf the oracle database, so to write, SELECT SysDate INTO: ldt_today FROM Dual;
Ls_today=String (ldt_today, 'yy. Mm. Dd)
CodePudding user response:
Leave a nameCodePudding user response:
Don't bother!!!!!St_3. Text=string (Today (), "yyyy - mm - dd hh: mm: ss")
CodePudding user response:
[PbObjFind]After integration on the menu to pb, restart pb, pb in the toolbar to open the can after,
Gf_server_date on object input, query, points to open the object (or double-click the data window object), you can in pb opened the object inside the
Download address:
http://download.csdn.net/source/871087
CodePudding user response:
* function description: get the server's date/time (DateTime)Meaning: * parameter as_dbms database used by the DBMS
* return back value: datetime types, system date
* call, for example: ldt_today=gf_getsysdate (sqlca. DBMS)
* writers: Guo Baoli
* write date: 2004.7.9
* -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - */
Datetime ldt_date
String ls_sql
Choose a case the lower (as_dbms)
Case "oracle"
//oracle
Ls_sql="select sysdate from sys. Dual"
Case "is essentially"
//ms SQL server
Ls_sql="select now ()"
Case "sybase
"//sybase
Ls_sql="select getdate ()", "
In case the else
Ls_sql="select now ()"
The end choose
Declare l_cursor dynamic cursor for Sqlsa;
Prepare Sqlsa from: ls_sql;
The Open dynamic l_cursor;
If the Sqlca. SQLCode=0 then
The Fetch l_cursor into: ldt_date;
End the if
If the sqlca. SQLCode & lt;> 0 then
Messagebox (" error ", "in function gf_get_sysdate () run-time database error!" )
Ldt_date=Datetime (Today (), Now ())
End the if
The Close l_cursor;
Return ldt_date
I turned, I hope for your help
CodePudding user response:
Upstairs positive solutionCodePudding user response:
Global function o miserableCodePudding user response:
I am doing an oracle dedicated system time functionDatetime ld_sysdate
The select sysdate into: ld_sysdate from dual;
Return ld_sysdate
CodePudding user response:
Agree with the upstairsCodePudding user response:
Gf_server_date () for a custom global function, in SQL SERVER, the PB method for:DATETIME ldt_DT
SELECT the TOP 1 GETDATE () INTO: ldt_DT FROM SYSOBJECTS;
RETURN ldt_DT
CodePudding user response:
January is not knot stickRemember the FROM SYSOBJECTS or FROM dual
Grab a record less little table to use
The SELECT GETDATE () FROM t1;
The SELECT GETDATE ()
CodePudding user response:
Datetime ldt_datetimeThe select curdatetime into: ldt_datetime
The from (select getdate () as curdatetime) cur_dt
;
This is more efficient ~ ~
CodePudding user response:
Can beCodePudding user response:
The