Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to format timestamp in oracle 10g?

0
10 Posted

How to format timestamp in oracle 10g?

0
10

Hi – It all depends on how you send the date to Oracle from VB. If you want to use the sysdate, and you always want to use the sysdate as the timestamp when inserting a record, then it is best to make the column in your Oracle table have a DEFAULT value of sysdate and not pass the date to Oracle when inserting the record. By default, if no value is passed to the date field, then on insert it’ll grab the sysdate by default and you don’t have to worry about it. As an example, say you have table TEST with 3 columns: SQL> create table test (x number, y timestamp default sysdate, z varchar2(12)); Table created. SQL> insert into test (x,z) values (1,’hello’); 1 row created. SQL> commit; Commit complete. SQL> select * from test; X Y Z ———- —————————————-… ———— 1 12-MAR-08 09.09.18.000000 PM hello Or you can explicitly enter sysdate as a value: SQL> insert into test (x,y,z) values (1,sysdate,’hello again’); 1 row created. SQL> commit; Commit complete. SQ

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123