Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Extract in insert
Thu, Aug 28 2008 3:53 AMPermanent Link

Denis Gottardello
I have a timestamp DateTime value.
I must insert it in a table with 3 Integer columns

year: Integer, month: Integer, Day: Integer (3 colums)

Can I do

insert into MyTable (Year, Month, Day) values (exctract (year from :PDateTime), exctract
(month from :PDateTime)), exctract (day from :PDateTime))
Thu, Aug 28 2008 7:29 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Denis,

> Can I do
>

Apart from some typos, yes.
Here it is with the correct syntax:

insert into MyTable (Year, Month, Day)
values(
extract(year from :PDateTime),
extract(month from :PDateTime),
extract (day from :PDateTime)
)

I'm assuming you are using this statement in a TDBISAMQuery component,
PDateTime is an ftDateTime parameter and you want to insert one single
row each time you execute the query.

--
Fernando Dias
[Team Elevate]
Image