Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 18th, 2013, 10:11 AM
jonhypeter jonhypeter is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2013
Posts: 1 jonhypeter User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 m
Reputation Power: 0
Collections

I hope someone can help me with this issue. Please do not get too technical for I may not be able to follow. This is my first time trying to use a collection. The procedure does not compile because it cant "see" teh collection.
Here is the situation:
I have two tables CalibrationData and Calibrator. For every instance of CalibrationData, it may be more than one row in Calibrator. This information will be sent by another package and only one row for CalibrarionData will be sent at a time.
I created a collection for calibrator and a record that contains all the rows for calibrationData and, the collection for calibrator. Here is the specs.

Package specs

-- CalibrationData table rowtype
SUBTYPE tCalibrationData IS CalibrationData%ROWTYPE;
-- Calibrator table rowtype
SUBTYPE tCalibrator IS Calibrator%ROWTYPE;
-- all fields from calibrationData table
SUBTYPE t_id IS CalibrationData.Id%TYPE;
SUBTYPE t_calibrationId IS CalibrationData.Calibrationid%TYPE;
SUBTYPE t_instrumentId IS CalibrationData.Instrumentid%TYPE;
SUBTYPE t_testId IS CalibrationData.Testid%TYPE;
SUBTYPE t_OperatorId IS Calibrationdata.Operatorid%TYPE;
SUBTYPE t_succes IS Calibrationdata.Succes%TYPE;
SUBTYPE t_registrationDate IS Calibrationdata.Registrationdate%TYPE;
--all fields from calibrator
SUBTYPE t_CId IS calibrator.id%TYPE;
SUBTYPE t_calibrationDataId IS calibrator.calibrationdataid%TYPE;
SUBTYPE t_materialcode IS calibrator.materialcode%TYPE;
SUBTYPE t_lotNumber IS calibrator.lotnumber%TYPE;
SUBTYPE t_bottleNumber IS calibrator.bottlenumber%TYPE;
SUBTYPE t_instrumentMeasurementTime IS calibrator.instrument_measurement_time%TYPE;


-- Calibrator record type
TYPE recCalibrator IS RECORD (
CalibrationDataID t_calibrationDataId,
MaterialCode t_materialcode,
LotNumber t_lotnumber,
BottleNumber t_bottleNumber,
Instrument_Measurement_time t_instrumentMeasurementTime
);
--calibrator table of
TYPE t_colCalibrator IS TABLE OF recCalibrator;
--calibration record type
TYPE recCalibrationData IS RECORD (
ID t_id,
CalibrationID t_calibrationid,
InstrumentID t_instrumentId,
TestID t_testId,
OperatorID t_OperatorId,
succes t_succes,
RegistrationDate t_registrationDate,
colCalibrator t_colcalibrator);
Here is the procedure that loads the data that is not compiling.

PROCEDURE storeCalibrationData(pCalibrationData IN recCalibrationData) IS
mCalibrationData tCalibrationData;
mCalibrationId recCalibrationdata;
mCalibrator t_colCalibrator;

BEGIN

--initializes the elements in the recordtype
mCalibrationData.calibrationid := pcalibrationdata.CalibrationID;
mCalibrationData.instrumentid := pcalibrationdata.InstrumentID;
mCalibrationData.TestId := pCalibrationData.TestID;
mCalibrationData.OperatorID := pCalibrationData.OperatorId;
mCalibrationData.succes := util_types.cYes;
mCalibrationData.RegistrationDate := pCalibrationData.RegistrationDate;
mcalibrator := pCalibrationData.colCalibrator;

--Inserts a new row in the calibrationData table and returns the new id.
-- mCalibrationid := DL_CALIBRATIONDATA.insertCalibrationData(mCalibrationData);
--if there is any element in the collection loop
IF pCalibrationData.colCalibrator.COUNT > 0 THEN
FOR i IN pCalibrationData.colCalibrator.FIRST..pCalibrationData.colCalibrator.LAST LOOP
--assign the new id to all the elements in pCalibrator

mcalibrator.CalibrationDataID := pCalibrationData.colCalibrator(i).CalibrationDataID;
-- mCalibrator.MaterialCode(i) := pCalibrationData.ColCalibrator(i).MaterialCode;
-- mCalibrator.BottleNumber(i) := pCalibrationData.ColCalibrator(i).BottleNumber;
-- mCalibrator.Instrument_measurement_time(i) := pCalibrationData.ColCalibrator(i).Instrument_measurement_time;
END LOOP;
END IF;
--insert all the elements in hte collection in the calibrator table
-- dl_calibrationHandling.insertCalibrator(mCalibrator);
END storeCalibrationData;

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Collections

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap