用戶從一個表中給出一組輸入,例如“request_table”a:
| 用戶輸入 | 價值 | 資料庫中的欄位名稱 |
|---|---|---|
| 產品 | 訂金 | 產品類別 |
| 存款期限(月) | 24 | 學期 |
| 存款金額 | 200,000 | 數量 |
| 顧客型別 | 慈善機構 | 顧客型別 |
| 現有客戶 | 是 | 現有客戶 |
想使用產品選擇來挑選嵌入在“pricing_table”b 中的 SQL 腳本,其中價格由組件組成,每個組件都受上述一個或多個輸入的影響:
| 產品 | 網格 | 措施 | 價值1 | 值1Min | 值1最大值 | 價值2 | Value2Min | 價值2最大值 | 價格 |
|---|---|---|---|---|---|---|---|---|---|
| 訂金 | 期限_金額 | a.term>=b.value1min and a.term<b.value2 max and a.amount>=b.value2min and a.amount<b.value2max | 0 | 12 | 0 | 100000 | 1 | ||
| 訂金 | 期限_金額 | a.term>=b.value1min and a.term<b.value2 max and a.amount>=b.value2min and a.amount<b.value2max | 12 | 36 | 0 | 100000 | 2 | ||
| 訂金 | 期限_金額 | a.term>=b.value1min and a.term<b.value2 max and a.amount>=b.value2min and a.amount<b.value2max | 36 | 9999 | 0 | 100000 | 3 | ||
| 訂金 | 期限_金額 | a.term>=b.value1min and a.term<b.value2 max and a.amount>=b.value2min and a.amount<b.value2max | 0 | 12 | 100000 | 500000 | 1.1 | ||
| 訂金 | 期限_金額 | a.term>=b.value1min and a.term<b.value2 max and a.amount>=b.value2min and a.amount<b.value2max | 12 | 36 | 100000 | 500000 | 2.1 | ||
| 訂金 | 期限_金額 | a.term>=b.value1min and a.term<b.value2 max and a.amount>=b.value2min and a.amount<b.value2max | 36 | 9999 | 100000 | 500000 | 3.1 | ||
| 訂金 | 期限_金額 | a.term>=b.value1min and a.term<b.value2 max and a.amount>=b.value2min and a.amount<b.value2max | 0 | 12 | 500000 | 99999999 | 1.2 | ||
| 訂金 | 期限_金額 | a.term>=b.value1min and a.term<b.value2 max and a.amount>=b.value2min and a.amount<b.value2max | 12 | 36 | 500000 | 99999999 | 2.2 | ||
| 訂金 | 期限_金額 | a.term>=b.value1min and a.term<b.value2 max and a.amount>=b.value2min and a.amount<b.value2max | 36 | 9999 | 500000 | 99999999 | 3.2 | ||
| 訂金 | 顧客型別 | a.customer_type=b.value1 | 個人的 | 0 | |||||
| 訂金 | 顧客型別 | a.customer_type=b.value1 | 慈善機構 | 0.1 | |||||
| 訂金 | 顧客型別 | a.customer_type=b.value1 | 商業 | -0.1 | |||||
| 訂金 | 現有_客戶 | a.existing_customer=b.value1 | 是 | 0.1 | |||||
| 訂金 | 現有_客戶 | a.existing_customer=b.value1 | ? | 0 |
查詢在哪里:從定價表中選擇不同的度量,其中產品=(從請求表中選擇產品型別)。這提供了多個保存 SQL 邏輯的行。希望在回圈中運行此 SQL 邏輯,例如: select b.* from pricing_table b where :measures 這將回傳匹配特定指標的所有行。這樣做是因為輸入中的確切列可以增長到數百,所以不要一個非常寬的表。任何幫助表示感謝。
我已經創建了表,但不確定如何回圈測量,并在回圈查詢中應用該欄位中的值謝謝。
uj5u.com熱心網友回復:
在 PL/SQL 流水線函式中,您可以構建 SQL 查詢并在其上打開游標,回圈結果并對行進行 PIPE。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/529295.html
標籤:甲骨文循环动态的批量收集
