參考資料:http://jayantaapps.blogspot.tw/2011/11/oracle-reports-builder-query.html:
Lexical Parameter
使用 & 這個符號當作關鍵字
- Data Model > Queries > SQL Query Statement
SELECT T.AAA, T.BBB FROM TABLE T WHERE 1 = 1 AND &CP_PARAMETER
- Data Model > Placeholder Column
Add
CP_PARAMETER
Set
Datatype = Character
Width = 200
….. - Report Tiggers > BEFORE REPORT
FUNCTION BEFOREREPORT RETURN BOOLEAN IS BEGIN :CP_PARAMETER = ' AND T.AAA = ' TRUE ' AND T.BBB = BLUE ' RETURN(TRUE); END;
Bind Variable
使用 : 這個符號當作關鍵字
- Application Developer > Concurrent Progam > Parameters
Set
Token = P_PARAMETER
….. - Data Model > Queries > SQL Query Statement
SELECT T.AAA, T.BBB FROM TABLE T WHERE 1 = 1 AND T.AAA = :P_PARAMETER
When user open the report and input parameter
Other
Data Model > Queries > SQL Query Statement
&P_PARAMETER2、Data Model > User Parameters
Add
P_PARAMETER
Set
Datatype = Character
Width = 200
Inital Value = SELECT 'This is test' FROM DUAL
…..
沒有留言:
張貼留言