From 84ee1301bc5f2fd341ecc1a3ce0f6c255789d44c Mon Sep 17 00:00:00 2001 From: Anthony Tuininga Date: Fri, 18 May 2018 14:23:54 -0600 Subject: [PATCH] Adjust data values to clarify distinction between "parent" and "child" values. --- samples/ArrayDMLRowCounts.py | 4 ++-- samples/BatchErrors.py | 18 ++++++++-------- samples/Subclassing.py | 4 ++-- samples/sql/SetupSamples.sql | 42 ++++++++++++++++++------------------ 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/samples/ArrayDMLRowCounts.py b/samples/ArrayDMLRowCounts.py index ecbcce8..7885b44 100644 --- a/samples/ArrayDMLRowCounts.py +++ b/samples/ArrayDMLRowCounts.py @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# Copyright 2016, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright 2016, 2018, Oracle and/or its affiliates. All rights reserved. #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ @@ -32,7 +32,7 @@ for parentId, count in cursor.execute(""" print() # delete the following parent IDs only -parentIdsToDelete = [2, 3, 5] +parentIdsToDelete = [20, 30, 50] print("Deleting Parent IDs:", parentIdsToDelete) print() diff --git a/samples/BatchErrors.py b/samples/BatchErrors.py index e0bca48..c3e32bf 100644 --- a/samples/BatchErrors.py +++ b/samples/BatchErrors.py @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# Copyright 2016, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright 2016, 2018, Oracle and/or its affiliates. All rights reserved. #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ @@ -25,14 +25,14 @@ cursor = connection.cursor() # define data to insert dataToInsert = [ - (1016, 1, 'Child 2 of Parent 1'), - (1017, 1, 'Child 3 of Parent 1'), - (1018, 2, 'Child 4 of Parent 2'), - (1018, 2, 'Child 4 of Parent 2'), # duplicate key - (1019, 3, 'Child 3 of Parent 3'), - (1020, 3, 'Child 4 of Parent 4'), - (1021, 6, 'Child 1 of Parent 6'), # parent does not exist - (1022, 4, 'Child 6 of Parent 4'), + (1016, 10, 'Child B of Parent 10'), + (1017, 10, 'Child C of Parent 10'), + (1018, 20, 'Child D of Parent 20'), + (1018, 20, 'Child D of Parent 20'), # duplicate key + (1019, 30, 'Child C of Parent 30'), + (1020, 30, 'Child D of Parent 40'), + (1021, 60, 'Child A of Parent 60'), # parent does not exist + (1022, 40, 'Child F of Parent 40'), ] # retrieve the number of rows in the table diff --git a/samples/Subclassing.py b/samples/Subclassing.py index 5f9ff3f..60f6234 100644 --- a/samples/Subclassing.py +++ b/samples/Subclassing.py @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# Copyright 2016, 2017, Oracle and/or its affiliates. All rights reserved. +# Copyright 2016, 2018, Oracle and/or its affiliates. All rights reserved. #------------------------------------------------------------------------------ #------------------------------------------------------------------------------ @@ -50,7 +50,7 @@ connection = Connection() cursor = connection.cursor() # demonstrate that the subclassed connection and cursor are being used -cursor.execute("select count(*) from ChildTable where ParentId = :1", (3,)) +cursor.execute("select count(*) from ChildTable where ParentId = :1", (30,)) count, = cursor.fetchone() print("COUNT:", int(count)) diff --git a/samples/sql/SetupSamples.sql b/samples/sql/SetupSamples.sql index ea373c2..e1fd11f 100644 --- a/samples/sql/SetupSamples.sql +++ b/samples/sql/SetupSamples.sql @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------- - * Copyright 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright 2017, 2018, Oracle and/or its affiliates. All rights reserved. *---------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------- @@ -202,27 +202,27 @@ begin end; / -insert into &main_user..ParentTable values (1, 'Parent 1'); -insert into &main_user..ParentTable values (2, 'Parent 2'); -insert into &main_user..ParentTable values (3, 'Parent 3'); -insert into &main_user..ParentTable values (4, 'Parent 4'); -insert into &main_user..ParentTable values (5, 'Parent 5'); +insert into &main_user..ParentTable values (10, 'Parent 10'); +insert into &main_user..ParentTable values (20, 'Parent 20'); +insert into &main_user..ParentTable values (30, 'Parent 30'); +insert into &main_user..ParentTable values (40, 'Parent 40'); +insert into &main_user..ParentTable values (50, 'Parent 50'); -insert into &main_user..ChildTable values (1001, 1, 'Child 1 of Parent 1'); -insert into &main_user..ChildTable values (1002, 2, 'Child 1 of Parent 2'); -insert into &main_user..ChildTable values (1003, 2, 'Child 2 of Parent 2'); -insert into &main_user..ChildTable values (1004, 2, 'Child 3 of Parent 2'); -insert into &main_user..ChildTable values (1005, 3, 'Child 1 of Parent 3'); -insert into &main_user..ChildTable values (1006, 3, 'Child 2 of Parent 3'); -insert into &main_user..ChildTable values (1007, 4, 'Child 1 of Parent 4'); -insert into &main_user..ChildTable values (1008, 4, 'Child 2 of Parent 4'); -insert into &main_user..ChildTable values (1009, 4, 'Child 3 of Parent 4'); -insert into &main_user..ChildTable values (1010, 4, 'Child 4 of Parent 4'); -insert into &main_user..ChildTable values (1011, 4, 'Child 5 of Parent 4'); -insert into &main_user..ChildTable values (1012, 5, 'Child 1 of Parent 5'); -insert into &main_user..ChildTable values (1013, 5, 'Child 2 of Parent 5'); -insert into &main_user..ChildTable values (1014, 5, 'Child 3 of Parent 5'); -insert into &main_user..ChildTable values (1015, 5, 'Child 4 of Parent 5'); +insert into &main_user..ChildTable values (1001, 10, 'Child A of Parent 10'); +insert into &main_user..ChildTable values (1002, 20, 'Child A of Parent 20'); +insert into &main_user..ChildTable values (1003, 20, 'Child B of Parent 20'); +insert into &main_user..ChildTable values (1004, 20, 'Child C of Parent 20'); +insert into &main_user..ChildTable values (1005, 30, 'Child A of Parent 30'); +insert into &main_user..ChildTable values (1006, 30, 'Child B of Parent 30'); +insert into &main_user..ChildTable values (1007, 40, 'Child A of Parent 40'); +insert into &main_user..ChildTable values (1008, 40, 'Child B of Parent 40'); +insert into &main_user..ChildTable values (1009, 40, 'Child C of Parent 40'); +insert into &main_user..ChildTable values (1010, 40, 'Child D of Parent 40'); +insert into &main_user..ChildTable values (1011, 40, 'Child E of Parent 40'); +insert into &main_user..ChildTable values (1012, 50, 'Child A of Parent 50'); +insert into &main_user..ChildTable values (1013, 50, 'Child B of Parent 50'); +insert into &main_user..ChildTable values (1014, 50, 'Child C of Parent 50'); +insert into &main_user..ChildTable values (1015, 50, 'Child D of Parent 50'); insert into &main_user..SampleQueryTab values (1, 'Anthony'); insert into &main_user..SampleQueryTab values (2, 'Barbie');