- Rexx 教程
- Rexx-主頁
- Rexx-概述
- Rexx-環境
- Rexx-安裝
- Rexx-外掛安裝
- Rexx-基本語法
- Rexx-資料型別
- Rexx-變數
- Rexx-運算子
- Rexx-陣列
- Rexx-迴圈
- Rexx-決策制定
- Rexx-數字
- Rexx-字串
- Rexx-函式
- Rexx-棧
- Rexx-檔案 I/O
- Rexx-檔案的函式
- Rexx-子程式
- Rexx-內建函式
- Rexx-系統命令
- Rexx-XML
- Rexx-Regina
- Rexx-解析
- Rexx-訊號
- Rexx-除錯
- Rexx-錯誤處理
- Rexx-面向物件
- Rexx-可移植性
- Rexx-擴充套件函式
- Rexx-指令
- Rexx-實現
- Rexx-Netrexx
- Rexx-Brexx
- Rexx-資料庫
- 手持和嵌入式
- Rexx-效能
- Rexx-最佳程式設計實踐
- Rexx-圖形使用者介面
- Rexx-Reginald
- Rexx-網路程式設計
Rexx-讀取操作
對任何資料庫執行讀取操作是指從資料庫中獲取一些有用的資訊。一旦我們的資料庫連線建立,就可以對該資料庫進行查詢。
以下示例顯示如何從 employee 表中獲取所有記錄。
示例
/* Main program */ Call RxFuncAdd 'SQLLoadFuncs', 'rexxsql', 'SQLLoadFuncs' Call SQLLoadFuncs if SQLConnect(c1,'testuser','test123','testdb') == 0 then say 'Connect Succedded' if SQLCommand(u1,"use testdb") == 0 then say 'Changed database to testdb' sqlstr = "select first_name,last_name,age,sex,income from employee" say SQLCommand(c2,sqlstr) say c2.first_name.1 say c2.last_name.1 say c2.age.1 say c2.sex.1 say c2.income.1
上面程式的輸出如下圖所示。
Connect Succedded Changed database to testdb 0 Mac MOhan 20 M 2000
rexx_databases.htm
廣告