50 - 55 of 55 tags for timestamp

Pages

Problem: How do you add or subtract a "fractional second" to a TIMESTAMP column in Teradata?

The available documentation is not very clear, so let's look into it using examples.

Basic use of INTERVAL

Build, Populate, and Query Test Table

Hello,
I have a strange error.
I am creating one table with foreign key on the same table :

CREATE TABLE TEST_B
(TID INTEGER NOT NULL,
PASSRESETDATE TIMESTAMP,
BACTIVE BYTEINT NOT NULL,
TEST_ID INTEGER,
CONSTRAINT PK_TEST_B PRIMARY KEY (TID));

ALTER TABLE TEST_B
ADD CONSTRAINT FK_TEST_B FOREIGN KEY (TEST_ID)
REFERENCES WITH CHECK OPTION TEST_B(TID);

I insert some data with java program :

PreparedStatement pstmt =null;
pstmt= conn.prepareStatement("INSERT INTO TEST_B (TID,BACTIVE,PASSRESETDATE,TEST_ID) VALUES (?,?,?,?)");
for(int i=1;i<3;i++){

Hi,

Would anyone know why the difference of two timestamp(6) columns in interval day(4) to second(6) is coming out all nulls in Hyperion 9.3.1? A calculated field with formula "(col2 - col1) interval day(4) to second(6)" is always NULL even though the two columns have different timestamp values.

Just to give you an idea, below is the equivalent in SQL Assistant that works:

create volatile table mytable ( col1 timestamp(6) , col2 timestamp(6) ) primary index (col1) on commit preserve rows;

delete from mytable;
insert into mytable
values (

From the TD user manual, i got this as an example of timestamp to time conversion:

SELECT CAST(cast('1997-12-31 23:59:59' as timestamp(5)) AS TIME(5) WITH TIME ZONE);

But why the time zone? how can I extract just the time with no timezone. I didn't define any timezones anywhere...

Any thoughts on this would be great

Hello!

I've a problem when inserting null value to TIMESTAMP column. I use arrays of parameters and insert two rows with one statement. I receive error when executing statement: "Invalid timestamp".

Problem occurs only when one row has value and other is null. If two has value or are null, then problem doesn't occur. There is no problems in similar situation with another data types (e.g. VARCHAR, INTEGER).

Here is my code (without error handling etc.):


SQLSetStmtAttr(hstmt, SQL_ATTR_PARAMSET_SIZE, (SQLPOINTER)2, 0);