亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

首頁 php教程 php手冊 一個ORACLE分頁程序

一個ORACLE分頁程序

Jun 21, 2016 am 09:14 AM
gt lt page quot the

oracle|程序|分頁





Paging Test








// How to split the result into pages, like 'limits' in MySQL?
// ===========================================================
// Tutorial by Neil Craig (neilc@netactive.co.za)
// Date: 2001-06-05
// With this example, I will explain paging of database queries where the
// result is more than the developer want to print to the page, but wish to
// split the result into seperate pages.
// The table "SAMPLE_TABLE" accessed in this tutorial has 4 fields:
// PK_ID, FIELD1, FIELD2 and FIELD3. The types don't matter but you should
// define a primary key on the PK_ID field.

$display_rows = 5; // The rows that should be display at a time. You can
// modify this if you like.

// Connect to the Oracle database
putenv("ORACLE_SID=purk");
putenv("ORACLE_HOME=/export/oracle8i");
putenv("TNS_ADMIN=$ORACLE_HOME/network/admin");
$OracleDBConn = OCILogon("purk","purk","lengana.world");

// This query counts the records
$sql_count = "SELECT COUNT(*) FROM SAMPLE_TABLE";

// Parse the SQL string & execute it
$row_count=OCIParse($OracleDBConn, $sql_count);
OCIExecute($row_count);

// From the parsed & executed query, we get the amount of records found.
// I'm not storing this result into a session variable because it allows for
// new records to be shown as it is entered by another user while the result
// is printed.
if (OCIFetch($row_count)) {
$num_rows = OCIResult($row_count,1);
} else {
$num_rows = 0; // If no record was found
}

// Free the resources that were used for this query
OCIFreeStatement($row_count);

// We need to prepare the query that will print the results as a page. I will
// explain the query to you in detail.

// If no page was specified in the url (ex. http://mysite.com/result.php?page=2),
// set it to page 1.
if (empty($page) || $page == 0) {
$page = 1;
}

// The start range from where the results should be printed
$start_range = (($page - 1) * $display_rows) + 1;

// The end range to where the results should be printed
$end_range = $page * $display_rows;

// The main query. It consists of 3 "SELECT" statements nested into each
// other. The center query is the query you would normally use to return the
// records you want. Do you ordering and "WHERE" clauses in this statement.
// We select the rows to limit our results but because the row numbers are
// assigned to the rows before any ordering is done, lets the code print the
// result unsorted.
// The second nested "SELECTED" assigns the new row numbers to the result
// for us to select from.

$sql = "SELECT PK_ID, FIELD1, FIELD2, FIELD3, ROW_NO FROM (SELECT PK_ID, ";
$sql .= "FIELD1, FIELD2, FIELD3, ROWNUM ROW_NO FROM (SELECT PK_ID, FIELD1, ";
$sql .= "FIELD2, FIELD3 FROM SAMPLE_TABLE ORDER BY FIELD3)) WHERE ROW_NO BETWEEN ";
$sql .= $start_range." AND ".$end_range;

// start results formatting
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";

if ($num_rows != 0) {

// Parse the SQL string & execute it
$rs=OCIParse($OracleDBConn, $sql);
OCIExecute($rs);

// get number of columns for use later
$num_columns = OCINumCols($rs);

while (OCIFetch($rs)){
echo "";
for ($i = 1; $i $column_value = OCIResult($rs,$i);
echo "";
}
echo "";
}

} else {

// Print a message stating that no records was found
echo "";
}

// Close the table
echo "
PK IDField 1Field 2Field 3Row No
$column_value
Sorry! No records was found
";

// free resources and close connection
OCIFreeStatement($rs);
OCILogoff($OracleDBConn);

?>


// Here we will print the links to the other pages

// Calculating the amount of pages
if ($num_rows % $display_rows == 0) {
$total_pages = $num_rows / $display_rows;
} else {
$total_pages = ($num_rows / $display_rows) + 1;
settype($total_pages, integer); // Rounding the variable
}

// If this is not the first page print a link to the previous page
if ($page != 1) {
echo "Previous";
}

// Now we can print the links to the other pages
for ($i = 1; $i if ($page == $i){
// Don't print the link to the current page
echo " ".$i;
} else {
//Print the links to the other pages
echo " ".$i."";
}
}

// If this is not the last page print a link to the next page
if ($page echo " Next";
}

?>


// I'm just adding this section to print some of the variables for extra info
// and some debugging

echo "

Total pages: ".$total_pages."

";
echo "

Number of records: ".$num_rows."

";
echo "

The SQL Query is: ".$sql."

";

?>






本網(wǎng)站聲明
本文內(nèi)容由網(wǎng)友自願投稿,版權(quán)歸原作者所有。本站不承擔(dān)相應(yīng)的法律責(zé)任。如發(fā)現(xiàn)涉嫌抄襲或侵權(quán)的內(nèi)容,請聯(lián)絡(luò)admin@php.cn

熱AI工具

Undress AI Tool

Undress AI Tool

免費脫衣圖片

Undresser.AI Undress

Undresser.AI Undress

人工智慧驅(qū)動的應(yīng)用程序,用於創(chuàng)建逼真的裸體照片

AI Clothes Remover

AI Clothes Remover

用於從照片中去除衣服的線上人工智慧工具。

Clothoff.io

Clothoff.io

AI脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱工具

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發(fā)環(huán)境

Dreamweaver CS6

Dreamweaver CS6

視覺化網(wǎng)頁開發(fā)工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

熱門話題

Laravel 教程
1597
29
PHP教程
1488
72
華為GT3 Pro和GT4的差異是什麼? 華為GT3 Pro和GT4的差異是什麼? Dec 29, 2023 pm 02:27 PM

許多用戶在選擇智慧型手錶的時候都會選擇的華為的品牌,其中華為GT3pro和GT4都是非常熱門的選擇,不少用戶都很好奇華為GT3pro和GT4有什麼區(qū)別,下面就給大家介紹一下二者。華為GT3pro和GT4有什麼差別一、外觀GT4:46mm和41mm,材質(zhì)是玻璃鏡板+不鏽鋼機身+高分纖維後殼。 GT3pro:46.6mm和42.9mm,材質(zhì)是藍寶石玻璃鏡+鈦金屬機身/陶瓷機身+陶瓷後殼二、健康GT4:採用最新的華為Truseen5.5+演算法,結(jié)果會更加的精準(zhǔn)。 GT3pro:多了ECG心電圖和血管及安

2 個月不見,人形機器人 Walker S 會摺衣服了 2 個月不見,人形機器人 Walker S 會摺衣服了 Apr 03, 2024 am 08:01 AM

機器之能報道編輯:吳昕國內(nèi)版的人形機器人+大模型組隊,首次完成疊衣服這類複雜柔性材料的操作任務(wù)。隨著融合了OpenAI多模態(tài)大模型的Figure01揭開神秘面紗,國內(nèi)同行的相關(guān)進展一直備受關(guān)注。就在昨天,國內(nèi)"人形機器人第一股"優(yōu)必選發(fā)布了人形機器人WalkerS深入融合百度文心大模型後的首個Demo,展示了一些有趣的新功能?,F(xiàn)在,得到百度文心大模型能力加持的WalkerS是這個樣子的。和Figure01一樣,WalkerS沒有走動,而是站在桌子後面完成一系列任務(wù)。它可以聽從人類的命令,折疊衣物

修復(fù):截圖工具在 Windows 11 中不起作用 修復(fù):截圖工具在 Windows 11 中不起作用 Aug 24, 2023 am 09:48 AM

為什麼截圖工具在Windows11上不起作用了解問題的根本原因有助於找到正確的解決方案。以下是截圖工具可能無法正常工作的主要原因:對焦助手已開啟:這可以防止截圖工具開啟。應(yīng)用程式損壞:如果截圖工具在啟動時崩潰,則可能已損壞。過時的圖形驅(qū)動程式:不相容的驅(qū)動程式可能會幹?jǐn)_截圖工具。來自其他應(yīng)用程式的干擾:其他正在運行的應(yīng)用程式可能與截圖工具衝突。憑證已過期:升級過程中的錯誤可能會導(dǎo)致此issu簡單的解決方案這些適合大多數(shù)用戶,不需要任何特殊的技術(shù)知識。 1.更新視窗與Microsoft應(yīng)用程式商店應(yīng)用程

