cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
989
Views
0
Helpful
3
Replies

Question : Is there a way to do a Direct SQL write using AFCs

Nelson Peavy
Level 1
Level 1

We are looking to integrate a service that will pull values from an external database table. Also, we would like another service to be able to update those database table values.

We are looking to integrate a service that will pull  values from an external database table.   Also, we would like another service to be able to update those database table values.  Example.    Service for ordering a Blackberry, depending on some values selected (type, model, carrier, etc) would then be able to have a pricing structure pulled in from an external table.   We would like for the non technical people to be given access to another service, with which they could simply enter the data via submitting a requisition that would update the table with the data that the previous service would then be able to access.

I had a few thoughts:  ISF code to executing a SQL Update, a service Link Integration that would push data to an external webservice that would then update the table,  but I am specifically asking if the OOTB AFCs can be levearagted using congured datasource to write to that table instead of just read from it.

3 Replies 3

Brian Papa
Level 1
Level 1

Here is a untested thought for SQL Server.  You might be able to wrap the update code with a function and call it from a DDR via a select statement. This tricks gets around the limitation that you can't execute a stored procedure through a DDR, at least I haven't figured out how.

SELECT * FROM fn_updateMyTable (#your_form.yourupdatefield#, #your_form.yoursearchkey#) 

#yourfield# is the data that you want to update. and yoursearchkey is the row to match

Then you just write a sql function to do the update(obviously a trivial example below, probably with typos).  Updates are probably a little tricky since you need to depend on the searchkey value  matching a unique value in your table.  You might be better off doing and insert to a staging table then writing a trigger on insert

 

Create function fn_updateMyTable
(@searchkey varchar(10),
 @updatedata varchar(10)
 )
returns 
@RtnTABLE  TABLE
  (result  varchar(30)
)
as
BEGIN

  update MyTable set myfield = @updatedata where mykey = @searchkey
 
insert into @RtnTABLE  VALUES ("returnvalue")

  RETURN
END

 

 

Ant Erickson
Level 1
Level 1

Hi Nelson,

Looks like there were 2 threads created for this - I responded on the other yesterday, basically, the same as Brian!

https://supportforums.cisco.com/message/3492784#3492784

Thanks

Ant

Chris Morris
Cisco Employee
Cisco Employee
  • You could do a javascript call to some web services that were designed to do this.
  • You could create an Agent that uses the SQL Adapter to make the update and set that as one of the steps in the plan.

 

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: