This topic is locked

BulkLoad - Passing back field from inserted

2/22/2007 10:20:06 AM
ASPRunnerPro General questions
V
VORONOY author

I'm doing BulkUpload of XML file using "File\Image" upload function. I'm uploading XML file to the server and executing it with "AfterAdd":
Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")

objBL.ConnectionString = "provider=SQLOLEDB.1;data source=MYSERVER; Trusted_Connection=Yes"

objBL.ErrorLogFile = "c:\error.log"

objBL.Execute "c:\customermapping.xml", "E:\WEB\SCANS\"& GetRequestForm("value_scan_file") &""

Set objBL = Nothing
Everything work fine.
I'm writing an info on USER, DATE, and File_Name in LOG_TABLE and BulkLoad inserts data to the SECOND_TABLE.
The problem is, that I need to have ID from SECOND_TABLE to be inserted to LOG_TABLE and be synchronized with executed File_Name record.
The BulkLoad doesn't support any triggers etc, so I have no idea how to implement this. How to pass back parameters from SECOND_TABLE to LOG_TABLE?
Any ideas?
Aslo, a SQL question.
I have a bulkload XML files with DateTime format that is killing me:
2007-01-19-08-38-24 (Fri)
How I can create a User Defined DataType, so SQL will accept this as a normal datetime and convert it, so ASPRunner will recognize this as DATETIME?
Thanks In advance!

Sergey Kornilov admin 2/22/2007

I guess you need to run a SQL query that retrives an ID of inserted record and insert it into Log table.
In regards of dates in non-standard format you can insert it into a text field first and run a stored procedure that converts it to DATETIME value.