on 09-06-2010 6:38 AM
Hi all,
I have a scenario where in once sender JDBC channel polls the database , i need to update the table with current datetime stamp for a particular DATE field.
what will be the update syntax command that i need to add in the sender channel ?
Update Emp Set DATE = ? where EmmNo = 100;
Regards
Vinay P.
Hi Vinay,
In the databse, while creating the date field 'DATE', choose the data type for this as 'DATETIME'.
It will give you the required format.
-Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vinay,
Assuming you are using SQL server databse, use the below query:
Update Emp Set DATE = GetDate() where EmmNo = 100;
-Supriya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guys ,
The following query is working :
Update Emp Set DOJ = GetDate() where EmpNo = 1; O/p = Sep 1 201
Regarding adding Time as well , which function do i need to use
Also say for example , i need the Date time stamp format to be updated in the following format : dd.mm.yyyy hh:mm:ss , what will be the syntax
Regards
Vinay P.
Sorry for the wrong update ,
Syntax : Update Emp Set DOJ = GetDate() where EmpNo = 1 ; is returning the current date time stamp value along with milliseconds
In order to make sure that i get only the following format : dd.mm.yyyy hh:mm:ss , what changes do i need to make in the syntax
Regards
Vinay P.
Hi Vinay,
You can use the following command if the database that you are using is ORACLE
Update Emp Set DATE = SYSDATE where EmmNo = 100;
This should work for ORACLE Db. In case you are using a different Db, please let us know.
Regards, Gaurav.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
use
UPDATE EMP Set Date = curdate() where Emmno = 100.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have you defined any field in Data base to store date??
you can define one field in data base, you can make that defualt "SYSDATE" when even you update the data in table sysdate will be update in table by defult,you no need to update.
elase you have to do it manually.
Regards,
Raj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.