SmartsIntegrator Support and Discussion Forums

Database Transport Query

Share/Bookmark: Add this Thread to Digg Digg   Add this Thread to StumbleUpon Stumble Upon   Add this Thread to Del.icio.us Del.icio.us   Add this Thread to Reddit Reddit   Add this Thread to Facebook Facebook
RE: Database Transport Query
by benj on Tue, Jul 8 2008 10:28 PM
Thanks Ben, I went the uninstall/reinstall route and now the email functionality is working correctly.

Please find attached the Log files from the FTP ports. Let me know if you need more information.

Regards,
P
Ben Jackson
SmartsIntegrator Technical Support
benj
benj
Joined: Thu, Feb 7 2008
Posts: 96
RE: Database Transport Query
by benj on Tue, Jul 8 2008 6:30 PM
That looks good and works at this end. I think we have some kind of issue relating to updating of DLLs, which would explain why the extra trace didn’t appear and you are still getting this problem. This is probably because I forgot to ask you to stop and restart the servers, and also SmartsIntegratorDal.dll needs to go in the GAC. I think the easiest fix for this is for you to uninstall SmartsIntegrator and then reinstall it from http://www.smartsintegrator.com/download.aspx, if you are happy to do so. You won’t lose any data in this process.

Alternatively, if you’d rather fix things up manually, please update the attached DLLs in your installation folder. You will also need to update SmartsIntegratorDAL.dll in the GAC, by dragging it into C:\Windows\Assembly or executing GACUTIL.EXE /i SmartsIntegratorDAL.dll (GACUTIL.EXE is in the .Net Framework directory, or just search for it on your machine). And then I’d recommend a reboot or at least stopping and starting all SmartsIntegrator services. [If this GAC stuff makes no sense to you, go for the uninstall and reinstall option instead!]

In this latest build / update, the extra FTP trace is now set up via a registry entry. Please launch regedit.exe, and navigate to HKEY_LOCAL_MACHINE/Software/SmartsIntegrator. Right click in the right hand pane, and select New String Value. Name the string value FTPLogFile2, and set its’ value to be the full path to a file on your machine, to which the SmartsIntegrator service running your FTP receive port has write access. This will contain the extra FTP trace.

Once our builds are synchronized, I believe the Database problem will go away, and the extra trace will help us nail the FTP issue.

Thanks,

Ben.
Ben Jackson
SmartsIntegrator Technical Support
benj
benj
Joined: Thu, Feb 7 2008
Posts: 96
RE: Database Transport Query
by portedquery on Tue, Jul 8 2008 6:29 PM
Thank you for your email.

I have the same syntax as you specified in your email; and it works for simple (non formatted) email messages however, it doesn’t work when the Email Body doesn’t contain “single quote” or any special character. That’s the reason I asked, if you have a provision to encode the data.

I am using the following table structure:

ID int
Sender nvarchar(50)
Subject nvarchar(50)
Body nvarchar(MAX)

And the following email:

Subject: Test Email extraction ‘hello’

Body:
/*
________________________________________
From: Gupta, Pranav
Sent: Monday, July 07, 2008 4:20 PM
To: 'ACTTest@dsny.nyc.gov'
Subject: RE: Test Email to POP3 Account
________________________________________
From: Gupta, Pranav
Sent: Monday, July 07, 2008 3:04 PM
To: 'ACTTest@dsny.nyc.gov'
Subject: Test Email to POP3 Account

Test Email to POP3 Account
*/

Let me know if you are able to set a port to extract the message.
portedquery
Joined: Wed, Jul 2 2008
Posts: 72
RE: Database Transport Query
by benj on Tue, Jul 8 2008 12:15 PM
Hi again P

I’ve just tested this, and it seems to work fine.

If the properties you are reading to are called FROM, SUBJECT and BODY, and you have a database table called emailDetail containing columns MessageId, EmailFrom, EmailSubject, EmailBody, you should be able to write the following Update SQL :

INSERT INTO emailDetail (MessageId, EmailFrom, EmailSubject, EmailBody) VALUES (‘%MessageID%’,’%FROM%’,’%SUBJECT%’,’%BODY%’)

Note the single quote marks to delimit the token content as a SQL string. Note also that this is best done with the SmartsIntegratorDAL.dll I just sent to you (or the latest download), which contains improved error handling if something is wrong. The latest download also contains improved help.

Let me know how you get on – otherwise if you can send me a database backup or outline the database structure I’ll be happy to set the port up for you and mail you over the export data.

Thanks,

Ben.
Ben Jackson
SmartsIntegrator Technical Support
benj
benj
Joined: Thu, Feb 7 2008
Posts: 96
RE: Database Transport Query
by portedquery on Tue, Jul 8 2008 12:14 PM
I was able to isolate the message. The SQL doesn’t like Email Message Body data; do you have any way to encode the data? Let me know
Attaching the message for your reference.

Call Stack
/*
Suspending Message for Send Port SQLRouting

MessagingException, Error in Send Port Message Processing for Send Port 'SQLRouting' : --> Incorrect syntax near 'ACTTest@dsny'. <- System.Data.SqlClient.SqlException: Incorrect syntax near 'ACTTest@dsny'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at SmartsIntegrator.DAL.SQLServerDAL.Ex
*/

Thanks and regards,

P
portedquery
Joined: Wed, Jul 2 2008
Posts: 72
Database Transport Query
by portedquery on Tue, Jul 8 2008 12:13 PM
Hi,

I am working on another prototype to extract the data from an Email into a database. I am able to configure the receive port however I am getting the following error while extracting the “from”, “subject” and the “body” fields.

“MessagingException, Error in Send Port Message Processing for Send Port 'SQLRouting' : --> Incorrect syntax near 'd926a'.”

Also find attached the Configuration of the Send port.

Do you have an example configuration to achieve the same? Let me know.

Thanks and regards,

P
portedquery
Joined: Wed, Jul 2 2008
Posts: 72