Solved

stored procedure code

Posted on 2000-04-21
2
184 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

710 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