Possible for SQL update to Notes?

Is it possible to use some functionality on SQL server to update a Notes database?

Subject: Possible for SQL update to Notes?

Yes, you can use the NotesSQL ODBC driver to do an insert to a Notes database.

Subject: RE: Possible for SQL update to Notes?

Yes, I’m aware I can write custom script to do updates to Notes. But I am more interested in using SQL Server’s stored procedures to doing to actual updates. Like how would I pass parameters the stored procedures.

Subject: RE: Possible for SQL update to Notes?

To execute a store procedure with parameters, you would do something like this:

'execute stored procudure

	qry.SQL = {GetConfirmedLoads ?DateToday?}

	Set res.Query = qry

	Call res.SetParameter(1, {'} & Format$(Today, "mm/dd/yyyy") & {'})

	res.Execute              'execute SQL statement

where qry is your ODBCQuery object and res is the ODBCResultSet. “GetConfirmedLoads” is the name of the stored procedure and it is being passed today’s date.

hope that helps.

Subject: RE: Possible for SQL update to Notes?

How do I get the field values retrieved from SQL stored procedure. I would like to create a new Notes document and assign SQL’s field values to Notes fields.

Subject: RE: Possible for SQL update to Notes?

The data returned from a stored procedure is just like that from a standard SELECT query. Cycle through the result set as you normally would and use the res.GetValue (or comparable) method to get the value into Notes.

Hope that helps.

Subject: RE: Possible for SQL update to Notes?

Thank you very much that works perfectly!