How to convert a TIMESTAMP data field to a CHAR data field in SQL

5 pts.
Tags:
SQL
How can I convert a TIMESTAMP data field to a CHAR data field?

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Subhendu Sen
    It is good practice to add another char field in your existing table with alter command. Then u can convert this timestamp (in MySQL it's like: 2014-03-25 00:00:00.0) to date field in the fore end language(like java/vb/ others) what you are using now. You can drop this particular timestamp field by using this query: alter table t1 drop column c
    where t1 is your table name and c is timestamp field name. However, I can not recommend this, insert another char field then as already said above. But whatever you do better take necessary backups of your data then go ahead. You can see this reference here:
    http://docs.oracle.com/cd/E17952_01/refman-5.6-en/alter-table-examples.html
    81,590 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: