• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

OCP Java SE 11 Programmer II Study Guide (Sybex 816) Possible Errata Chapter 10 (JDBC)

 
Ranch Foreman
Posts: 21
3
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
TABLE 10.6 Sample stored procedures

In the read_e_names()'s description is written: Returns all rows in the names table that have a name beginning with an E
In fact it returns all the names, not only the ones, starting with E.

If we take look at:
https://www.selikoff.net/2019/12/22/ocp-11-book-bonus-creating-a-hsql-database-stored-procedure-in-java-11/

We see: String noParams = "CREATE PROCEDURE read_e_names() "
                   + "READS SQL DATA DYNAMIC RESULT SETS 1 "
                   + "BEGIN ATOMIC "
                   + "DECLARE result CURSOR WITH RETURN FOR SELECT * FROM names; "
                   + "OPEN result; "
                   + "END";

There is not a WHERE clause for the query.

The testing code I used to verify this behaviour is:



It prints:
Elsa
Zelda
Ester
Eddie
Zoe

Instead of:
Elsa
Ester
Eddie
 
author & internet detective
Posts: 40685
827
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ooh. Have a cow!

I've edited the selikoff.net post. Webpages are nice because they are easy to change.

I didn't run my edit, but hopefully it was simple enough to avoid stupid typos!
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic