CodePudding user response:
Datetime dtThe select getdate () into: dt from table top 1;
CodePudding user response:
Write wrong!Select the top 1 getdate () into: dt from table;
CodePudding user response:
You can also try the following method, although a little bit more, ha ha,,,datetime ldt_servertime
Declare cur_time dynamic cursor for sqlsa;//declare dynamic cursors
Prepare sqlsa from "select getdate ()";
The open dynamic cur_time;
The fetch cur_time into: ldt_servertime;//through database access server time
The close cur_time;
If the sqlca. Sqlcode & lt;> 0 then
Setnull (ldt_servertime)
End the if
Return ldt_servertime
CodePudding user response:
You use the databaseThe oracle:
The select sysdate from dual
Essentially a
The select getdate ()
Basically in the pb is defined as a function to use
CodePudding user response:
The select sysdate into: ld_date from dual; The most simpleCodePudding user response:
Eviler correctly, write a function returns the system time, the service side call in pbCodePudding user response:
Datetime ld_todaySelect the top 1 getdate () into: ld_today from sysobjects;
CodePudding user response:
Function of owerBuilder today () and time () () function returns the current date and time of the machine, but if the user is in use on this machine any modification of the system date and time, so in the application of system in use today () and time () function won't get the right of the current date and time, in the client/Server structure, one machine is used for the database Server, the average user is difficult to modify the time on it, we can in the current date and time of need time from the Server, as follows: to Sybase or MS SQL Server database as an example, the defined function uf_getdate () returns a datetime variable,Datetime d_today
Select DISTINCT getdate () into: d_today from existing in the library of any table name of the table;
Return d_today
Can get the Server's system time, getdate () is the Sybase (or MS SQL Server) system function, get the current time, return to a datetime variable, on the other database should also have a similar function,
CodePudding user response:
4th floor, roof, want to pick it up according to the databaseCodePudding user response:
Essentially a database, for example, table T1, one record with ID 1, is:Datetime dt
The select getdate () into: dt from T1 WHERE ID=1;
CodePudding user response:
The eighth floor,