TurboIMAGE/XL Database Management System Reference Manual MPE/iX V6.5 (30391-90011)
Chapter 6 299
Host Language Access
Pascal
Readln (Search_Item_Value);
Mode5_Unconditional :=5; (* Request item level locks. *)
(* Append the user's input to the lock descriptor buffer. *)
Lock_Descriptor_Array. Lock_Descriptor_Sales.Value_For_Data_Item
:=Search_Item_Value;
(* Place item level locks on all entries identified by *)
(* the value in the Search_Item_Value. *)
DBLOCK (DBname,Lock_Descriptor_Array,Mode5_Unconditional,Status);
If Status.Condition <> 0 then
Get_Error_And_Explain;
Sales_Detail :='SALES;';
Search_Item_Name :='PURCH-DATE;';
Mode1_Chained_Read :=1;
(* Locate the chain identified by the value in the *)
(* Search_Item_Value. *)
DBFIND (DBname,Sales_Detail,Mode1_Chained_Read,Status,
Search_Item_Name,Search_Item_Value);
If Status.Condition <>0 Then
Begin
If Status.Condition = No_Chain_Head Then
Begin
Writeln('***************************************');
Writeln('* No Such Entry in the Sales Dataset *');
Writeln('* Please Try Again. *');
Writeln('***************************************');
Prompt ('Hit Enter To Continue ---------------->');
Readln;
End
Else Get_Error_And_Explain;
End
Else
Begin
Write('Acct-Number');
Write('Stock-Number':14);
Write('Qty':6);
Write('Price':7 );
Write('Tax':5);
Write('Total':8);
Write('Purch-Date':12);
Write('Delive-Date':14);
Write('---------------------------------------------------);
Write('---------------------------');
Writeln;
(* Start retrieving all records in the current chain. *)
Mode5_Forward :=5;
List :='
@
;';
While Status.Condition <> End_Of_Chain Do
Begin
(* Retrieve the contents of the entry which is at the *)
(* current record pointer. *)