Comments are available to members only. Sign up or Log in to view these comments.
Main Topics
Browse All TopicsI would like to write a simple stored procedure that will delete the contents of a table and then run a SQL query to put updated data into the same table. I will then use this table for a Crystal Report that I am creating. I would then want to schedule the stored proc to run when needed. I have an example of the same kind of stored proc that I wrote in SQL Server. The gist of it is this:
ALTER PROCEDURE USP_UPDATETABLE
AS
TRUNCATE TABLE CUSTORDERS
INSERT CUSTORDERS(CUSTID,FNAME, LNAME, ORDERNUMB, ORDERAMNT, ORDERDATE)
SELECT
A.CUSTID,
FNAME,
LNAME,
ORDERNUMB,
ORDERAMNT,
ODERDATE
FROM CUSTOMER A JOIN ORDERS B ON
A.CUSTID = B.CUSTID
ORDER BY
A.CUSTID
I could do this on our SQL Server machine but I'd really like to put it on our iSeries server. I've read about creating a SQL stored proc in the RedBook that covers this but I am still new enough that I'm not really grasping what I need to do. How do I write the above in the right format for the iSeries? Any help would be appreciated.
Thanks,
H
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: KdoPosted on 2005-01-13 at 13:37:28ID: 13038872
Comments are available to members only. Sign up or Log in to view these comments.