Universal Database Reference

Universal Database Reference

To get a safe and quick access to your database system over phone, Xtend IVR introduces a sample script which allows callers to retrieve information, add, modify and update information directly into the database.

Download the evaluation version of Xtend IVR and install the telephony application in your system. Run the sample script from the Script Editor. Click here to refer the code.

The automated attendant will work as given below:

  • Perform the database related functions like adding, deleting, editing, finding and navigating through records depending on the user choice
  • When an employee name and address is entered, IVR inserts the entry into the table using the function INSERT
  • IVR retrieves the data from the table using the function SELECT
  • Record updation is carried out through UPDATE query
  • Deletion of records can be carried out through DELETE records
Download the source file zip download for the Universal Database Reference

MAIN:
	
	bp
	
	
	
	$db = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=db2000.mdb;;User Id=admin;
								Password=;"
	
	
	
	
	$sql = format("INSERT INTO Employee (EmpName,Address) VALUES ('%s','%s')","George",
								"White House")
	$stat = db.RunSQL($db,$sql)
	if $stat = 0
		display $error
		log $error
	endif
		
	
	$sql = format("SELECT * FROM  Employee WHERE EmpName = '%s'","George")
	$alias = db.Open($db, $sql)
	if $alias
		while $alias.eof = FALSE
			display $alias.Address
			$alias = db.Skip()
			
		endwhile
		$alias = db.Close()
	endif
		
	
	$sql = format("UPDATE Employee SET EmpName = '%s' WHERE EmpName = '%s'",
							"Alexander","George")
	$stat = db.RunSQL($db,$sql)
	if $stat = 0
		display $error
		log $error
	endif
	
	
	$sql = format("DELETE FROM Employee WHERE EmpName = '%s'","Alexander")
	$stat = db.RunSQL($db,$sql)
	if $stat = 0
		display $error
		log $error
	endif
	goto MAIN
	
ONSYSTEMERROR:
	display $error
	log $error
	hangup
	goto MAIN