Vue專案中如何實現(xiàn)資料的分頁與顯示最佳化 Vue專案中如何實現(xiàn)資料的分頁與顯示最佳化 Oct 15, 2023 am 09:27 AM

Vue專案中實現(xiàn)資料的分頁和顯示優(yōu)化在Vue專案中,當(dāng)頁面需要展示大量資料時,通常需要進行資料的分頁和顯示最佳化以提高使用者體驗,本文將介紹如何使用Vue實現(xiàn)資料的分頁和顯示最佳化,並提供具體的程式碼範(fàn)例。一、資料分頁資料分頁是指將大量資料依照一定的規(guī)則分割成多頁,並在頁面上進行分頁顯示。 Vue專案中可以使用下列步驟來實現(xiàn)資料分頁:定義資料來源首先,定義一個包含所有數(shù)

如何修復(fù)無法連線到iPhone上的App Store錯誤 如何修復(fù)無法連線到iPhone上的App Store錯誤 Jul 29, 2023 am 08:22 AM

第1部分:初始故障排除步驟檢查蘋果的系統(tǒng)狀態(tài):在深入研究複雜的解決方案之前,讓我們先從基礎(chǔ)知識開始。問題可能不在於您的設(shè)備;蘋果的伺服器可能會關(guān)閉。造訪Apple的系統(tǒng)狀態(tài)頁面,查看AppStore是否正常運作。如果有問題,您所能做的就是等待Apple修復(fù)它。檢查您的網(wǎng)路連接:確保您擁有穩(wěn)定的網(wǎng)路連接,因為「無法連接到AppStore」問題有時可歸因於連接不良。嘗試在Wi-Fi和行動數(shù)據(jù)之間切換或重置網(wǎng)路設(shè)定(「常規(guī)」>「重置」>「重置網(wǎng)路設(shè)定」>設(shè)定)。更新您的iOS版本:

php提交表單通過后,彈出的對話框怎樣在當(dāng)前頁彈出,該如何解決 php提交表單通過后,彈出的對話框怎樣在當(dāng)前頁彈出,該如何解決 Jun 13, 2016 am 10:23 AM

php提交表單通過后,彈出的對話框怎樣在當(dāng)前頁彈出php提交表單通過后,彈出的對話框怎樣在當(dāng)前頁彈出而不是在空白頁彈出?想實現(xiàn)這樣的效果:而不是空白頁彈出:------解決方案--------------------如果你的驗證用PHP在后端,那么就用Ajax;僅供參考:HTML code

如何使用 iPadOS 17.4 優(yōu)化 iPad 電池壽命 如何使用 iPadOS 17.4 優(yōu)化 iPad 電池壽命 Mar 21, 2024 pm 10:31 PM

如何使用iPadOS17.4優(yōu)化iPad電池壽命延長電池續(xù)航時間是移動設(shè)備體驗的關(guān)鍵,iPad是一個很好的例子。如果您覺得iPad電池消耗速度過快,不用擔(dān)心,在iPadOS17.4中有許多技巧和調(diào)整可以顯著延長設(shè)備的運行時間。本深入指南的目標(biāo)不僅僅是提供信息,而是改變您使用iPad的方式,增強您的整體電池管理,并確保您可以在無需充電的情況下更長時間地依賴您的設(shè)備。通過采用此處概述的做法,您朝著更高效、更謹(jǐn)慎地使用技術(shù)邁出了一步,這些技術(shù)是根據(jù)您的個人需求和使用模式量身定制的。識別主要的能量消耗者

watch4pro好還是gt好 watch4pro好還是gt好 Sep 26, 2023 pm 02:45 PM

watch4pro和gt各自具有不使用的特點和適用場景,如果注重功能的全面性、高性能和時尚外觀,同時願意承擔(dān)較高的價格,那麼Watch 4 Pro可能更適合。如果對功能要求不高,更注重電池續(xù)航力和價格的合理性,那麼GT系列可能更適合。最終的選擇應(yīng)根據(jù)個人需求、預(yù)算和喜好來決定,建議在購買前仔細考慮自己的需求,並參考各種產(chǎn)品的評測和比較,以做出更明智的選擇。

See all articles