是否可以使用控制台用户界面进行分页?假设我有 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++;
}