473,327 Members | 1,892 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,327 software developers and data experts.

Openquery & Local Table

I'm trying to import certain data into a SQL table from an AS400 table. The info I need is order #, a flag that changes, and the current date. When the flag is set to 'Y' on the AS400 on this table, it needs to get imported into the SQL table. Once the flag is changed on the AS400 to an 'N' or blank, it needs to be updated again. This time, the currentdate will be imported into a different column. I want to be able to keep track of how long it stays marked 'Y'.
My thinking is I need to create a table that contains Order #, Flag, Orig. Hold Date (Y), and Release Date (N).
The Stored Procedure would have to:
Grab all orders that are flagged 'Y' in the AS400 and do not exists in the SQL table.
Then grab all orders in the SQL table and find out if there are any orders on the AS400 that are flagged back to 'N'.
I would also like to delete any orders on the SQL table that have a Release Date greater than 30 days.
Any help would be great apprciated.
Thanks,
Greg
Jun 5 '07 #1
0 1185

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Phil Sandler | last post by:
Hello, Quick, and possibly strange, question. I am doing some work testing the running time of some dynamic SQL statements on a remote machine. What I would like to do is execute the SQL on...
2
by: addi | last post by:
All, Can someone help me with the following SQL and help me write it in an OPENQUERY format. I am running the following code from a SQL Server 7 box, trying to update a table in an Oracle Linked...
2
by: Evgeny Gopengauz | last post by:
I created a stored procedure like this: CREATE PROCEDURE SP AS BEGIN CREATE TABLE #T( C INT ) INSERT INTO #T(C) VALUES (1) SELECT * FROM #T END
2
by: Chris | last post by:
In SQL Server 2000 I have set up an Oracle linked server. When I run the following query it runs fine:- SELECT * FROM OPENQUERY(LINKEDSERVERNAME,'SELECT * FROM ORACLETABLENAME') However...
3
by: jj | last post by:
I've got a form button that fires off 3 queries but if the first query returns an error, I don't want the other two queries to happen. Example: first query runs an insert from a linked table but...
5
by: alingsjtu | last post by:
Hello, every body. When execute dynamic generated multiple OPENQUERY statements (which linkes to DB2) in SQLServer, I always got SQL1040N The maximum number of applications is already connected...
1
by: rshivaraman | last post by:
Hi All I am updating a local table based on inner join between local table and remote table. Update LocalTable SET Field1 = B.Field1 FROM LinkedServer.dbname.dbo.RemoteTable B INNER JOIN...
6
by: dimitris.papastamos | last post by:
Hello everyone, I've been working on a simple editor myself and I seem to be having some problems with ncurses or so. I have been debugging this program quite a lot trying to detect where the bug...
10
by: teddysnips | last post by:
My clients have asked me to maintain a database that was developed in- house. It's pretty good, considering the developer isn't a "programmer". The first thing they want me to do is to split it...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.