05


SELECT Skill, Skill
	 FROM Skill
	ORDER BY 1


SELECT Person, ActionDate, Item, Quantity, Rate, Amount
	FROM Ledger


SELECT	Person "Person",
	Sum(Amount) "Amount"
 FROM	Ledger
WHERE	Action IN ('Sold', 'Received')
GROUP	BY Person


SELECT	Person "Person"
	SUM(Amount) "Amount"
 FROM	Ledger
WHERE	Action IN ('Bought', 'Paid')
GROUP	BY Person
ORDER	BY 2


SELECT	Person "Person" 
	SUM(Amount) "Amount"
 FROM	Ledger
WHERE	Action IN ('Sold', 'Received')
GROUP	BY Person
ORDER	BY 2


OG.Open('SoldPie.OGD', 'Control.SoldPieChart');


OG.Close('SoldPie.OGD', 'Control.SoldPieChart');


CREATE SCHEMA AUTHORIZATION Talbot
	CREATE TABLE Customer (
		Name VARCHAR(50) PRIMARY KEY,
		Address VARCHAR(200),
		Phone VARCHAR(20))
	CREATE TABLE SatisfactionScaleItem (
		Project VARCHAR (25),
		LowAdjective VARCHAR (50),
		HighAdjective VARCHAR (50),
		PRIMARY KEY (Project, LowAdjective, HighAdjective))
	CREATE TABLE CustomerSatisfactionRating (
		Name VARCHAR(50) REFERENCES Customer,
		Project VARCHAR(25),
		LowAdjective VARCHAR (50),
		HighAdjective VARCHAR (50),
		PRIMARY KEY (Name, Project, LowAdjective, HighAdjective),
		FOREIGN KEY (Project, LowAdjective, HighAdjective)
			REFERENCES SatisfactionScaleItem (Project,
			LowAdjective, HighAdjective));


06


	SELECT select-list
	 		FROM table
		WHERE query-condition
ORDER BY order-by-list


DECLARE
	vUser varchar2(80);
	vPassword varchar2(80);
	vConnect varchar2(80);
BEGIN
	Logout;
	Logon_Screen;
	vUser := Get_Application_Property(USERNAME);
	vPassword := Get_Application_Property(PASSWORD);
	vConnect := Get_Application_Property(CONNECT_STRING);
	IF vConnect IS NOT NULL THEN
		Logon(vUser, vPassword||'@'||vConnect);
	ELSE
		Logon(vUser, vPassword);
	END IF;
END;


IF Message_Type = 'FRM' THEN
	Handle_Forms_Message(Message_Code, Message_Text);
ELSE
	Handle_Database_Message(DBMS_Error_Code, DBMS_Error_Text);
END IF;


PROCEDURE Handle_Forms_Message(pCode IN NUMBER, pText IN VARCHAR2) IS BEGIN
	IF pCode = 40404 OR pCode = 40405 THEN
		null; -- do nothing for this message
	ELSE
		Message('Forms '||To_Char(pCode)||':  '||pText);  -- format message
		Message('');  -- stack message to display alert, clear status bar
		Synchronize;  -- display message
	END IF;
END Handle_Forms_Message;


:SYSTEM.Suppress_Working := 'TRUE';


:System.Message_Level: = '5';


Enter_Query;
Go_Item ('Ledger.ActionDate');


Execute_Query;
IF :SYSTEM.MODE = 'NORMAL' THEN
Go_Item ('Ledger.ActionDate');
END IF;


:Control.vDestination := 'ActionType.Action';


IF :Control.vDestination IS NOT NULL THEN
	Go_Item(:Control.vDestination);
	:Control.vDestination := '';
END IF;


07


Show_View('Ledger');


NULL;


DECLARE
	vAlertButton NUMBER;
BEGIN  -- Initial processing
	vAlertButton := Show_Alert('Caution');
	IF vAlertButton = ALERT_BUTTON1 THEN
		NULL; -- Continue processing
	END IF;  -- do nothing for button 2
END;


PROCEDURE Show_Info_Alert(pText IN VARCHAR2) IS
	vAlertID ALERT := Find_Alert('GenericInfoAlert');
	vDummy NUMBER;
BEGIN  Set_Alert_Property(vAlertID, ALERT_MESSAGE_TEXT, pText);
	vDummy := Show_Alert(vAlertID);
END;


FUNCTION Show_Info_Alert(pText1 IN VARCHAR2, pText2 IN VARCHAR2)
		RETURN NUMBER IS
	vAlertID ALERT := Find_Alert('GenericInfoAlert');
	vMessage VARCHAR2(200);
BEGIN
	vMessage := 'The '||pText1||' is '||pText2||'.';
	Set_Alert_Property(vAlertID, ALERT_MESSAGE_TEXT, vMessage);
	RETURN Show_Alert(vAlertID);
END;


SELECT DISTINCT Action, Action
	FROM Ledger
ORDER BY 1


PROCEDURE Set_Up_List (pList in VARCHAR2, pGroup in VARCHAR2) IS
	vErrFlag NUMBER := 0;
	eListPopulationProblem exception;
BEGIN
	vErrFlag := Populate_Group(pGroup);
	if vErrFlag = 0 then
		Clear_List(pList);  -- remove anything already there
		Populate_list(pList, pGroup);
	elsif vErrFlag = 1403 THEN  -- no list elements found
		null;  -- do nothing and ignore the problem
	else
		raise eListPopulationProblem;
	end if;
EXCEPTION
	WHEN OTHERS THEN
		message('Exception:  Could not populate '||pList
			||' with query in group '||pGroup||'.');
END;


Set_Up_List('Action', 'LedgerActionGroup');


:Ledger.Amount := :Ledger.Quantity * :Ledger.Rate;


:Ledger.Quantity * :Ledger.Rate


