August 1999
Intermediate to advanced
1488 pages
72h 53m
English
database.cursor(sql) database.cursor(sql, boolean)
The cursor() method of the database object creates a Cursor object that can be used to run SQL queries against the database. The method takes the SQL statement as a parameter, as well as an optional Boolean value that specifies if the cursor is updateable.
Listing 8.42 shows how you would run a query against the database using the cursor() method. The while loop is used to write the results to the user's page.
<SERVER> // Set the query to run var mySQL = myConn.cursor('SELECT name,title FROM employees'); // Iterate through the results and write them to the page. while(mySQL.next()){ ... |
Read now
Unlock full access