コンソール ユーザー インターフェイスでページネーションを行うことは可能ですか? 30 人の従業員レコードがあり、10 件だけを表示したいとします。ユーザーが矢印ボタンを押すと、次の 10 件のリストが表示されます。出来ますか?
EXEC SQL DECLARE EmployeeReportCursorJawatan CURSOR FOR
SELECT EMP_ID, NAMA, IC, JAWATAN, GAJI_ASAS, TEL_RUMAH, TEL_BIMBIT, ALAMAT FROM PEKERJA WHERE upper(JAWATAN) LIKE upper(:str);
EXEC SQL OPEN EmployeeReportCursorJawatan;
/* loop through the cursor and break the loop when end*/
EXEC SQL WHENEVER NOT FOUND DO break;
while (1)
{
/* fetch the data from cursor and display*/
EXEC SQL FETCH EmployeeReportCursorJawatan INTO :emp_idSearch, :namaSearch, :icSearch, :jawatanSearch, :gajiSearch, :homeSearch, :mobileSearch, :alamatSearch;
cout<<"\nID\t\t: " << emp_idSearch;
cout<<"\nName\t\t: " << namaSearch;
cout<<"\nIC\t\t: " << icSearch;
cout<<"\nPost\t\t: " << jawatanSearch;
cout<<"\nSalary\t\t: RM " << gajiSearch;
cout<<"\nPhone number (H): " << homeSearch;
cout<<"\nPhone number (M): " << mobileSearch;
cout<<"\nAddress\t: " << alamatSearch;
cout<<"\n---------------------------------------------------------\n";
totalCustomer++;
}