:Ledger.ActionDate := To_Date(To_Char(:Ledger.ActionDate, MM/DD/YYYY')
	||' 12:00', 'MM/DD/YYYY HH:MI');


Disable_Item('Block', 'Previous');


Do_Key('COMMIT_FORM');


Run_Product(REPORTS, 'ledger', SYNCHRONOUS, RUNTIME, FILESYSTEM,
	'', NULL);


DECLARE
	vReturn VARCHAR2(100) := Run_Report_Object('Ledger');
BEGIN
	IF vReturn IS NOT NULL THEN
		Message('Ledger Summary Report: '||vReturn);
		Synchronize;
	END IF;
END;


IF Name_In('WORKER.NAME') = 'Adah Talbot' THEN


Copy('Adah Talbot', 'WORKER.NAME');


PROCEDURE Run_Form_Report(pReport IN VARCHAR2) IS
	vReturn VARCHAR2(100) := Run_Report_Object(pReport);
BEGIN
	IF vReturn IS NOT NULL THEN
		Message(pReport||' Report: '||vReturn);
		Synchronize;
	END IF;
END;


08


SELECT Person, ActionDate, Item, Quantity, Rate, Quantity * Rate "Amount"
FROM Ledger


SELECT Person, ActionDate, Item, Quantity, Rate
	FROM Ledger


return :Quantity * :Rate;


SELECT Name
	 FROM Person
	WHERE Lodging IS NOT NULL
	ORDER BY 1


SELECT Name, Skill, Ability
	 FROM WorkerHasSkill
	ORDER BY 1


SELECT Person, SUM (Quantity*Rate) "Total Amount"
	FROM Ledger
	GROUP BY Person


SELECT Action, Item, Quantity, QuantityType, Rate, Quantity * Rate "Amount"
	 FROM Ledger
	WHERE Person = :P_Person
	ORDER BY 1


SELECT Name
	 FROM Person
	ORDER BY 1


PROCEDURE U_1ButtonAction IS
BEGIN
		SRW.Run_Report('PersonDetail.rdf P_Perso = '||:Person ||'"');
END;


SELECT Lodging, LongName "Full Name", Manager, Address
	 FROM Lodging
	ORDER BY 1


SELECT Name, LongName, Address
	 FROM Person, Lodging
	WHERE Person.Lodging = Lodging.Lodging
	ORDER BY 1


SELECT To_Char(ActionDate, 'MM')||'-'||To_Char(ActionDate, 'Mon') "Month",
		Person, Quantity*Rate "Amount"
	 FROM Ledger l, Person p
	WHERE l.Person = p.Name AND
		p.Lodging IS NOT NULL AND
		l.Action = 'Paid' AND
		To_Char(ActionDate, 'YYYY') = '1901'


SELECT '"'||Name||'", '||Age||',"'||Lodging||'"' Output
	 FROM Person
	ORDER BY Name


"Adah Talbot", 23,"Papa King"
"Andrew Dye", 29,"Rose Hill"
"Bart Sarjeant", 22,"Cranmer"
"Blacksmith", ,""
"Boole And Jones", ,""
"Dean Foreman", ,""
"Dick Jones", 18,"Rose Hill"
"Donald Rollo", 16,"Matts"
"Dr. Carlstrom", ,""
"Edward Johnson", ,""
"Edythe Gammiere", ,""
"Elbert Talbot", 43,"Weitbrocht"
"Feed Store", ,""
"Fred Fuller", ,""
"Gary Kentgen", ,""
"General Store", ,""
"George August", ,""
"George B. McCormick", ,""
"George Oscar", 41,"Rose Hill"
"Gerhardt Kentgen", 55,"Papa King"
"Harold Schole", ,""
"Helen Brandt", 15,""
"Henry Chase", ,""
"Isaiah James", ,""
"James Cole", ,""
"Janice Talbot", ,""
"Jed Hopkins", 33,"Matts"
"John Austin", ,""
"John Pearson", 27,"Rose Hill"
"Kay And Palmer Wallbom", ,"Rose Hill"
"Lily Carlstrom", ,""
"Livery", ,""
"Manner Jewelers", ,""
"Methodist Church", ,""
"Mill", ,""
"Morris Arnold", ,""
"Palmer Wallbom", ,""
"Pat Lavay", 21,"Rose Hill"
"Peter Lawson", 25,"Cranmer"
"Phone Company", ,""
"Post Office", ,""
"Quarry", ,""
"Richard Koch And Brothers", ,"Weitbrocht"
"Robert James", ,""
"Roland Brandt", 35,"Matts"
"Sam Dye", ,""
"School", ,""
"Underwood Bros", ,""
"Verna Hardware", ,""
"Victoria Lynn", 32,"Mullers"
"Wilfred Lowell", 67,""
"William Swing", 15,"Cranmer"


09


--	⍇tB^Et@NVłB`[gEIuWFNg
	֌WĂ⍇̊esŌĂяo܂B
--	:
--		CHARTOBJ	s`[gEIuWFNg
--		QUERY		`[gEIuWFNgɊ֌WĂ⍇
--	߂l:
--		TRUE	sۊ
--		FALSE	s폜
FUNCTION OGQUERYFILTER0(chartobj IN og_object,
					query IN og_query)
					RETURN BOOLEAN IS
BEGIN

END;


SELECT To_Char(ActionDate, 'Mon-YY') "Month",
		To_Number(To_Char(ActionDate, 'MM')) "MonthNumber",
		Sum(Amount) "Amount"
	 FROM Ledger
	WHERE To_Char(ActionDate, 'YYYY') = '1901' AND
		Action = 'Sold'
	GROUP BY To_Char(ActionDate, 'Mon-YY'),
			To_Number(To_Char(ActionDate, 'MM'))
	ORDER BY 2


SELECT Action "Action", Sum(Amount) "Amount"
		FROM Ledger
	WHERE To_Char(ActionDate, 'YYYY') = '1901'
	GROUP BY Action
	ORDER BY 2 DESC


SELECT To_Number(To_Char(ActionDate, 'IW')) "Week",
			Count(*) "Count"
		FROM Ledger
	WHERE To_Char(ActionDate, 'YYYY') = '1901' AND
			Action = 'Sold'
	GROUP BY To_Number(To_Char(ActionDate, 'IW'))
	ORDER BY 2 DESC


SELECT To_Char(ActionDate, 'MM') "Month", Sum(Amount) "Amount"
		FROM Ledger
	WHERE To_Char(ActionDate, 'YYYY') = '1901' and
			Action IN('Sold', 'Received')
	GROUP BY  To_Char(ActionDate, 'MM')
	ORDER BY 1


SELECT To_Char(ActionDate, 'MM') "Month", Sum(Amount) "Amount"
		FROM Ledger
	WHERE To_Char(ActionDate, 'YYYY') = '1901' and
			Action IN('Sold', 'Received') AND
			Person = :Person
	GROUP BY  To_Char(ActionDate, 'MM')
	ORDER BY 1


--	`[gvftH[}bgEgK[łB`[gvfO[v
--	o[ɌĂяo܂B
--	i:_Ot̉_O[v̊e_j
--	:
--		ELEM	s`[gvf
--		QUERY	̃`[gɊ֌WĂ⍇B
--			⍇̌ssELEMɊ֌WĂB
--			OG_GET_xxxCELLgČݍs̗l擾B
PROCEDURE OGFORMATTRIG0(elem IN og_object,
				query IN og_query) IS
BEGIN

END;


aRect.width := 2 * OG_INCH;
aRect.height := 4 * OG_INCH;


10


GRANT <privileges> ON <table name> TO <grantee> [{, <grantee>}...]
	[WITH GRANT OPTION]


CREATE USER <user name> IDENTIFIED EXTERNALLY


CREATE USER <user name> IDENTIFIED BY <password>


CREATE OR REPLACE PACKAGE SkillPackage AS
		-- A record type with all the columns in the Skill table
	TYPE tSkill IS RECORD (
		rSkill Skill.Skill%TYPE,
		rDescription Skill.Description%TYPE);
		-- A record type with the primary key column in the Skill table
	TYPE tSkillKey IS RECORD (rSkill Skill.Skill%TYPE);
		-- A ref cursor for a set of Skill rows
	TYPE tSkillCursor IS REF CURSOR RETURN tSkill;
		-- A table type for a table of Skills
	TYPE tSkillTable IS TABLE OF tSkill INDEX BY BINARY_INTEGER;
		-- A table type for a table of primary keys;
	TYPE tSkillKeyTable IS TABLE OF tSkillKey INDEX BY BINARY_INTEGER;
		-- An exception for the row-locked error (Oracle7 error -54)
	eRowLocked EXCEPTION;
	PRAGMA EXCEPTION_INIT(eRowLocked, -54);
		-- Two query procedures, one by cursor and one by table
	PROCEDURE SelectCursor (pSkillCursor IN OUT tSkillCursor, 
	pDescription IN VARCHAR2);
	PROCEDURE SelectRows (pSkillTable IN OUT tSkillTable, 
	pDescription IN VARCHAR2);
		-- Data manipulation procedures
	PROCEDURE InsertRows (pSkillTable IN tSkillTable);
	PROCEDURE UpdateRows (pSkillTable IN tSkillTable);
	PROCEDURE DeleteRows (pKeyTable IN tSkillKeyTable);
	PROCEDURE LockRows (pKeyTable IN tSkillKeyTable);
END SkillPackage;


CREATE OR REPLACE PACKAGE BODY SkillPackage AS
		--
		-- Query by reference cursor
	PROCEDURE SelectCursor (pSkillCursor IN OUT tSkillCursor, 
	pDescription IN VARCHAR2) IS
		vDescription VARCHAR2(80) := pDescription;
	BEGIN
		IF vDescription IS NULL THEN  -- select all skills for NULL
			vDescription := '%';
		END IF;
		OPEN pSkillCursor FOR
			SELECT Skill, Description
			 FROM  Skill
			WHERE  Description LIKE vDescription
			ORDER  BY Skill;
	END SelectCursor;
		--
		-- Query into table of records
	PROCEDURE SelectRows (pSkillTable IN OUT tSkillTable, 
	pDescription IN VARCHAR2) IS
		vIndex NUMBER := 1;
		vDescription VARCHAR2(80) := Nvl(pDescription, '%');
		CURSOR cSkill IS
			SELECT Skill, Description
			 FROM  Skill
			WHERE  Description LIKE pDescription
			ORDER  BY Skill;
	BEGIN
		OPEN cSkill;
		LOOP
			FETCH cSkill INTO pSkillTable(vIndex).rSkill,
					  pSkillTable(vIndex).rDescription;
			EXIT WHEN cSkill%NOTFOUND;
			vIndex := vIndex + 1;
		END LOOP;
	END SelectRows;
		--
		-- Insert rows from a record table into database table
	PROCEDURE InsertRows (pSkillTable IN tSkillTable) IS
		vIndex NUMBER := 1;
		vCount NUMBER := pSkillTable.Count;
	BEGIN
		FOR vIndex IN 1..vCount LOOP
			INSERT INTO Skill (Skill, Description)
		VALUES (pSkillTable(vIndex).rSkill, 
		        pSkillTable(vIndex).rDescription);
		END LOOP;
	END InsertRows;
		--
		-- Update rows from a record table into database table
	PROCEDURE UpdateRows (pSkillTable IN tSkillTable) IS
		vIndex NUMBER;
		vCount NUMBER := pSkillTable.Count;
	BEGIN
		FOR vIndex IN 1..vCount LOOP
			UPDATE Skill
			SET    Description = pSkillTable(vIndex).rDescription
			WHERE  Skill = pSkillTable(vIndex).rSkill;
		END LOOP;
	END UpdateRows;
		--
		-- Delete rows from a table of keys
	PROCEDURE DeleteRows (pKeyTable IN tSkillKeyTable) IS
		vIndex NUMBER := 1;
		vCount NUMBER := pKeyTable.Count;
	BEGIN
		FOR vIndex IN 1..vCount LOOP
		DELETE FROM Skill
				WHERE Skill = pKeyTable(vIndex).rSkill;
		END LOOP;
	END DeleteRows;
		--
		-- Lock rows from a table of keys
	PROCEDURE LockRows (pKeyTable IN tSkillKeyTable) IS
		vIndex NUMBER := 1;
		vCount NUMBER := pKeyTable.Count;
		vDummy VARCHAR2(1);
	BEGIN
		FOR vIndex IN 1..vCount LOOP
			SELECT 'X'
				INTO vDummy
				 FROM Skill
				WHERE Skill = pKeyTable(vIndex).rSkill
			FOR UPDATE NOWAIT;
		END LOOP;
	END LockRows;
END SkillPackage;


GRANT EXECUTE ON SkillPackage TO HRSkillsRole;


CREATE PUBLIC SYNONYM SkillPackage FOR Talbot.SkillPackage;


CREATE USER Talbot IDENTIFIED BY GeorgeDEFAULT
	TABLESPACE LocalTables
	QUOTA 5M ON LocalTables
	PROFILE CentralAdministration;


CREATE USER Human_Resources IDENTIFIED BY FT3R$27SD;
GRANT CONNECT, RESOURCE TO Talbot;
CREATE USER Accounting IDENTIFIED BY TYB##5X$5;
GRANT CONNECT, RESOURCE TO Accounting;
CREATE USER Lodging IDENTIFIED BY M45C$BHI_9Z;
GRANT CONNECT, RESOURCE TO Lodging;


CREATE SCHEMA AUTHORIZATION Lodging
	CREATE TABLE Lodging (
		Lodging	VARCHAR(15) PRIMARY KEY,	/* short name for lodging */
		LongName	VARCHAR(40),		/* complete name */
		Manager	VARCHAR(25),		/* manager's name */
		Address	VARCHAR(30)			/* address of the lodging */);
GRANT REFERENCES ON Lodging to Human_Resources;


CREATE SCHEMA AUTHORIZATION Human_Resources
	CREATE TABLE Skill (
		Skill			VARCHAR(25) PRIMARY KEY,/* name of a capability */
		Description	VARCHAR(80)             /* description of the skill */
	)
	CREATE TABLE Person (
		Name			VARCHAR(25) PRIMARY KEY,	/* worker's name */
		Age				INTEGER,			/* age in years */
		Lodging		VARCHAR(15) REFERENCES Lodging.Lodging
	/* reference to short name of lodging */
	)
	CREATE TABLE WorkerHasSkill (
		Name			VARCHAR(25) REFERENCES Person, /* worker's name */
		Skill			VARCHAR(25) REFERENCES Skill,  /* capability name */
		Ability		VARCHAR(15),	/* how skilled is the worker?  */
		PRIMARY KEY (Name, Skill)
	);
GRANT REFERENCES ON Person TO Accounting;


CREATE SEQUENCE LedgerSequence /* sequence numbers for Ledger */;
CREATE SCHEMA AUTHORIZATION Accounting
	CREATE TABLE Ledger (
		LedgerID	INTEGER
							PRIMARY KEY, 	/* sequence number, primary key */
		ActionDate	DATE,         	/* when */
		Action	VARHAR(8),   	/* bought, sold, paid, received */
		Item		VARCHAR(30),	/* what */
		Quantity	INTEGER,	/* how many */
		QuantityType	VARCHAR(10),	/* quantity: lbs, bushels, etc. */
		Rate		NUMERIC(9,2),	/* how much per quantity type  */
		Amount	NUMERIC(9,2),	/* rate * quantity */
		Person	VARCHAR(25)
        			REFERENCES Human_Resources.Person /* who */
);


CREATE ROLE AccountingRole;
CREATE ROLE AddressRole;
CREATE ROLE HRSkillsRole;
CREATE ROLE HRPersonnelRole;


GRANT SELECT, INSERT ON Ledger TO AccountingRole;


GRANT SELECT, INSERT, UPDATE, DELETE ON Person to AccountingRole;
GRANT SELECT, INSERT, UPDATE, DELETE ON Skill to HRSkillsRole;
GRANT SELECT, INSERT, UPDATE, DELETE ON WorkerHasSkill to HRSkillsRole;
GRANT SELECT, INSERT, UPDATE, DELETE ON Person to HRPersonnelRole;


GRANT SELECT, INSERT, UPDATE, DELETE ON Lodging to AddressRole;


CREATE USER User1 IDENTIFIED BY JU8##NMY78$;
GRANT CONNECT TO User1;
GRANT AccountingRole TO User1;
GRANT SELECT ON <F102>FRM50_ENABLED_ROLES TO User1;
CREATE USER User2 IDENTIFIED BY H#17_TH$5;
GRANT CONNECT TO User2;
GRANT HRPersonnelRole TO User2;
GRANT SELECT ON FRM50_ENABLED_ROLES TO User2;


11


SELECT Person, ActionDate, Item, Quantity, Rate
			FROM Ledger
&WHERE_CLAUSE
ORDER BY Person, ActionDate


SELECT Person, ActionDate, Item, Quantity, Rate
		FROM Ledger
	WHERE Action = :ActionType
ORDER BY Person, ActionDate


	SELECT Name, Age
		FROM &PersonTable
ORDER BY Name


DECLARE
	vFormID FormModule;
BEGIN
	vFormID := Find_Form(:System.Current_Form);
	Set_Form_Property(vFormID, Current_Record_Attribute,
		:Parameter.FormatAttribute);
END;


F50RUN32 workersk USERID = talbot/george FORMATATTRIBUTE = "Windows31Attrs"


DECLARE
	vListID ParamList := 
		Get_Parameter_list('WorkerSkillFormArguments');
BEGIN
	IF ID_Null(vListID) THEN  -- No list yet, create it
		vListID := Create_Parameter_List('WorkerSkillFormArguments');
		Add_Parameter(vListID, 'FormatAttribute', TEXT_PARAMETER,
			'MotifFormVisualAttrs');
	ELSE  -- List already created, just set parameter
		Set_Parameter_Attr(vListID, 'FormatAttribute', TEXT_PARAMETER,
			'MotifFormVisualAttrs');
	END IF;
	Open_Form('WorkerSk', ACTIVATE, NO_SESSION, vListID);
END;


DECLARE
	vListID ParamList := 
		Get_Parameter_list('Default');
BEGIN
	Open_Form('WorkerSk', ACTIVATE, NO_SESSION, vListID);
END;


:Global.Skill := NULL;  -- initialize the skill to NULL


:Global.Skill := :Skill.Skill;  --Copy current skill into global


DECLARE
	vListID ParamList := Get_Parameter_list('ReportArguments');
BEGIN
	IF ID_Null(vListID) THEN  -- No list yet, create it
		vListID := Create_Parameter_List('ReportArguments');
		Add_Parameter(vListID, 'DESTYPE', TEXT_PARAMETER, 'PRINTER');
		Add_Parameter(vListID, 'DESNAME', TEXT_PARAMETER, 'LPT2');
		Add_Parameter(vListID, 'LedgerQuery', DATA_PARAMETER, 'Ledger');
	ELSE
		Set_Parameter_Attr(vListID, 'DESTYPE', TEXT_PARAMETER, 'PRINTER');
		Set_Parameter_Attr(vListID, 'DESNAME', TEXT_PARAMETER, 'LPT2');
		Set_Parameter_Attr(vListID, 'LedgerQuery', DATA_PARAMETER, 'Ledger');
	END IF;
	Run_Product(REPORTS, 'Ledger', SYNCHRONOUS, RUNTIME, FILESYSTEM, vListID);
END;


OG.Open('Sold.OGD', 'Ledger.SoldChart', TRUE, TRUE, ChartArguments);


Add_Parameter(vListID, 'LOGON', TEXT_PARAMETER, 'NO');


SELECT Person "Person", SUM(Amount) "Amount"
		FROM Ledger
	WHERE Action IN ('Bought', 'Paid')
GROUP BY Person
&Ordering


DECLARE
	vCurrentMessageLevel VARCHAR2(2) := :System.Message_Level;
BEGIN
	IF :System.Form_Status = 'CHANGED' THEN
		:System.Message_Level := 5;  -- turn off undesirable messages Post;
		:System.Message_Level := vCurrentMessageLevel;
END IF;

	IF :System.Form_Status <> 'QUERY' THEN
		Call_Form('NEW_FORM', NO_HIDE, NO_REPLACE);
	END IF;
END;


:Global.Exit_Flag := 'FALSE';


:Global.Exit_Flag := 'TRUE';


IF :Global.Exit_Flag = 'TRUE' THEN
	Exit_Form;
END IF;


12


DECLARE
	--Data declarations
BEGIN
	null;--Program statements
EXCEPTION
	--Exception handlers
	WHEN OTHERS THEN
		null;--default handler
END;


null;     -- This is an inline comment terminated by the line end
/* This is
a multiple-line
comment terminated by */


DECLARE
	TYPE LedgerType IS RECORD (
		LedgerID VARCHAR(25) NOT NULL := 0,
		ActionDate DATE,
		Action VARCHAR(8),
		Amount NUMBER(9,2));
BEGIN
	null;
END;


PACKAGE Time24Package IS
	TYPE Time24Type IS RECORD (
		hour NATURAL NOT NULL := 0,
		minute NATURAL NOT NULL := 0,
		second NUMBER NOT NULL := 0);

FUNCTION Subtract(time Time24Type,
			interval TimeIntervalPackage.tTimeInterval)
		RETURN Time24Type;
END;


DECLARE
	TYPE tLedger IS RECORD (
		vLedgerID VARCHAR(25) NOT NULL := 0,
		vActionDate DATE,
		vAction VARCHAR(8),
		vAmount NUMBER(9,2));
	vLedgerItem tLedger;
BEGIN
	null;
END;


IF vLedgerItem.vAction = 'Sold'
THEN vLedgerItem.vAmount := 0.0;
END IF;


DECLARE
	TYPE tLedgerAction IS TABLE OF Ledger.Action%TYPE INDEX BY BINARY_INTEGER;
	vActionTable tLedgerAction;  --declare an action table
BEGIN
	null;
END;


DECLARE
	TYPE tLedger IS TABLE OF Ledger%ROWTYPE INDEX BY BINARY_INTEGER;
	vLedgerTable tLedger;  --declare a Ledger table
BEGIN
	null;
END;


DECLARE
	TYPE tLedgerAction IS TABLE OF Ledger.Action%TYPE INDEX BY
BINARY_INTEGER;
	vActionTable tLedgerAction;  --declare an action table
BEGIN
	vActionTable(1) := 'Bought';
	vActionTable(2) := 'Sold';
	vActionTable(3) := 'Paid';
	vActionTable(4) := 'Received';
	-- Use the table in further processing
END;


DECLARE
	TYPE tLedgerAction IS TABLE OF Ledger.Action%TYPE INDEX BY
BINARY_INTEGER;
	vActionTable tLedgerAction;  --declare an action table
	CURSOR cLedger IS SELECT DISTINCT Action FROM Ledger;
BEGIN
	FOR vLedgerAction IN cLedger LOOP
		vActionTable(cLedger%ROWCOUNT) := vLedgerAction.Action;
	END LOOP;
END;


vIndex := vActionTable.Prior(4);


variable_name  type_name  [NOT NULL] [:= initial_value];


BEGIN
	/* Update the age in the block field and the database. */
	:Person.Age := :Person.Age + 1;
	UPDATE Person SET Age = Age + 1 WHERE Name = :Person.Name;
END;


constant_name   CONSTANT   type_name  := value;


DECLARE
	vDBAge     Person.Age%TYPE;   -- database column type
	vNewAge    vDBAge%TYPE;        -- type from dbAge
BEGIN
	SELECT Age INTO vDBAge FROM Person
		WHERE Person.Name = :Person.Name;
	vNewAge := vDBAge + 1;
END;


DECLARE
	hasSkillRecord   WorkerHasSkill%ROWTYPE;
BEGIN
		-- Retrieve records and process; for example,
hasSkillRecord.Name := 'Gerhardt Kentgen';
END;


DECLARE
	CURSOR sumCursor IS SELECT Person, SUM(Amount) Total
			FROM Ledger GROUP BY Person;
	sumRecord   sumCursor%ROWTYPE;
BEGIN
		null;  -- Retrieve rows and process
END;


DECLARE
	vAlertButton NUMBER;
BEGIN
	IF :Person.Age < 16 THEN
		vAlertButton := Show_Alert('Under_Age_Alert'); --Display error
		RAISE FORM_TRIGGER_FAILURE;
	END IF;
END;


DECLARE
	vAlertButton NUMBER;
BEGIN
	IF :Person.Age < 16 THEN
		vAlertButton := Show_Alert('Under_Age_Alert'); --Display error
		RAISE FORM_TRIGGER_FAILURE;
	ELSE
		vAlertButton := Show_Alert('Over_Age_Alert'); --Display error
	END IF;
END;


DECLARE
	vAlertButton NUMBER;
BEGIN
	IF :Person.Age < 16 THEN
		vAlertButton := Show_Alert('Under_Age_Alert'); --Display error
		RAISE FORM_TRIGGER_FAILURE;
	ELSIF :Person.Age > 70 THEN
		vAlertButton := Show_Alert('Over_Age_Alert'); --Display error
			RAISE FORM_TRIGGER_FAILURE;
	ELSE  -- Worker is between 16 and 70 years old, inclusive
	vAlertButton := Show_Alert('Age_OK_Alert'); --Display info alert
	END IF;
END;


DECLARE
	vCurrentPosition  VARCHAR2(10) := :SYSTEM.CURSOR_RECORD;
BEGIN
	FIRST_RECORD;
	LOOP
		:Person.Age := :Person.Age + 1;
		EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
		NEXT_RECORD;
	END LOOP;
	Go_Record(vCurrentPosition);   -- Reset cursor
END;


DECLARE
	vCurrentPosition  VARCHAR2 (10) := :SYSTEM.CURSOR_RECORD;
BEGIN
	FIRST_RECORD;
	WHILE :SYSTEM.LAST_RECORD != 'TRUE' LOOP
		:Person.Age := :Person.Age + 1;
		EXIT WHEN :SYSTEM.LAST_RECORD = 'TRUE';
		NEXT_RECORD;
	END LOOP;
	:Person.Age := :Person.Age + 1;
	Go_Record(vCurrentPosition);   -- Reset cursor
END;


DECLARE
	vCurrentPosition  VARCHAR2(10) := :SYSTEM.CURSOR_RECORD;
	vLastRecord VARCHAR2 (10) := 0;
BEGIN
	LAST_RECORD;
	vLastRecord := :SYSTEM.CURSOR_RECORD;
	FIRST_RECORD;
	FOR I IN 1..To_Number(vLastRecord) LOOP
		:Person.Age := :Person.Age + 1;
		NEXT_RECORD;
	END LOOP;
	Go_Record(vCurrentPosition);   -- Reset cursor
END;


DECLARE
	vDBAge NUMBER := 0;
BEGIN
	SELECT Age INTO vDBAge FROM Person WHERE Name = :Person.Name;
	-- Use vDBAge to do something here.
END;


DECLARE
	CURSOR cSkill IS SELECT Skill, Description FROM Skill;
	vSkill cSkill%ROWTYPE;
BEGIN
	OPEN cSkill;
	LOOP
		FETCH cSkill INTO vSkill;
			EXIT WHEN cSkill%NOTFOUND;
			-- Process the row
END LOOP;
	CLOSE cSkill;
END;


DECLARE
	CURSOR cSkill IS SELECT Skill, Description FROM Skill;
BEGIN
	FOR vSkill IN cSkill LOOP
		null;-- Process the row
	END LOOP;
END;


DECLARE
	CURSOR cSkill (pAbbrev IN VARCHAR2 DEFAULT '%') IS
		SELECT Skill, Description FROM Skill
			WHERE UPPER(Skill) LIKE UPPER(pAbbrev);
BEGIN
	FOR vSkill IN cSkill('%Horse%') LOOP
		null; -- Process the row
	END LOOP;
END;


TYPE <type name> IS REF CURSOR [RETURN <record type>];


OPEN <cursor variable> FOR <select>;


CREATE OR REPLACE PACKAGE SkillsPackage IS
		-- A record type with all the columns in the WorkerHasSkill table
	TYPE tSkill IS RECORD (
		vSkill WorkerHasSkill.Skill%TYPE,
		vAbility WorkerHasSkill.Ability%TYPE);
		-- A record type with the primary key column in the Skill table
	TYPE tSkillCursor IS REF CURSOR RETURN tSkill;
		-- A table type for a table of Skills
	PROCEDURE SelectCursor (pcSkill IN OUT tSkillCursor,
			pPerson IN VARCHAR2);
END SkillsPackage;


CREATE OR REPLACE PACKAGE BODY SkillsPackage IS
	PROCEDURE SelectCursor (pcSkill IN OUT tSkillCursor,
						pPerson IN VARCHAR2) IS
	BEGIN
		OPEN pcSkill FOR
			SELECT Skill, Ability
					FROM WorkerHasSkill
				WHERE Name = pPerson;
	END SelectCursor;
END SkillsPackage;


DECLARE
	vSkill SkillsPackage.tSkill;
	vSkillCursor SkillsPackage.tSkillCursor;
BEGIN
	SkillsPackage.SelectCursor(vSkillCursor, 'Adah Talbot');
	LOOP
		FETCH vSkillCursor INTO vSkill;
		EXIT WHEN vSkillCursor%NOTFOUND;  -- exit after last row fetched
	-- Process the skills of Adah Talbot
	END LOOP;
END;


IF :System.Form_Status = 'CHANGED' THEN
	Message('Please save your changes before dropping the utility table.');
ELSE
	Forms_DDL('DROP TABLE UtilityTable');
	IF NOT Form_Success THEN
		MyErrorHandler(DBMS_Error_Code);
	END IF;
END IF;


FUNCTION DropUtilityTable RETURN BOOLEAN IS
BEGIN
	SRW.Do_SQL('DROP TABLE UtilityTable');
	RETURN (TRUE);
EXCEPTION
	WHEN SRW.Do_SQL_Failure THEN
		SRW.Message(100, 'Error while dropping the utility table.');
		RAISE SRW.Program_Abort;
END;


PROCEDURE DropUtilityTable IS
BEGIN
	Do_SQL('DROP TABLE UtilityTable');
END;


CREATE OR REPLACE FUNCTION DropUtilityTable RETURN BOOLEAN IS
	vCursorID INTEGER := DBMS_SQL.Open_Cursor; -- open a cursor for the DDL
	vDummy INTEGER; -- a dummy return value for Execute
BEGIN
	DBMS_SQL.Parse(vCursorID, 'DROP TABLE UtilityTable', DBMS_SQL.V7);
	vDummy := DBMS_SQL.Execute(vCursorID);  -- return value not used for anything
	DBMS_SQL.Close_Cursor(vCursorID);
	RETURN (TRUE);
EXCEPTION
	WHEN OTHERS THEN
		DBMS_SQL.Close_Cursor(vCursorID);
		RAISE;
END;


13


DECLARE
	--Data declarations
BEGIN
	null;--Program statements
EXCEPTION
	--Exception handlers
	WHEN OTHERS THEN
		null;--default handler
END;


EXCEPTION
WHEN <exception 1> THEN
	<statements>
...  -- more exception handlers
WHEN OTHERS THEN
	<statements>


RAISE <exception-name>;


RAISE;


CREATE OR REPLACE PACKAGE exceptionPackage IS
	eTest EXCEPTION;
	PROCEDURE OuterProc;
END exceptionPackage;


CREATE OR REPLACE PACKAGE BODY exceptionPackage IS
	PROCEDURE OuterProc IS
	BEGIN -- OuterProc block
		DECLARE -- Start of Inner Block #1
			PROCEDURE InnerProc IS
			BEGIN -- Inner Procedure
				BEGIN -- Inner Block #2
					RAISE eTest; -- explicitly raise the exception here
				EXCEPTION  -- Inner Block #2 exception handlers
					WHEN eTest THEN
						DBMS_Output.Put_Line('Exception handled in Inner Block #2');
						RAISE;
				END; -- End of Inner Block #2
			EXCEPTION  --Inner Proc exception handlers
				WHEN eTest THEN
					DBMS_Output.Put_Line('Exception handled in InnerProc');
					RAISE;
			END InnerProc;
		BEGIN -- Inner block #1
			InnerProc;
		EXCEPTION  -- Inner Block #1 exception handlers
			WHEN eTest THEN
				DBMS_Output.Put_Line('Exception handled in Inner Block #1');
				RAISE;
		END;  -- End of Inner Block #1
	EXCEPTION  -- OuterProc exception handlers
		WHEN eTest THEN
			DBMS_Output.Put_Line('Exception handled in OuterProc');
			RAISE;
	END OuterProc;
END exceptionPackage;


BEGIN
	DBMS_Output.Enable(1000000);  -- Set up output buffer
	exceptionPackage.OuterProc;
EXCEPTION
	WHEN exceptionPackage.eTest THEN
		DBMS_Output.Put_Line('Exception handled in calling procedure');
END


Exception handled in Inner Block #2
Exception handled in InnerProc
Exception handled in Inner Block #1
Exception handled in OuterProc
Exception handled in calling procedure


RAISE FORM_TRIGGER_FAILURE


ePrivileges EXCEPTION;
PRAGMA EXCEPTION_INIT(ePrivileges, -1031);


DECLARE
	eValidation   EXCEPTION;
	vAlertButton NUMBER;
BEGIN
		null;  -- Do the validating.
EXCEPTION
	WHEN eValidation THEN
		vAlertButton := Show_Alert('LedgerValidationAlert');
		RAISE FORM_TRIGGER_FAILURE;
	WHEN OTHERS THEN
		RAISE FORM_TRIGGER_FAILURE;
END;


DECLARE
	vLookupValue VARCHAR2(100);
BEGIN
	BEGIN
		SELECT lookupValue INTO vLookupValue FROM LookupTable;
	EXCEPTION
		WHEN NO_DATA_FOUND THEN
			vLookupValue := 'N/A';
	END;
	INSERT INTO AuditTable (currentDate, currentValue)
		VALUES (sysdate, vLookupValue);
END;


PROCEDURE <name> [<argument list>] IS
	<declarations>
BEGIN
	<program statements>
END;


FUNCTION <name> [<argument list>] RETURN <type> IS
	<declarations>
BEGIN
	<program statements>
END;


( <variable> [ <mode> ] <type> [ := | DEFAULT <value>, ... )


PROCEDURE <name>;
FUNCTION <name> RETURN <type>;


Do_Key('NEXT RECORD');


DECLARE
	vAlertButton NUMBER;
BEGIN
	vAlertButton := Show_Alert('WarningAlert');
END;


GRANT EXECUTE ON Talbot.AddLedgerTransaction to AccountingRole;


PROCEDURE testLedgerItem(pItemID NUMBER, pAmount NUMBER);


testLedgerItem(456, :Ledger.Amount);


testLedgerItem(pAmount => :Ledger.Amount, pItemID => 456);


PACKAGE <name> IS
	{<variable spec>|<type spec>|<cursor spec>|<exception spec>} ...
	<subprogram spec> ...
END;


CURSOR <name> <parameter list> RETURN <type>;


PROCEDURE | FUNCTION <name> <parameter list>
	[RETURN <type>];


CREATE OR REPLACE PACKAGE Time24Package IS
	TYPE tTime24 IS RECORD (
		vHour NATURAL NOT NULL := 0,
		vMinute NATURAL NOT NULL := 0,
		vSecond NUMBER NOT NULL := 0.0);
	eInvalidHour EXCEPTION;
	eInvalidMinute EXCEPTION;
	eInvalidSecond EXCEPTION;
	FUNCTION CurrentTime RETURN tTime24;
	PROCEDURE SetTime(pTime IN OUT tTime24, pHour IN NUMBER,
		pMinute IN NUMBER, pSecond IN NUMBER);
	FUNCTION Add(pTime IN tTime24,
			pInterval IN TimeIntervalPackage.tTimeInterval)
		RETURN tTime24;
	FUNCTION Add(pInterval IN TimeIntervalPackage.tTimeInterval,
			pTime IN tTime24)
		RETURN tTime24;
	FUNCTION Subtract(pTime IN tTime24,
				pInterval IN TimeIntervalPackage.tTimeInterval)
		RETURN tTime24;
	FUNCTION Format(pTime IN tTime24) RETURN VARCHAR2;
	PROCEDURE Validate(pTime IN tTime24);
END Time24Package;


PACKAGE BODY <name> IS
{<variable spec>|<type spec>|<cursor body>|<exception spec>} ...
	<subprogram body> ...
[BEGIN
	<statement>; ...
[EXCEPTION
	<exception handlers> ...]]
END;


CURSOR <name> <parameter list> RETURN <type> IS <SELECT statement>;


CREATE OR REPLACE PACKAGE BODY Time24Package IS
	cSeparator CONSTANT CHAR(1) := ':';  -- format cSeparator hh:mm:ss
	cSecondModulus CONSTANT NUMBER := 60.0;
	cMinuteModulus CONSTANT NATURAL := 60;
	cHourModulus CONSTANT NATURAL := 24;
	cSecondsPerMinute CONSTANT NUMBER := 60.0;
	cSecondsPerHour CONSTANT NUMBER := 60*cSecondsPerMinute;
	cSecondsPerDay CONSTANT NATURAL := 24*cSecondsPerHour;
	eSecondsOverflow EXCEPTION;  -- internal error

	-- An internal Convert function to convert time values
	-- to and from seconds
	FUNCTION Convert(pTime tTime24) RETURN NUMBER IS
		vSeconds NUMBER := 0;
	BEGIN
		Validate(pTime);
		vSeconds := (pTime.vHour * cSecondsPerHour) +
				(pTime.vMinute * cSecondsPerMinute) +
				 pTime.vSecond;
	IF vSeconds NOT BETWEEN 0 AND cSecondsPerDay THEN
		RAISE eSecondsOverflow;
	END IF;
	RETURN vSeconds;
	EXCEPTION
	WHEN eSecondsOverflow THEN
		DBMS_Output.Put_Line('Error converting seconds, number out of range: '||
				To_Char(cSecondsPerMinute));
		RETURN 0.0;
	END Convert;

	FUNCTION Convert(pSeconds NUMBER) RETURN tTime24 IS
		vTimeBuffer tTime24;  -- return value
		vSecondsBuffer NUMBER := pSeconds;
	BEGIN
		IF pSeconds > cSecondsPerDay THEN
			RAISE eSecondsOverflow;
		END IF;
		vTimeBuffer.vHour := FLOOR(vSecondsBuffer / cSecondsPerHour);
		vSecondsBuffer := MOD(vSecondsBuffer, cSecondsPerHour);
		vTimeBuffer.vMinute := FLOOR(vSecondsBuffer / cSecondsPerMinute);
		vSecondsBuffer := MOD(vSecondsBuffer, cSecondsPerMinute);
		vTimeBuffer.vSecond := vSecondsBuffer;
		Validate(vTimeBuffer);
		return vTimeBuffer;
	EXCEPTION
		WHEN eSecondsOverflow THEN
			DBMS_Output.Put_Line('Error converting seconds, number too large:  '||
				To_Char(cSecondsPerMinute));
			SetTime(vTimeBuffer, 0, 0, 0);
			RETURN vTimeBuffer;
	END Convert;

	FUNCTION Add(pTime tTime24,
			pInterval TimeIntervalPackage.tTimeInterval)
		RETURN tTime24 IS
		vTimeBuffer   tTime24;  -- Buffer for return value
		vCarry  NATURAL := 0;  -- carry digits to next component
	BEGIN
		Validate(pTime);
		TimeIntervalPackage.Validate(pInterval);
		vTimeBuffer.vSecond := MOD(pTime.vSecond + pInterval.vSecond,
						cSecondModulus);
		vCarry := FLOOR(pTime.vSecond + pInterval.vSecond / cSecondModulus);
		vTimeBuffer.vMinute := MOD(pTime.vMinute + pInterval.vMinute + vCarry,
						cMinuteModulus);
		vCarry := FLOOR(pTime.vMinute + pInterval.vMinute + vCarry /
						cMinuteModulus);
		vTimeBuffer.vHour := MOD(pTime.vHour + pInterval.vhour + vCarry,
						cHourModulus);
		Validate(vTimeBuffer);
		RETURN vTimeBuffer;
	END Add;

	FUNCTION Add(pInterval TimeIntervalPackage.tTimeInterval,
			pTime tTime24)
		RETURN tTime24 IS
	BEGIN
		RETURN Add(pTime, pInterval);
	END Add;

	FUNCTION Subtract(pTime tTime24,
					  pInterval TimeIntervalPackage.tTimeInterval)
			RETURN tTime24 IS
		vTimeBuffer tTime24;  -- Buffer for returned value
		vSeconds1 NUMBER := 0.0;
		vSeconds2 NUMBER := 0.0;
		vResultSeconds NUMBER := 0.0;
	BEGIN
		-- Convert the time and interval to seconds to simplify
		vSeconds1 := Convert(pTime);
		vSeconds2 := TimeIntervalPackage.Convert(pInterval);
		vResultSeconds := vSeconds1 - vSeconds2;
		IF vResultSeconds NOT BETWEEN -cSecondsPerDay AND cSecondsPerDay
			THEN RAISE eSecondsOverflow;
		ELSIF vResultSeconds < 0 THEN
			-- Add negative value to total seconds per day to get the
			-- "reverse" number of seconds
			vResultSeconds := cSecondsPerDay + vResultSeconds;
		END IF;
		vTimeBuffer := Convert(vResultSeconds);
		Validate(vTimeBuffer);
		RETURN vTimeBuffer;
	END Subtract;

	FUNCTION CurrentTime RETURN tTime24 IS
		vDateTime DATE := SYSDATE;
		vTime tTime24;  -- return value
	BEGIN
		vTime.vHour := To_Number(To_Char(vDateTime, 'HH24'));
		vTime.vMinute := To_Number(To_Char(vDateTime, 'MI'));
		vTime.vSecond := To_Number(To_Char(vDateTime, 'SS')); -- no fraction
		Validate (vTime);
		return vTime;
	END CurrentTime;

	PROCEDURE SetTime(pTime IN OUT tTime24, pHour NUMBER, pMinute NUMBER,
					  pSecond NUMBER) IS
		vTimeCopy tTime24;
	BEGIN
		pTime.vHour := pHour;
		pTime.vMinute := pMinute;
		pTime.vSecond := pSecond;
		vTimeCopy := ptime;
		Validate(vTimeCopy);
	END SetTime;
	-- l 140
	FUNCTION Format(pTime tTime24) RETURN VARCHAR2 IS
	BEGIN
		Validate(pTime);
		RETURN To_Char(pTime.vHour)||cSeparator||
			     To_Char(pTime.vMinute)||cSeparator||
			     To_Char(pTime.vSecond);
	END Format;

	-- This internal procedure validates the time record
	PROCEDURE Validate(pTime IN tTime24) IS
	BEGIN
		IF pTime.vHour NOT BETWEEN 0 AND 23 THEN
			RAISE eInvalidHour;
		END IF;
		IF pTime.vMinute NOT BETWEEN 0 AND 59 THEN
			RAISE eInvalidMinute;
		END IF;
			IF pTime.vSecond NOT BETWEEN 0 AND 59.0 THEN
				RAISE eInvalidSecond;
			END IF;
		END Validate;

END Time24Package;


DECLARE
	vTime Time24Package.tTime24;
BEGIN
	vTime := Time24Package.CurrentTime;
END


.GENERATE LIBRARY <library> FILE [<directory>]<name>.PLX


.EXPORT LIBRARY <library> FILE [<directory>]<name>.PLD


Name_In('Ledger.Amount');
Name_In('GLOBAL.SecurityLevel');
Name_In('SYSTEM.CURRENT_RECORD');
Copy(4.05, 'Ledger.Amount');
Copy('Secret', 'GLOBAL.SecurityLevel');
Copy('TRUE', 'SYSTEM.SUPRESS_WORKING');


15


F50DBG32 workersk talbot/george debug = YES


IF DEBUG.GETN('RELDEF') = TRUE THEN
	RAISE DEBUG.BREAK;
END IF;


F50RUN32 workersk talbot/george debug_messages = YES


LOG :
	Report: Ledger
	Logged onto server:
	Username:


LOG :
	Loggedontoserver: orcl
		Username: talbot


15:33:48  APP  (  Header
15:33:48  APP . (  Chart                    BOUGHTDISPLAY
15:33:53  APP . )  Chart                    BOUGHTDISPLAY
15:33:53  APP  )  Header
15:33:56  APP  (  Frame
15:33:56  APP . (  Generic Graphical Object B_1
15:33:56  APP . )  Generic Graphical Object B_1
15:33:56  APP . (  Text Boilerplate         B_DATE_BLULOGO1
15:33:57  APP . )  Text Boilerplate         B_DATE_BLULOGO1
15:33:57  APP . (  Text Boilerplate         B_TITLE_BLULOGO1
15:33:57  APP . )  Text Boilerplate         B_TITLE_BLULOGO1
15:33:57  APP . (  Text Boilerplate         OR$_BPAGENUM_BLULOGO1
15:33:57  APP . )  Text Boilerplate         OR$_BPAGENUM_BLULOGO1
15:33:57  APP . (  Text Field               F_DATE1
15:33:57  APP .. (  Database Column          Name unknown
15:33:57  APP .. )  Database Column          Name unknown
15:33:57  APP . )  Text Field               F_DATE1
15:33:57  APP  )  Frame
15:33:57  APP  (  Frame
15:33:57  APP . (  Frame                    M_G_PERSON_GRPFR
15:33:57  APP .. (  Repeating Frame          R_G_PERSON
15:33:57  APP ... (  Group                    G<F255>_Person  Local
                     Break:  0  Global Break:  0
15:33:57  APP .... (  Query                    LedgerQuery
15:33:57  SQL         EXECUTE QUERY : select Person ,
                      ActionDate , Item , Quantity , Rate
                      from Ledger  ORDER BY 1 ASC , 1 , 2
15:33:57  APP .... )  Query                    LedgerQuery
15:33:57  PLS .... (  Function:       amountformula
15:33:57  PLS .... )  Function:       amountformula
15:33:57  APP ... )  Group                    G_Person
15:33:57  APP ... (  Text Field               F_PERSON
15:33:57  APP .... (  Database Column          Person
15:33:57  APP .... )  Database Column          Person
15:33:57  APP ... )  Text Field               F_PERSON
15:33:57  APP ... (  Frame                    M_G_ACTIONDATE_GRPFR
15:33:57  APP .... (  Repeating Frame          R_G_ACTIONDATE
15:33:57  APP ..... (  Group                    G_ActionDate
                       Local Break:  0  Global Break:  0
15:33:57  APP ..... )  Group                    G_ActionDate
15:33:57  APP ..... (  Text Field               F_RATE
15:33:57  APP ...... (  Database Column          Rate
15:33:57  APP ...... )  Database Column          Rate
15:33:57  APP ..... )  Text Field               F_RATE
15:33:57  APP ..... (  Text Field               F_QUANTITY
15:33:57  APP ...... (  Database Column          Quantity
15:33:57  APP ...... )  Database Column          Quantity
15:33:57  APP ..... )  Text Field               F_QUANTITY
15:33:57  APP ..... (  Text Field               F_ITEM
15:33:57  APP ...... (  Database Column          Item
15:33:57  APP ...... )  Database Column          Item

15:33:57  APP ..... )  Text Field               F_ITEM
<F102>15:33:57  APP ..... (  Text Field         F_ACTIONDATE
15:33:57  APP ...... (  Database Column          ActionDate
15:33:57  APP ...... )  Database Column          ActionDate
15:33:57  APP ..... )  Text Field               F_ACTIONDATE
15:33:57  APP ..... (  Group                    G_ActionDate
                       Local Break:  1  Global Break:  1
15:33:57  PLS ...... (  Function:       amountformula
15:33:57  PLS ...... )  Function:       amountformula
15:34:05  APP ... )  Frame                    M_G_ACTIONDATE_GRPFR
15:34:05  APP ... (  Group                    G_ActionDate  Local
                     Break:  1  Global Break:  225
15:34:05  APP ... )  Group                    G_ActionDate
15:34:05  APP ... (  Group                    G_Person  Local
                     Break:  52  Global Break:  52
15:34:05  APP ... )  Group                    G_Person
15:34:05  APP .. )  Repeating Frame          R_G_PERSON
15:34:05  APP .. (  Frame                    M_G_PERSON_HDR
15:34:05  APP ... (  Text Boilerplate         B_RATE
15:34:05  APP ... )  Text Boilerplate         B_RATE
15:34:05  APP ... (  Text Boilerplate         B_QUANTITY
15:34:05  APP ... )  Text Boilerplate         B_QUANTITY
15:34:05  APP ... (  Text Boilerplate         B_ITEM
15:34:05  APP ... )  Text Boilerplate         B_ITEM
15:34:05  APP ... (  Text Boilerplate         B_ACTIONDATE
15:34:05  APP ... )  Text Boilerplate         B_ACTIONDATE
15:34:05  APP ... (  Text Boilerplate         B_PERSON
15:34:05  APP ... )  Text Boilerplate         B_PERSON
15:34:05  APP .. )  Frame                    M_G_PERSON_HDR
15:34:05  APP . )  Frame                    M_G_PERSON_GRPFR
15:34:05  APP  )  Frame

      +-------------------------------------+
      | Report Builder Profiler statistics  |
      +-------------------------------------+

			TOTAL ELAPSED Time:      60.00 seconds

		Reports Time:      60.00 seconds (100.00% of TOTAL)

			         ORACLE Time:       0.00 seconds ( 0.00% of TOTAL)

					UPI:       0.00 seconds
					SQL:       0.00 seconds

TOTAL CPU Time used by process: N/A


SRW.Do_SQL('ALTER SESSION SET SQL_TRACE TRUE');


Do_SQL('ALTER SESSION SET SQL_TRACE TRUE');


SHOW PARAMETER USER_DUMP_DEST


Dump file C:ORAWIN95RDBMS73traceORA42403.TRC
Mon May 26 15:56:06 1997
ORACLE V7.3.2.1.1 - Production Release vsnsta=0
vsnsql=b vsnxtr=3
Windows 95 V4.0, OS V192.0, CPU type 586
Personal Oracle7 Release 7.3.2.1.1 - Production Release
With the distributed and replication options
PL/SQL Release 2.3.2.0.0 - Production
Windows 95 V4.0, OS V192.0, CPU type 586
Instance name: orcl

Redo thread mounted by this instance: 1

Oracle process number: 9

pid: ffc5a5a3


Mon May 26 15:56:06 1997

*** SESSION ID:(10.4) 1997.05.26.15.56.06.320
=====================
PARSING IN CURSOR #1 len=32 dep=0 uid=14 oct=42 lid=14
tim=9950835 hv=725786681 ad='263116c'
ALTER SESSION SET SQL_TRACE TRUE
END OF STMT
EXEC #1:c=0, e=9, p=0, cr=0, cu=0, mis=1, r=0, dep=0, og=4, tim=9950837
=====================
PARSING IN CURSOR #1 len=127 dep=0 uid=14 oct=3 lid=14 
tim=9950847 hv=2620705580 ad='2639ed0'
	SELECT Person "Person" , SUM ( Amount ) "Amount" FROM Ledger WHERE Action IN ( 'Bought' , 'Paid' ) GROUP BY Person ORDER BY 2
END OF STMT
PARSE #1:c=0, e=0, p=0, cr=0, cu=0, mis=0, r=0, dep=0, og=4, tim=9950847
EXEC #1:c=0, e=0, p=0, cr=0, cu=0, mis=0, r=0, dep=0, og=4, tim=9950856
FETCH #1:c=0, e=6, p=6, cr=9, cu=2, mis=0, r=45, dep=0, og=4, tim=9950862
STAT #1 id=1 cnt=45
STAT #1 id=2 cnt=184
STAT #1 id=3 cnt=225
Mon May 26 15:56:22 1997
XCTEND rlbk=0, rd_only=1


TKPROF c:orawin95rdbms73traceora42403.trc c:bought.trc explain=talbot/george


TKPROF: Release 7.3.3.0.1 - Production on Mon May 26 16:06:19 1997

Copyright (c) Oracle Corporation 1979, 1996.  All rights reserved.

Trace file: c:orawin95rdbms73traceora42403.trc
Sort options: default

******************************************************************
count    = number of times OCI procedure was executed
cpu      = cpu time in seconds executing
elapsed  = elapsed time in seconds executing
disk     = number of physical reads of buffers from disk
query    = number of buffers gotten for consistent read
current  = number of buffers gotten in current mode (usually for update)
rows     = number of rows processed by the fetch or execute call
******************************************************************

ALTER SESSION SET SQL_TRACE TRUE


call  count    cpu   elapsed     disk    query  current   rows
----- -----  ----- --------- -------- -------- -------- -------
Parse     0   0.00      0.00        0        0        0       0
Execute   1   0.00      0.09        0        0        0       0
Fetch     0   0.00      0.00        0        0        0       0
----- -----  ----- --------- -------- -------- -------- -------
total     1   0.00      0.09        0        0        0       0

Misses in library cache during parse: 0
Misses in library cache during execute: 1
Optimizer goal: CHOOSE
Parsing user id: 14  (TALBOT)
******************************************************************

SELECT Person "Person" , SUM ( Amount ) "Amount"
FROM
	Ledger WHERE Action IN ( 'Bought' , 'Paid' ) GROUP BY Person ORDER BY 2


call    count     cpu   elapsed     disk    query   current   rows
----- ------- ------- --------- -------- -------- --------- ------
Parse       1    0.00      0.00        0        0         0      0
Execute     1    0.00      0.00        0        0         0      0
Fetch       1    0.00      0.06        6        9         2     45
----- ------- ------- --------- -------- -------- --------- ------
total       3    0.00      0.06        6        9         2     45

Misses in library cache during parse: 0
Optimizer goal: CHOOSE
Parsing user id: 14  (TALBOT)

Rows     Execution Plan
-------  ---------------------------------------------------
0  SELECT STATEMENT   GOAL: CHOOSE
45   SORT (ORDER BY)
184    SORT (GROUP BY)
225     TABLE ACCESS (FULL) OF 'LEDGER'
*******************************************************************


OVERALL TOTALS FOR ALL NON-RECURSIVE STATEMENTS

call    count    cpu  elapsed    disk   query   current     rows
------- ----- ------ -------- ------- ------- --------- --------
Parse       1   0.00     0.00       0       0         0        0
Execute     2   0.00     0.09       0       0         0        0
Fetch       1   0.00     0.06       6       9         2       45
------- ----- ------ -------- ------- ------- --------- --------
total       4   0.00     0.15       6       9         2       45

Misses in library cache during parse: 0
Misses in library cache during execute: 1

OVERALL TOTALS FOR ALL RECURSIVE STATEMENTS
call    count     cpu   elapsed     disk    query   current   rows
------ ------ ------- --------- -------- -------- --------- ------
Parse       0    0.00      0.00        0        0         0      0
Execute     0    0.00      0.00        0        0         0      0
Fetch       0    0.00      0.00        0        0         0      0
------ ------ ------- --------- -------- -------- --------- ------
total       0    0.00      0.00        0        0         0      0

Misses in library cache during parse: 0

	2  user  SQL statements in session.
	0  internal SQL statements in session.
	2  SQL statements in session.
	1  statement EXPLAINed in this session.
******************************************************************
Trace file: c:orawin95rdbms73traceora42403.trc
Trace file compatibility: 7.03.02
Sort options: default

		0  session in tracefile.
		2  user  SQL statements in trace file.
		0  internal SQL statements in trace file.
		2  SQL statements in trace file.
		2  unique SQL statements in trace file.
		1  SQL statements EXPLAINed using schema:
			TALBOT.prof$plan_table
				Default table was used.
				Table was created.
				Table was dropped.
		38  lines in trace file.


16


<HTML>

<HEAD><TITLE>Talbot's Farm</TITLE></HEAD>

<BODY><BR>Loading the Ledger application...
<P>
<!-- applet definition --
<APPLET CODEBASE="/codebase/"
		CODE="oracle.forms.uiClient.v1_4.engine.Main"
		ARCHIVE="/jars/f45web.jar"
		HEIGHT=20
		WIDTH=20>

<PARAM NAME="serverPort"
	VALUE="9000">

<PARAM NAME="serverArgs"
	VALUE="module=C:TalbotApplicationsLedger
			userid=talbot/george">

<PARAM NAME="serverApp"
	VALUE="default">

</APPLET>
<!-- applet definition (end) --

</BODY>
</HTML>


f45ctl start port=<port> pool=<pool>


http://www.talbots.com/apps/Ledger.html


http://www.talbots.com:900/apps/Ledger.html


http://www.talbots.com/cgi-bin/r25cgi32.exe?report=LedgerSummary%2Erdf&
	userid=talbot%2Fgeorge%40MYDB&destype=cache&desformat=PDF


17


Run_Product(<product>, <module>, <communication mode>,
	<execution mode>, <location>, <list>, <display>);


OG.Refresh('sold.ogd', 'control.sold_pie_chart', listID);


SELECT Person "Person", SUM(Amount) "Amount"
		FROM Person, Ledger
	WHERE Person.Name = Ledger.Person AND
			Person.Lodging IS NOT NULL AND
			Ledger.ActionType = 'Paid'
GROUP BY Person
ORDER BY 2


user_name/password@odbc:data_source


A


DROP TABLE WorkerHasSkill;
DROP TABLE Skill;
DROP TABLE Ledger;
DROP TABLE Person;
DROP TABLE Lodging;
DROP CLUSTER WorkerAndSkill;


DROP SEQUENCE LedgerSequence;
CREATE SEQUENCE LedgerSequence /* sequence numbers for Ledger */;
CREATE SCHEMA AUTHORIZATION &User_name /* prompts for user name */
CREATE TABLE Ledger (
LedgerID       INTEGER PRIMARY KEY,/* sequence number, primary key */
ActionDate     DATE,               /* when */
Action         VARCHAR(8),         /* bought, sold, paid, received */
Item           VARCHAR(30),        /* what */
Quantity       INTEGER,            /* how many */
QuantityType   VARCHAR(10),        /* type of quantity */
Rate           NUMERIC(9,2),       /* how much per quantity type  */
Amount         NUMERIC(9,2),       /* total amount = rate*quantity */
Person         VARCHAR(25) REFERENCES Person /* who */
)
CREATE TABLE Lodging (
Lodging       VARCHAR(15) PRIMARY KEY, /* short name for lodging */
LongName      VARCHAR(40),             /* complete name */
Manager       VARCHAR(25),             /* manager's name */
Address       VARCHAR(30)              /* address of the lodging */
)
CREATE TABLE Skill (
Skill         VARCHAR(25) PRIMARY KEY, /* name of a capability */
Description   VARCHAR(80)              /* description of the skill */
)
CREATE TABLE Person (
Name          VARCHAR(25) PRIMARY KEY,       /* worker's name */
Age           INTEGER,                       /* age in years */
Lodging       VARCHAR(15) REFERENCES Lodging
	/* reference to short name of lodging */
)
CREATE TABLE WorkerHasSkill (
Name          VARCHAR(25) REFERENCES Person, /* worker's name */
Skill         VARCHAR(25) REFERENCES Skill,  /* capability name */
Ability       VARCHAR(15),        /* how skilled is the worker? */
PRIMARY KEY (Name, Skill)
);


INSERT INTO Lodging VALUES (
'Cranmer','Cranmer Retreat House','Thom Cranmer','Hill St., Berkeley');
INSERT INTO Lodging VALUES (
'Matts','Matts Long Bunk House','Roland Brandt','3 Mile Rd., Keene');
INSERT INTO Lodging VALUES (
'Mullers','Mullers Coed Lodging','Ken Muller','120 Main, Edmeston');
INSERT INTO Lodging VALUES (
'Papa King','Papa King Rooming','William King','127 Main, Edmeston');
INSERT INTO Lodging VALUES (
'Rose Hill','Rose Hill for Men','John Peletier','RFD 3, N. Edmeston');
INSERT INTO Lodging VALUES (
'Weitbrocht','Weitbrocht Rooming','Eunice Benson','320 Geneva, Keene');


INSERT INTO Skill VALUES (
'Woodcutter','Mark And Fell Trees, Split, Stack, Haul');
INSERT INTO Skill VALUES (
'Combine Driver','Harness, Drive, Groom Horses, Adjust Blades');
INSERT INTO Skill VALUES (
'Smithy','Stack For Fire, Run Bellows, Cut, Shoe Horses');
INSERT INTO Skill VALUES (
'Grave Digger','Mark And Cut Sod, Dig, Shore, Fill, Resod');
INSERT INTO Skill VALUES (
'Discus','Harness, Drive, Groom Horses, Blade Depth');
INSERT INTO Skill VALUES (
'Work','General Unskilled labor');


INSERT INTO Person VALUES ('Bart Sarjeant', 22, 'Cranmer');
INSERT INTO Person VALUES ('Elbert Talbot', 43, 'Weitbrocht');
INSERT INTO Person VALUES ('Donald Rollo', 16, 'Matts');
INSERT INTO Person VALUES ('Jed Hopkins', 33, 'Matts');
INSERT INTO Person VALUES ('William Swing', 15, 'Cranmer');
INSERT INTO Person VALUES ('John Pearson', 27, 'Rose Hill');
INSERT INTO Person VALUES ('George Oscar', 41, 'Rose Hill');
INSERT INTO Person VALUES ('Kay And Palmer Wallbom', NULL, 'Rose Hill');
INSERT INTO Person VALUES ('Pat Lavay', 21, 'Rose Hill');
INSERT INTO Person VALUES ('Richard Koch And Brothers', NULL, 'Weitbrocht');
INSERT INTO Person VALUES ('Dick Jones', 18, 'Rose Hill');
INSERT INTO Person VALUES ('Adah Talbot', 23, 'Papa King');
INSERT INTO Person VALUES ('Roland Brandt', 35, 'Matts');
INSERT INTO Person VALUES ('Peter Lawson', 25, 'Cranmer');
INSERT INTO Person VALUES ('Victoria Lynn', 32, 'Mullers');
INSERT INTO Person VALUES ('Wilfred Lowell', 67, NULL);
INSERT INTO Person VALUES ('Helen Brandt', 15, NULL);
INSERT INTO Person VALUES ('Gerhardt Kentgen', 55, 'Papa King');
INSERT INTO Person VALUES ('Andrew Dye', 29, 'Rose Hill');
INSERT INTO Person VALUES ('Blacksmith', NULL, NULL);
INSERT INTO Person VALUES ('Boole And Jones', NULL, NULL);
INSERT INTO Person VALUES ('Dean Foreman', NULL, NULL);
INSERT INTO Person VALUES ('Dr. Carlstrom', NULL, NULL);
INSERT INTO Person VALUES ('Edward Johnson', NULL,NULL);
INSERT INTO Person VALUES ('Edythe Gammiere', NULL, NULL);
INSERT INTO Person VALUES ('Feed Store', NULL, NULL);
INSERT INTO Person VALUES ('Fred Fuller', NULL, NULL);
INSERT INTO Person VALUES ('Gary Kentgen', NULL, NULL);
INSERT INTO Person VALUES ('General Store', NULL, NULL);
INSERT INTO Person VALUES ('George August', NULL, NULL);
INSERT INTO Person VALUES ('George B. McCormick', NULL, NULL);
INSERT INTO Person VALUES ('Harold Schole', NULL, NULL);
INSERT INTO Person VALUES ('Henry Chase', NULL, NULL);
INSERT INTO Person VALUES ('Isaiah James', NULL, NULL);
INSERT INTO Person VALUES ('James Cole', NULL, NULL);
INSERT INTO Person VALUES ('Janice Talbot', NULL, NULL);
INSERT INTO Person VALUES ('John Austin', NULL, NULL);
INSERT INTO Person VALUES ('Lily Carlstrom', NULL, NULL);
INSERT INTO Person VALUES ('Livery', NULL, NULL);
INSERT INTO Person VALUES ('Manner Jewelers', NULL, NULL);
INSERT INTO Person VALUES ('Methodist Church', NULL, NULL);
INSERT INTO Person VALUES ('Mill', NULL, NULL);
INSERT INTO Person VALUES ('Morris Arnold', NULL, NULL);
INSERT INTO Person VALUES ('Palmer Wallbom', NULL, NULL);
INSERT INTO Person VALUES ('Phone Company', NULL, NULL);
INSERT INTO Person VALUES ('Post Office', NULL, NULL);
INSERT INTO Person VALUES ('Quarry', NULL, NULL);
INSERT INTO Person VALUES ('Robert James', NULL, NULL);
INSERT INTO Person VALUES ('Sam Dye', NULL, NULL);
INSERT INTO Person VALUES ('School', NULL, NULL);
INSERT INTO Person VALUES ('Underwood Bros', NULL, NULL);
INSERT INTO Person VALUES ('Verna Hardware', NULL, NULL);


INSERT INTO WorkerHasSkill VALUES ('Dick Jones','Smithy','Excellent');
INSERT INTO WorkerHasSkill VALUES ('John Pearson','Combine Driver',NULL);
INSERT INTO WorkerHasSkill VALUES ('John Pearson','Smithy','Average');
INSERT INTO WorkerHasSkill VALUES 
	('Helen Brandt','Combine Driver','Very Fast');
INSERT INTO WorkerHasSkill VALUES ('John Pearson','Woodcutter','Good');
INSERT INTO WorkerHasSkill VALUES ('Victoria Lynn','Smithy','Precise');
INSERT INTO WorkerHasSkill VALUES ('Adah Talbot','Work','Good');
INSERT INTO WorkerHasSkill VALUES ('Wilfred Lowell','Work','Average');
INSERT INTO WorkerHasSkill VALUES ('Elbert Talbot','Discus','Slow');
INSERT INTO WorkerHasSkill VALUES ('Wilfred Lowell','Discus','Average');


INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'01-APR-01','Paid','Plowing',1,'Day',3,3,'Richard Koch And Brothers');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'02-MAY-01','Paid','Work',1,'Day',1,1,'Dick Jones');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'03-JUN-01','Paid','Work',1,'Day',1,1,'Elbert Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'04-JAN-01','Paid','Work',1,'Day',1,1,'Gerhardt Kentgen');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'04-FEB-01','Paid','Work',.5,'Day',1,.5,'Elbert Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'05-APR-01','Paid','Work',1,'Day',1,1,'Dick Jones');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-AUG-01','Paid','Plowing',1,'Day',1.8,1.8,'Victoria Lynn');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-OCT-01','Paid','Plowing',.5,'Day',3,1.5,'Richard Koch And Brothers');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'09-SEP-01','Paid','Work',1,'Day',1,1,'Adah Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'09-OCT-01','Paid','Work',.5,'Day',1.25,.63,'Donald Rollo');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'10-NOV-01','Paid','Work',1,'Day',1.25,.63,'John Pearson');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'10-AUG-01','Paid','Work',1,'Day',1,1,'Helen Brandt');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'11-AUG-01','Paid','Work',1,'Day',2,2,'Helen Brandt');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'11-SEP-01','Paid','Work',1,'Day',.75,.75,'Roland Brandt');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'12-DEC-01','Paid','Work',1,'Day',1,1,'Bart Sarjeant');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'12-JAN-01','Paid','Work',1,'Day',1,1,'George Oscar');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'13-JUN-01','Paid','Work',1,'Day',1,1,'Peter Lawson');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'14-JUL-01','Paid','Work',1,'Day',1.2,1.2,'Wilfred Lowell');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-JUL-01','Paid','Work',1,'Day',2.25,2.25,'Kay And Palmer Wallbom');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'03-OCT-01','Sold','Boot Between Horses',1,'Each',12.5,12.5,'Gary Kentgen');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'01-NOV-01','Bought','Calf',2,'Each',2,4,'Gary Kentgen');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'02-NOV-01','Bought','Mare',1,'Each',5,5,'James Cole');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'03-NOV-01','Bought','Pig',1,'Each',2,2,'Andrew Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'04-NOV-01','Bought','Hay',1,'Wagon',5,5,'Andrew Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'05-NOV-01','Bought','Hay',4,'Wagon',5,20,'Andrew Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'05-NOV-01','Bought','Line',1,'Set',.75,.75,'Andrew Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-NOV-01','Bought','Colt',2,'Each',4.5,9,'Andrew Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-AUG-01','Paid','Plowing',2,'Day',2,4,'Andrew Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-NOV-01','Paid','Sawed Wood',1,'Day',.5,.5,'Andrew Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'09-NOV-01','Bought','Colt',1,'Each',10,10,'Andrew Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'10-NOV-01','Sold','Hefer',1,'Each',28,28,'Pat Lavay');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'11-NOV-01','Sold','Boot Between Horses',1,'Each',6,6,'Pat Lavay');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'11-NOV-01','Sold','Butter',1,'Pound',.15,.15,'Pat Lavay');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'12-NOV-01','Paid','Work',2,'Day',.75,1.5,'Pat Lavay');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'13-NOV-01','Paid','Cut Logs',.5,'Day',.5,.25,'Pat Lavay');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'13-NOV-01','Paid','Drawed Logs',1.5,'Day',.5,.75,'Pat Lavay');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'13-DEC-01','Paid','Sawed Wood',1,'Day',.5,.5,'Pat Lavay');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'14-NOV-01','Sold','Hefer',1,'Each',35,35,'Morris Arnold');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-NOV-01','Sold','Beef',37,'Pound',.04,1.48,'Fred Fuller');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'16-NOV-01','Sold','Butter',5,'Pound',.16,.8,'Victoria Lynn');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-NOV-01','Sold','Butter',6,'Pound',.16,.96,'John Pearson');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'20-NOV-01','Sold','Heifer',1,'Each',30,30,'Palmer Wallbom');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'21-NOV-01','Sold','Beef',116,'Pound',.06,6.96,'Roland Brandt');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'22-NOV-01','Sold','Beef',118,'Pound',.06,7.08,'Gerhardt Kentgen');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'01-DEC-01','Bought','Beef',138,'Pound',.05,6.9,'Victoria Lynn');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'01-DEC-01','Bought','Beef',130,'Pound',.06,7.8,'George B. McCormick');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'03-DEC-01','Bought','Beef',130,'Pound',.05,6.5,'Peter Lawson');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'03-DEC-01','Bought','Beef',125,'Pound',.06,7.5,'Helen Brandt');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'05-DEC-01','Bought','Beef',140,'Pound',.05,7,'Robert James');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'05-DEC-01','Bought','Beef',145,'Pound',.05,7.25,'Isaiah James');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-DEC-01','Bought','Horse',1,'Each',30,30,'George August');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-DEC-01','Bought','Reaper/Binder',1,'Each',47.5,47.5,'Janice Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'03-JAN-01','Bought','Hominy',1,'Bushel',1.25,1.25,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'09-JAN-01','Bought','Lice Killer',1,'Each',.5,.5,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'11-JAN-01','Bought','Mending Brace',1,'Each',.15,.15,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'11-JAN-01','Bought','Stove Blacking',1,'Each',.05,.05,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'13-JAN-01','Bought','Grinding Bat',10,'Each',.03,.3,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'14-JAN-01','Sold','Beef Hide',1,'Each',5.46,5.46,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'14-JAN-01','Sold','Cheese Flat',13,'Each',3.15,40.95,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'14-JAN-01','Bought','Lantern Globe',1,'Each',.1,.1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-JAN-01','Bought','Stamp For Letter',1,'Each',.02,.02,'Post Office');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-JAN-01','Bought','Stocking',2,'Pair',.15,.3,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'16-JAN-01','Bought','Oil',4,'Gallon',.1,.4,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'16-JAN-01','Bought','Sugar',25,'Pound',.07,1.75,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'16-JAN-01','Bought','Molasses',1,'Gallon',.6,.6,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'16-JAN-01','Bought','Card Of Thanks',1,'Each',.3,.3,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'17-JAN-01','Bought','Horse Shodding',1,'Each',.85,.85,'Livery');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'17-JAN-01','Bought','Corn',230,'Pound',.01,2.3,'Feed Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-JAN-01','Bought','Corn Meal',213,'Pound',.01,2.13,'Feed Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-JAN-01','Bought','Paper',50,'Sheets',.01,.5,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-JAN-01','Bought','Coffee',1,'Pound',.3,.3,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-JAN-01','Bought','Seeded Raisins',1,'Pound',.12,.12,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-JAN-01','Bought','Cotton Stocking',3,'Pair',.08,.24,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'19-JAN-01','Bought','Cotton Stocking',3,'Pair',.08,.24,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'19-JAN-01','Bought','Grinding Bat',24,'Each',.03,.72,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'19-JAN-01','Bought','Telephone Call',1,'Each',.15,.15,'Phone Company');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'19-JAN-01','Bought','Tea',.5,'Pound',.5,.25,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'19-JAN-01','Bought','Hat',1,'Each',.1,.1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'19-JAN-01','Bought','Salt Peter',1,'Each',.08,.08,'General Store');
INSERT INTO Ledger VALUES LedgerSequence.NEXTVAL,
'19-JAN-01','Bought','Envelopes',6,'Each',.02,.12,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'19-JAN-01','Bought','Creoal',2,'Qaurt',.37,.74,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'23-JAN-01','Sold','Wood',1,'Cord',2,2,'Methodist Church');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'24-JAN-01','Bought','Schooling',1,'Each',1,1,'School');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'24-JAN-01','Bought','Hominy',186,'Each',.01,1.86,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-JAN-01','Bought','Grinding',1,'Each',.9,.9,'Mill');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-JAN-01','Bought','Popcorn',5,'Pound',.04,.2,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'02-FEB-01','Bought','Sulpher',5,'Pound',.25,1.25,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'03-FEB-01','Bought','Oil',4,'Gallon',.13,.52,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'03-FEB-01','Bought','Swamp Root',1,'Each',.75,.75,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'04-FEB-01','Bought','Shoeing Ned',1,'Each',.5,.5,'Blacksmith');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'04-FEB-01','Bought','Grinding',1,'Each',.47,.47,'Mill');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'05-FEB-01','Bought','Pills',1,'Each',.25,.25,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-FEB-01','Bought','Thread',2,'Each',.05,.1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'08-FEB-01','Bought','Shirts',2,'Each',.5,1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'10-FEB-01','Sold','Butter',9,'Pound',.25,2.25,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-FEB-01','Bought','Horse Medison',1,'Each',.13,.13,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-FEB-01','Bought','Elbo Stove Pipe',1,'Each',.15,.15,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-FEB-01','Sold','Calf',1,'Each',4,4,'Lily Carlstrom');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'25-FEB-01','Sold','Butter',21,'Pound',.25,5.25,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-FEB-01','Bought','Swamp Root',1,'Each',.75,.75,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-FEB-01','Bought','Liver Pills',1,'Each',.2,.2,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-FEB-01','Sold','Butter',3,'Pound',.25,.75,'Helen Brandt');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'01-APR-01','Bought','Grinding',1,'Each',.45,.45,'Mill');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-MAR-01','Bought','Medison For Indigestion',1,'Each',.4,.4,
	'Dr. Carlstrom');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-JUN-01','Bought','Breading Powder',1,'Each',.9,.9,'Mill');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-MAR-01','Bought','Pants',1,'Pair',.75,.75,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-APR-01','Bought','Hominy',200,'Pound',.01,2,'Mill');
INSERT INTO Ledger VALUES LedgerSequence.NEXTVAL,
'08-MAR-01','Bought','Tobacco For Lice',1,'Each',.25,.25,'Mill');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-MAR-01','Bought','Shoeing',1,'Each',.35,.35,'Blacksmith');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-APR-01','Bought','Pins',1,'Each',.05,.05,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-MAR-01','Bought','Mail Box',1,'Each',1,1,'Post Office');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'10-MAR-01','Bought','Stove Pipe Thimbles',2,'Each',.5,1,'Verna Hardware');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'13-MAR-01','Bought','Thermometer',1,'Each',.15,.15,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'14-MAR-01','Bought','Lot In Cemetery No. 80',1,'Each',25,25,
	'Methodist Church');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'14-MAR-01','Paid','Digging Of Grave',1,'Each',3,3,'Jed Hopkins');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'16-APR-01','Bought','Grinding',1,'Each',.16,.16,'Mill');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'16-MAR-01','Bought','Grinding',1,'Each',.16,.16,'Mill');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'23-MAR-01','Bought','Cloth For Dress Lining',2,'Yard',.27,.54,
	'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-AUG-01','Bought','SYRUP hermometer',1,'Each',1,1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'25-MAR-01','Bought','Boots For Shirley',1,'Pair',2.5,2.5,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'27-APR-01','Bought','Syrup Cans',2,'Dozen',1.07,2.14,'Verna Hardware');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'22-MAR-01','Bought','Milk Cans',2,'Each',2.5,5,'Verna Hardware');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'23-APR-01','Bought','Dubble Strainer',1,'Each',.95,.95,'Verna Hardware');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'25-JUN-01','Bought','Milk Stirrer',1,'Each',.25,.25,'Verna Hardware');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'27-MAR-01','Bought','Hominy',77,'Pound',.01,.77,'Mill');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-APR-01','Bought','Corn',104,'Pound',.01,1.04,'Mill');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-APR-01','Bought','Funeral',1,'Each',3.19,3.19,'Underwood Bros');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'30-APR-01','Bought','Brush',1,'Each',.05,.05,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'30-APR-01','Bought','Sand',5,'Bushel',.03,.15,'Quarry');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'31-MAR-01','Sold','Molasses',3,'Gallon',1,3,'Harold Schole');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-MAR-01','Sold','Molasses',1,'Gallon',1,1,'Gerhardt Kentgen');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'30-MAR-01','Bought','Fixing Shirleys Watch',1,'Each',.25,.25,
	'Manner Jewelers');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'04-APR-01','Sold','Butter',9,'Pound',.23,2.07,'Harold Schole');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'05-APR-01','Bought','Soda',1,'Each',.05,.05,'General Store');
INSERT INTO Ledger VALUES LedgerSequence.NEXTVAL,
'05-MAR-01','Bought','Telephone Call',1,'Each',.2,.2,'Phone Company');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-APR-01','Bought','Gloves',1,'Pair',.25,.25,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-APR-01','Bought','Shoes For Shirley',1,'Pair',2,2,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'09-APR-01','Bought','Peanuts',1,'Each',.05,.05,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'11-APR-01','Bought','Bran',300,'Pound',.01,3,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-APR-01','Bought','Shoeing',2,'Each',.3,.6,'Blacksmith');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'17-APR-01','Bought','Hominy',173,'Pound',.01,1.73,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'17-APR-01','Bought','Bran',450,'Pound',.01,4.5,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'17-APR-01','Bought','Calf Meal',110,'Pound',.01,1.1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'22-APR-01','Bought','Hominy',454,'Pound',.01,4.54,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'22-APR-01','Bought','Bran',300,'Pound',.01,3,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'22-APR-01','Sold','Calf',1,'Each',1,1,'Pat Lavay');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'25-APR-01','Bought','Calf Meal',100,'Each',.01,1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'27-APR-01','Bought','Shoeing Ned',1,'Each',.5,.5,'Blacksmith');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-JUN-01','Received','Breaking Colt',1,'Each',5,5,'Sam Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-JUN-01','Received','Keeping Colt',1,'Each',4,4,'Sam Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'17-JUN-01','Bought','School Tax',1,'Each',6.56,6.56,'School');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'17-JUN-01','Received','Threshing',2,'Day',1,2,'Henry Chase');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-JUN-01','Paid','Threshing',.5,'Day',1,.5,'William Swing');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-JUN-01','Bought','Sheep',22,'Each',.87,19.14,'Boole And Jones');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-MAR-01','Sold','Potatoes',5,'Bushel',.25,1.25,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-MAR-01','Sold','Cow',2,'Each',33,66,'Sam Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-MAR-01','Received','Boot Between Horses',1,'Each',10,10,'Adah Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-MAR-01','Sold','Wagon',1,'Each',5,5,'Adah Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'04-APR-01','Sold','Harnes',1,'Each',2,2,'Adah Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'16-APR-01','Sold','Cow',3,'Each',30,90,'George B. McCormick');
INSERT INTO Ledger VALUES LedgerSequence.NEXTVAL,
'09-JUN-01','Bought','Use Of Pasture',1,'Each',10,10,'George B. McCormick');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-JUN-01','Bought','Sheep And Bull',1,'Lot',97.88,97.88,'Edward Johnson');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'03-JUL-01','Sold','Heifer',1,'Each',35,35,'Sam Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-MAY-01','Bought','Middlings',180,'Pound',.01,1.8,'Dean Foreman');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'20-MAY-01','Bought','Middlings',450,'Pound',.01,4.5,'George Oscar');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'22-MAY-01','Bought','Middlings',640,'Pound',.01,6.4,'Edythe Gammiere');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'23-MAY-01','Bought','Middlings',110,'Pound',.01,1.1,'John Austin');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-MAY-01','Bought','Comb',1,'Each',.07,.07,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'29-MAY-01','Bought','Buttons',1,'Each',.1,.1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'05-JUL-01','Bought','Beans',6,'Pound',.03,.18,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'29-MAY-01','Bought','Raisons',3,'Pound',.08,.24,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'29-MAY-01','Bought','Cheese',3,'Pound',.09,.27,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'04-JUN-01','Bought','Beer',1,'Each',.2,.2,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'04-JUN-01','Bought','Cough Syrup',1,'Each',.25,.25,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'26-JUN-01','Bought','Shoe String',2,'Pair',.04,.08,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'26-JUN-01','Bought','Close Pins',1,'Each',.05,.05,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'26-JUN-01','Bought','Close Brush',1,'Each',.1,.1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-MAR-01','Sold','Eggs',14,'Dozen',.12,1.68,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-MAR-01','Sold','Hens',12,'Each',.5,6,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-APR-01','Sold','Eggs',13,'Dozen',.1,1.3,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'27-APR-01','Paid','Plowing',1,'Day',3,3,'Richard Koch And Brothers');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'16-APR-01','Paid','Plowing',1,'Day',3,3,'Richard Koch And Brothers');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'17-DEC-01','Paid','Sawing',1,'Day',.75,.75,'Dick Jones');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-JUL-01','Paid','Sawing',1,'Day',.75,.75,'Dick Jones');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-AUG-01','Paid','Weeding',1,'Day',.9,.9,'Elbert Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'29-SEP-01','Paid','Work',1,'Day',1,1,'Gerhardt Kentgen');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'19-JAN-01','Paid','Work',1,'Day',1,1,'Gerhardt Kentgen');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'30-JAN-01','Paid','Work',.5,'Day',1,.5,'Elbert Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'28-FEB-01','Paid','Work',1,'Day',1,1,'Elbert Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'20-MAR-01','Paid','Work',1,'Day',1,1,'Dick Jones');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'21-JUL-01','Paid','Work',1,'Day',1,1,'Victoria Lynn');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'22-OCT-01','Paid','Plowing',1,'Day',1.8,1.8,'Dick Jones');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'23-SEP-01','Paid','Discus',.5,'Day',3,1.5,'Richard Koch And Brothers');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'22-AUG-01','Paid','Sawing',1,'Day',1,1,'Peter Lawson');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'23-AUG-01','Paid','Sawing',1,'Day',1,1,'Peter Lawson');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'24-MAY-01','Paid','Work',1,'Day',1.2,1.2,'Wilfred Lowell');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'11-MAY-01','Paid','Work',1,'Day',1.2,1.2,'Wilfred Lowell');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'26-JUN-01','Paid','Painting',1,'Day',1.75,1.75,'Kay And Palmer Wallbom');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'02-JUL-01','Bought','Middlings',220,'Pound',.01,2.2,'Edythe Gammiere');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'03-JUL-01','Bought','Pig',1,'Each',3,3,'John Austin');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'08-JUL-01','Bought','Cheese',1,'Pound',.09,.09,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'09-JUL-01','Bought','Beer',1,'Each',.2,.2,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'02-AUG-01','Bought','Milk Cans',3,'Each',2.5,7.5,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'05-AUG-01','Bought','Hominy',120,'Pound',.01,1.2,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'08-AUG-01','Bought','Brush',1,'Each',.06,.06,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'12-AUG-01','Bought','Corn',90,'Pound',.01,.9,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'25-MAR-01','Sold','Molasses',5,'Gallon',1,5,'Sam Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'29-AUG-01','Sold','Butter',5,'Pound',.23,1.15,'Gerhardt Kentgen');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'06-SEP-01','Bought','Telephone Call',1,'Each',.2,.2,'Phone Company');
NSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'09-SEP-01','Bought','Peanuts',1,'Each',.05,.05,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'12-SEP-01','Bought','Bran',170,'Pound',.01,1.7,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'13-SEP-01','Bought','Shoeing',4,'Each',.3,1.2,'Blacksmith');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-SEP-01','Bought','Hominy',144,'Pound',.01,1.44,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'20-APR-01','Bought','Bran',370,'Pound',.01,3.7,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'17-JUL-01','Bought','Calf Meal',90,'Pound',.01,.9,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'20-JUL-01','Bought','Hominy',300,'Pound',.01,3,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'25-JUL-01','Sold','Calf',1,'Each',1,1,'Sam Dye');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'19-SEP-01','Bought','Bran',100,'Pound',.01,1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'23-SEP-01','Bought','Calf Meal',110,'Pound',.01,1.1,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'25-SEP-01','Bought','Hominy',80,'Pound',.01,.8,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'07-OCT-01','Paid','Work',1,'Day',1,1,'Jed Hopkins');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'12-OCT-01','Bought','Sheep',12,'Each',.9,10.8,'Boole And Jones');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'15-OCT-01','Sold','BEEF',935,'Pound',.03,28.05,'General Store');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'18-OCT-01','Received','Boot Between Horses',1,'Each',10,10,'Adah Talbot');
INSERT INTO Ledger VALUES (LedgerSequence.NEXTVAL,
'12-OCT-01','Sold','Heifer',1,'Each',35,35,'George B. McCormick');

