sure. just in case ppl dont think i am spamming them, here is a brief
explanation of wat i was trying to do..

we have a scheduler. which calls a stored procedure every 15 mins. and
this SP goes thru a table in DB and updates specific fields. and also in
the process the SP opens up a .DBF file and gets the data into the DB.
these .DBF files  are placed in a particular directory. sometimes these
DBF files were not uploaded or renamed or something gone wrong..the SP
not able to find the file was halting. i mean, if its updating 100
records and it doesnt find a DBF file pertaining to 55th record..it
halts and never updates the remaining 44 records. so i was just trying
to find out if the file exists then update other wise proceed further
(i.e nothing but to go to another record in the cursor)

here is the code which worked for me...

        declare @tresult int
        declare @tempstr varchar(255)
        set @tempstr = 'dir c:\common\files\' + @path + '\sample.dbf'
        exec @tresult = master..xp_cmdshell @tempstr

        IF (@tresult = 0)
        BEGIN
           PRINT 'Success'
                INSERT INTO #sample(sam_no,status, lastquest)
                SELECT * FROM OPENQUERY(TEST,'SELECT sam_no, stat_type,
lastquest FROM sample')

                ......
        END
        ELSE
                ......
        
        

-----Original Message-----
From: Bob Silverberg [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 4:17 PM
To: CF-Talk
Subject: RE: (SQL & Stored Proc)


Great!  Mind sharing your solution with the rest of us?

Bob

-----Original Message-----
From: Akbar Pasha [mailto:[EMAIL PROTECTED]]
Sent: March 29, 2001 3:35 PM
To: CF-Talk
Subject: RE: (SQL & Stored Proc)


thanx bob. i got it using that.:)

-----Original Message-----
From: Bob Silverberg [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 29, 2001 3:27 PM
To: CF-Talk
Subject: RE: (SQL & Stored Proc)


I haven't done that, but I'd start by looking at xp_cmdshell - you might
be
able to do something with that and the DIR command.

As for a good mailing list, check out www.swynk.com.

Bob

-----Original Message-----
From: Akbar Pasha [mailto:[EMAIL PROTECTED]]
Sent: March 29, 2001 2:56 PM
To: CF-Talk
Subject: OT:(SQL & Stored Proc)


hi all,

i am sorry to ask SQL question in CF list, but i am not aware of any
good SQL mail list. so here i am...

is there a way to check the existence of file using SQL?? i mean some
SQL function or some kind of query format which will tell me whether the
passed file name exists on the computer or not? i need this
functionality in a stored proc i am using. and also if someone can
kindly point me to any good SQL mail list, it woul help me a lot.

thanx in advance.

akbar
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to