// Assign the user submitted ID and area code to the client object // as properties client.uid = request.uid; client.areacode = request.areacode; // Create a pool of connections var myPool = new DbPool("ORACLE", "mySID", "myApp", "appsPWD", "myTNS"); // Open a connection from the pool. Give error if connection could // not be made. var myConn = myPool.connection('Employees', 15); if(myConn.connected()){ // Start a new SQL transaction to perform a SELECT myConn.beginTransaction(); var currRow = myConn.cursor('SELECT areacode FROM employees WHERE uid >= ' + client.uid); // For all the lines that matched, update the area code while(currRow.next()){ currRow.areacode = client.areacode; currRow.updateRow("employees"); } // Close the cursor currRow.close(); // If the connection fails, write an error message }else{ write('Error (' + myConn.majorErrorCode() + '): ' + myConn.majorErrorMessage); } // Release the connection myConn.release();