Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    SQL Server datetime field format
Go
New
Search
Notify
Tools
Reply
  
SQL Server datetime field format
 Login/Join
 
Member
posted
Hi,
I am trying to insert a timestamp into a datetime field on SQL Server using a stored procedure in DataMigrator. Does anybody have an example of how you format a datetime value to pass through? I have attempted this by trying to concatenate &DATE and &TOD, but I keep getting an error saying that this is in the incorrect format.

Thanks!


Prod: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Test: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Local: DevStudio 5.5.3 - Management Console
- Windows XP SP2
 
Posts: 21 | Location: Cape Town, South Africa | Registered: January 15, 2007Reply With QuoteReport This Post
Platinum Member
posted Hide Post
This works for me in Oracle:

-SET &TOD_H = EDIT(&TOD,'99');
-SET &TOD_M = EDIT(&TOD,'$$$99');
-SET &TOD_S = EDIT(&TOD,'$$$$$$99');
-SET &TOD_HMS = &TOD_H | &TOD_M | &TOD_S;
-SET &TS = &YYMD | &TOD_HMS;
-TYPE TS: &TS

SQL SQLORA
INSERT INTO OWNER.TABLENAME
(DATE_FIELD)
VALUES (TO_TIMESTAMP('&TS.EVAL','YYYYMMDDHH24MISS'))
;
END
-RUN


Data Migrator 5.3, 7.1, 7.6
WebFOCUS 7.1, 7.6, 7.7
SQL Server, Oracle, DB2
Windows
 
Posts: 126 | Registered: January 18, 2007Reply With QuoteReport This Post
Member
posted Hide Post
Ah - didn't think about splitting it up into individual elements - but good idea Smiler
I'll let you know if I find a one-liner to do this too.

Thanks!


Prod: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Test: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Local: DevStudio 5.5.3 - Management Console
- Windows XP SP2
 
Posts: 21 | Location: Cape Town, South Africa | Registered: January 15, 2007Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Darren

I was reading this "old" issue and I wondered if this works already, otherwise you might be able to let this done by the SQL proces itself.
I think you can define a default value on the database that automatically insert the datetime to the actual value unless you enter an other value.

good luck




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Reply With QuoteReport This Post
Member
posted Hide Post
If anybody needs this - I've managed to figure it out.
Darren 1 : iWay 0
Smiler

-*Create the timestamp variable in the correct format for SQL Server to use
-SET &TIME = EDIT(&TOD,'99:$99:$99')||'.000';
-TYPE &TIME

-SET &DAY = EDIT(&YYMD,'9999-99-999');
-SET &TS = &DAY||&TIME;


Prod: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Test: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Local: DevStudio 5.5.3 - Management Console
- Windows XP SP2
 
Posts: 21 | Location: Cape Town, South Africa | Registered: January 15, 2007Reply With QuoteReport This Post
Member
posted Hide Post
Darren 1: 0 iWay
Smiler

-*Create the timestamp variable in the correct format for
-*SQL Server to use
-SET &TIME = EDIT(&TOD,'99:$99:$99')||'.000';
-TYPE &TIME

-SET &DAY = EDIT(&YYMD,'9999-99-999');
-SET &TS = &DAY||&TIME;


Prod: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Test: Service Manager 5.5 - DataMigrator 7.6 - Win2K
Local: DevStudio 5.5.3 - Management Console
- Windows XP SP2
 
Posts: 21 | Location: Cape Town, South Africa | Registered: January 15, 2007Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  iWay Software Product Forum on Focal Point    SQL Server datetime field format

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.