Solved

stored procedure code

Posted on 2000-04-21
2
183 Views
Last Modified: 2008-02-26
This may be more visual basic than sql server but anyhow, these are steps i take from a DOS prompt.

C:\>ftp sail
Connected to sail.xxxxxx.edu.
220-FTPSRVHD IBM MVS V3R2 at cpslo.its.xxxxxxy.edu, 09:12:51 on 2000/04/21
220 Connection will close if idle for more than 5 minutes.
User (sail.xxxxx.edu:(none)): master
331 Send password please.
Password:
230 master is logged on.  Working directory is "master.".
ftp> quote site filetype=jes
200 Site command was accepted
ftp> put pcjcl
200 Port request OK.
125 Sending Job to JES Internal Reader FIXrecfm 80
250-It is known to JES as JOB08814
250 Transfer completed successfully.
366 bytes sent in 0.00 seconds (366000.00 Kbytes/sec)
ftp> quit
221 Quit command received. Goodbye.

C:\>
I would like to have a stored procedure that would do the ftp and put the
line that says 'it is known to jes as job08814'  into some little table.
I'm using 6.5


 
0
Comment
Question by:xoxomos
2 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2740927
I think you need a small script (shell script/perl or similar) that can execute all your input operations.
Then, in SQL, you may insert the whole output into a table using
INSERT INTO YouTable EXEC xp_cmdshell  "Your Dos Command to launch the Script"
After this, you can query you table to find the rows that are interesting.
Unfortunately, i don't know what script you need to use, i only know that it is possible to do (seeing our Network Adminstrators having things like that)

Good luck
0
 
LVL 7

Accepted Solution

by:
simonsabin earned 50 total points
ID: 2743030
put your commands into a file and then run ftp with

ftp -s:<filename>

and as angelIII said use someting like

CREATE TABLE #TMP (output varchar(255))

INSERT INTO #TMP EXEC xp_cmdshell 'ftp -s:MYFtpFile.txt'

INSERT INTO MyJobTable
SELECT output
 FROM #TMP
WHERE output LIKE '%It is known%'

DROP TABLE #TMP



The MyFtpFile.txt should loook like

open sail <password>
quote site filetype=jes
put pcjcl
quit

You will need to secure this file to stop people finding the password.


0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question