Oracle Magazine, May/June 2018
Database Developer OPEN SOURCE ORACLE MAGAZINE MAY JUNE 2018 86 cur execute statement name person_ name res cur fetchall print res This will return only the data for Kim 2 Kim 27 I like birds Heres what the code does 1 Gets a cursor object from the connection You will use this cursor to perform your database operations 2 Assigns Kim to person_ name 3 Prepares a SQL statement using a bind variable 4 With the cursor executes the query by using the prepared statement 5 Fetches the results from the cursor into a variable 6 Prints the results ANOTHER DEEPER DIVE Now modify the previous statement and variable to retrieve people older than 30 When youre done the results should be 1 Bob 35 I like dogs What does the successful code look like Heres the answer
You must have JavaScript enabled to view digital editions.