I have a table in oracle server and I am trying to move the data in a sql table, I created a linked server which works fine, when I try to move the data by specifying the where clause, it does not select the data only specified in the where clause. I use the following query. when I tried to only get order with the Calendar year 2021. below is the table I would like to query in oracle.
SELECT *
FROM OPENQUERY (Linkedserver_A,
‘select*
from inventory.products B where Calendar_year = 2021’)
Order_Key | Order_Type | Trans_Type | Trans_Date | Calendar_year
1 | 13216584 | M001 | P | 2019 |
2 | 13216584 | M001 | R1 | 2019 |
3 | 13216584 | M001 | R2 | 2019 |
4 | 13216584 | M001 | D | 2021 |
5 | 76983231 | M002 | P | 2018 |
6 | 76983231 | M002 | R1 | 2018 |
7 | 76983231 | M002 | R2 | 2018 |
8 | 76983231 | M002 | D | 2019 |
9 | 93216548 | M003 | P | 2021 |
10 | 93216548 | M003 | R1 | 2021 |
11 | 93216548 | M003 | R2 | 2021 |
12 | 93216548 | M003 | D | 2022 |
This is what I did
I did the following query to get all the data for calendar_year 2021
SELECT *
FROM OPENQUERY (Linkedserver_A,
‘select*
from inventory.products B where Calendar_year = 2021’)