473,386 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Trouble with Informix datatypes

Hi everybody!

I'm working on a migration from Informix to SQL Server... I'm doing it
through DTS and ODBC.
What I'm doing is using the DTS, my data origin is tha Informix
database and mi target is the SQL Server database that I just created,
this is via IBM Informix ODBC and I copy the tables... but the results
are something like this:
--INFORMIX--
create table r_cap_dbt_uni
(
num_db smallint ,
cve_uni char (8) ,
fecha_mens datetime YEAR to MONTH ,
valor float ,
primary key ( num_db, cve_uni, fecha_mens ) ,
foreign key ( num_db )
references cat_db_tec ( num_db )
);
-- SQL SERVER --
create table r_cap_dbt_uni
(
num_db smallint ,
cve_uni char (8) ,
***********************************************
fecha_mens smalldatetime ,
valor float ,
***********************************************
primary key ( num_db, cve_uni, fecha_mens ) ,
foreign key ( num_db )
references cat_db_tec ( num_db )
);
as you can see the float and datetime year to month data types change
like the example before.... I changed the "float" datatype manually to
"decimal" datatype... but I don't know what to do with the "datetime
year to month" Informix datatype, I mean, I dn't know why the DTS
changes this datatype to "smalldatetime"... how can I map this? what's
the process?
Thank you very much!
Rodolfo

Oct 31 '06 #1
3 4265
as you can see the float and datetime year to month data types change
like the example before.... I changed the "float" datatype manually to
"decimal" datatype... but I don't know what to do with the "datetime
year to month" Informix datatype, I mean, I dn't know why the DTS
changes this datatype to "smalldatetime"... how can I map this? what's
the process?
Well, there is no "datetime YEAR to MONTH" datatype in MS SQL Server,
so what I can suggest is that you use the datetime data type. As for
the formatting, this does not get stored in SQL Server, but you'll need
to do the formatting when you retrieve the data.

Hope this helps

Louis

Nov 2 '06 #2
>but I don't know what to do with the "datetime year to month" Informix datatype, I mean, I dn't know why the DTS changes this datatype to "smalldatetime". <<

SQL Server only has waht woudl be a TIMESTAMP in Standard SQL. I would
consider using a pair of DATETIME columns (start of month, end of
month) to mimic the Informix type.

Nov 2 '06 #3
The problem is that SQL Server datetime and smalldatetime will hold the day
and time which is not what you are after (I think).

If you just want to store year and month then you can use integer instead
and store it 200611 for instance; however, you won't be able to use date
functions on it like DATEDIFF etc... So, you need to way the pro's and con's
up; if you do store it in a datetime then you need set it to the first day
of the month and midnight - 200611 would become 20061101 00:00:00.000 for
datetime.

HTH

--
Tony Rogerson
SQL Server MVP
http://sqlblogcasts.com/blogs/tonyrogerson - technical commentary from a SQL
Server Consultant
http://sqlserverfaq.com - free video tutorials
"Rodolfo" <lo*******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi everybody!

I'm working on a migration from Informix to SQL Server... I'm doing it
through DTS and ODBC.
What I'm doing is using the DTS, my data origin is tha Informix
database and mi target is the SQL Server database that I just created,
this is via IBM Informix ODBC and I copy the tables... but the results
are something like this:
--INFORMIX--
create table r_cap_dbt_uni
(
num_db smallint ,
cve_uni char (8) ,
fecha_mens datetime YEAR to MONTH ,
valor float ,
primary key ( num_db, cve_uni, fecha_mens ) ,
foreign key ( num_db )
references cat_db_tec ( num_db )
);
-- SQL SERVER --
create table r_cap_dbt_uni
(
num_db smallint ,
cve_uni char (8) ,
***********************************************
fecha_mens smalldatetime ,
valor float ,
***********************************************
primary key ( num_db, cve_uni, fecha_mens ) ,
foreign key ( num_db )
references cat_db_tec ( num_db )
);
as you can see the float and datetime year to month data types change
like the example before.... I changed the "float" datatype manually to
"decimal" datatype... but I don't know what to do with the "datetime
year to month" Informix datatype, I mean, I dn't know why the DTS
changes this datatype to "smalldatetime"... how can I map this? what's
the process?
Thank you very much!
Rodolfo

Nov 2 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: John Bentley | last post by:
John Bentley: INTRO The phrase "decimal number" within a programming context is ambiguous. It could refer to the decimal datatype or the related but separate concept of a generic decimal number....
3
by: Christian Eriksson | last post by:
Hi! I'm programming Perl DBI accessing Informix databases. I have a problem on a Solaris machine to use my installed Informix driver (DBD::Informix). I get the following error message: ...
3
by: Lee | last post by:
Hi, I'm developing a socket program to connect to Informix database through the ODBC. In here i called my socket program as "tap" . My tap will listen for data from unix through port 1070. After...
10
by: Joachim Banzhaf | last post by:
Hi, Creating the federated datasource library for informix fails for me. The db2 server is version 8.1 WSE on AIX 4.3. The informix client on this server is version CSDK 2.81/ESQL 9.53 UC2....
0
by: vishalp79 | last post by:
Hi, I am trying to install DBD::Informix module on perl on hpux 11.23 machine. but i get this weird error ...... Set up gcc environment - 4.1.1 *** ExtUtils::AutoInstall version 0.61 ***...
0
by: Lester Knutsen | last post by:
A two-day IBM Informix and DB2 User Group Technical Conference - Friday and Saturday, December 8-9, 2006 We are very please to announce our Keynote Speakers...
14
by: Khan | last post by:
Hello, I want to connect my intranet server (with php/apache) to the other informix database server, But I didnt it. I dont know how i can do it? Can i use php_informix extensions for example...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.