I have sucessfully created an SQL SERVER LINKED SERVER to point to DB2
on Z/OS.
I have been successully able to copy most of the tables in the
database. However, I have a couple that have a dates outside of SQL
Server supported range.
IBMDADB2 at 8.1 FIXPAK 10.
I can run the OPENQUERY() component on the mainframe and it works fine
except when using CASE. I can CAST various datatypes fine (From
TIMESTAMP to CHAR(26) for instance)
TRUNCATE TABLE METER_PT
INSERT INTO METER_PT
SELECT KY_PREM_NO, KY_SPT, KY_MPT_NO, KY_MTR_EQUIP_NO,
CD_MTR_EQUIP_MFGR,DT_EFF, CD_MTR_STAT, CD_MPT_STAT, CD_STAT,
CD_MPT_USE, QY_MTR_MULT, QY_NO_OF_DIAL
FROM OPENQUERY(HOST,'
SELECT KY_PREM_NO, KY_SPT, KY_MPT_NO, KY_MTR_EQUIP_NO,
CD_MTR_EQUIP_MFGR,
CASE WHEN DT_EFF < '1800-01-01' THEN NULL ELSE DT_EFF END DT_EFF,
CD_MTR_STAT, CD_MPT_STAT, CD_STAT,
CD_MPT_USE, QY_MTR_MULT, QY_NO_OF_DIAL
FROM DB2X.XXXXX.METER_PT
')
GO 1 2272
CASE WHEN DT_EFF < '1800-01-01' THEN NULL
should have been
CASE WHEN DT_EFF < ''1800-01-01'' THEN NULL
Its all good!
JAW wrote:
I have sucessfully created an SQL SERVER LINKED SERVER to point to DB2
on Z/OS.
I have been successully able to copy most of the tables in the
database. However, I have a couple that have a dates outside of SQL
Server supported range.
IBMDADB2 at 8.1 FIXPAK 10.
I can run the OPENQUERY() component on the mainframe and it works fine
except when using CASE. I can CAST various datatypes fine (From
TIMESTAMP to CHAR(26) for instance)
TRUNCATE TABLE METER_PT
INSERT INTO METER_PT
SELECT KY_PREM_NO, KY_SPT, KY_MPT_NO, KY_MTR_EQUIP_NO,
CD_MTR_EQUIP_MFGR,DT_EFF, CD_MTR_STAT, CD_MPT_STAT, CD_STAT,
CD_MPT_USE, QY_MTR_MULT, QY_NO_OF_DIAL
FROM OPENQUERY(HOST,'
SELECT KY_PREM_NO, KY_SPT, KY_MPT_NO, KY_MTR_EQUIP_NO,
CD_MTR_EQUIP_MFGR,
CASE WHEN DT_EFF < '1800-01-01' THEN NULL ELSE DT_EFF END DT_EFF,
CD_MTR_STAT, CD_MPT_STAT, CD_STAT,
CD_MPT_USE, QY_MTR_MULT, QY_NO_OF_DIAL
FROM DB2X.XXXXX.METER_PT
')
GO
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Tzanko |
last post by:
Hi,
We are using ADO with the Otacle Provider for OLEDB in our COM+ MTS
C++ client (Oracle 8.1.
It seems there is no way to timeout our ORACLE SQL calls, in case the
database is verry slow for...
|
by: Chris Thunell |
last post by:
I have a program where i connect to an access database and get some
information out of it. I'm using the oledb.3.51 version, my computer
doesn't seem to have the 4.0 version, but the computer that...
|
by: Josef Schneider |
last post by:
Given: Data.oledb source, and a Data.odbc target
The oledb data is read into a dataset.
(1)
Is there an easy way to copy that dataset to the target datasource ( I
can look through the...
|
by: Parking Meters |
last post by:
Today I managed to get the OleDB provider to let me put datasets from an
as400 using sql.
Great, the provider string I used is:
Provider=IBMDA400.DataSource.1;User ID=XXXXX;Password=XXXX;Data...
|
by: Joe |
last post by:
Hi All,
I am new to using the Access DB and I need some help if someone
is able to give it to me. What I want to do is get the names of
the columns of certain tables. Not the data in the table...
|
by: Will Pittenger |
last post by:
I have a project where the backend is Access. I have learned (slowly) to
use OLEDB to access my data. However, to save changes, I need to generate a
SQL statement. This seems clunky. I am used...
|
by: Martin |
last post by:
Hi,
I currently have an application that connects to an MS ACCESS database. This
application uses an OLEDB connection string for MS ACCESS.
Now, I'd like to upsize the application so I converted...
|
by: petro |
last post by:
Hello all,
My asp.net web application works on my machine but I get the following error
on our test web server, There is only one oracle home on the test server.
Does anyone know how to resolve...
|
by: ErikJL |
last post by:
I have a simple webservice that performs a SELECT query against a database, and then an INSERT statement on the same database/table. The problem arises at the time when we create the second OleDB...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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$) {
}
...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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...
|
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: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |