Dynamic header creation using SQL
Hi Gurus,
I need your help again. I have a query which uses a date parameter to populate a report. The report pulls out data from the user entered date to minus eleven months. The report counts totals calls registered each month. I have the query working fine but I need help in populating the header.
For ex - suppose I run the query on todays date (18-Jan-2012)
The report header will be -
Jan Feb Mar Apr ....Dec
But I want the header to be populated in the following format -
Jan 2012 Feb 2011 Mar 2011 Apr 2011....Dec 2011
And for ex if I run the report for a future date say (21-May-2012)
The header will be in the following format -
Jan 2012....May 2012 Jun 2011 Jul 2011 .......Dec 2011.
Please let me know if I can populate the header using SQL. Any help is greatly appreciated.
Hi Tenacious,
You wrote:
I want the header to be populated in the dynamic format with the year value concanated to the Month column.My script does that; you can look one more time at the output in my first post, and also in my second post.
And if you want another example, when we replace 18-Jan-2012 by 21-May-2012, we have the following:
SQL> select to_char(col,'Monyyyy') col_date
2 from
3 (select
4 add_months(to_date('21-May-2012','dd-Mon-yyyy'),
5 -level + 1) col
6 from dual
7 connect by level <= extract(month from to_date('21-May-2012','dd-Mon-yyyy')
8 union
9 select
10 add_months(to_date('21-May-2012','dd-Mon-yyyy')
11 , level - 12 )
12 from dual
13 connect by level <= 12 - extract(month from to_date('21-May-2012','dd-Mon-y
yyy')))
14 order by extract(year from col) desc, extract(month from col);
COL_DAT
Jan2012
Feb2012
Mar2012
Apr2012
May2012
Jun2011
Jul2011
Aug2011
Sep2011
Oct2011
Nov2011
COL_DAT
Dec2011
12 rows selected.
SQL>
Similar Messages
-
Dynamic Dimesion Building using SQL Interface
I am attempting to use SQL Interface in Essbase 6.5 to dynamically build the account dimension from a PeopleSoft tree. The view works fine in SQL worksheet, but the last UNION statement does not work using the SQL interface. Here is the SQL that is generated: [SELECT * FROM ps_n_pre_acc_vw WHERE 1 = 1 order by 6,4,5,3] is generated. Here is the view:SELECT B.TREE_NODE AS PARENT , A.TREE_NODE AS CHILD , (A.TREE_NODE||' : '||C.DESCR) , b.tree_node_num AS num , a.tree_node_num AS c_tree_node_num , 'A' AS ord FROM SYSADM.PSTREENODE A , SYSADM.PSTREENODE B , SYSADM.PS_TREE_NODE_TBL C WHERE A.TREE_NAME = 'PRE_CUBE' AND A.SETID = 'NW' AND A.EFFDT = ( SELECT MAX(EFFDT) FROM PSTREELEAF WHERE TREE_NAME = 'PRE_CUBE') AND A.TREE_NAME = B.TREE_NAME AND A.SETID = B.SETID AND A.EFFDT = B.EFFDT AND A.PARENT_NODE_NUM = B.TREE_NODE_NUM AND A.TREE_NODE = C.TREE_NODE AND A.SETID = C.SETID AND C.EFF_STATUS = 'A' AND C.EFFDT = ( SELECT MAX(EFFDT) FROM SYSADM.PS_TREE_NODE_TBL X WHERE C.TREE_NODE = X.TREE_NODE AND C.SETID = X.SETID) UNION SELECT B.TREE_NODE AS PARENT , (A.RANGE_FROM||' : '||DESCR) AS child , A.RANGE_FROM , b.tree_node_num AS num , a.tree_node_num AS c_tree_node_num , 'B' AS ord FROM SYSADM.PSTREELEAF A , SYSADM.PSTREENODE B , SYSADM.PS_GL_ACCOUNT_TBL C WHERE A.TREE_NAME = 'PRE_CUBE' AND A.SETID = 'NW' AND A.EFFDT = ( SELECT MAX(EFFDT) FROM PSTREELEAF WHERE TREE_NAME = 'PRE_CUBE') AND A.TREE_NAME = B.TREE_NAME AND A.EFFDT = B.EFFDT AND A.SETID = B.SETID AND A.TREE_NODE_NUM = B.TREE_NODE_NUM AND C.SETID = A.SETID AND A.RANGE_FROM = C.ACCOUNT AND C.EFFDT = ( SELECT MAX(EFFDT) FROM SYSADM.PS_GL_ACCOUNT_TBL X WHERE C.ACCOUNT = X.ACCOUNT AND c.setid = x.setid) UNION SELECT B.TREE_NODE AS PARENT , (D.ACCOUNT||' : '||DESCR) AS child , D.ACCOUNT , b.tree_node_num AS num , a.tree_node_num AS c_tree_node_num , 'B' AS ord FROM pstreeleaf a , pstreenode b , PS_GL_ACCOUNT_TBL D WHERE a.tree_name = 'PRE_CUBE' AND a.effdt = '01-JAN-2001' AND A.SETID = 'NW' AND A.RANGE_FROM <> A.RANGE_TO AND A.TREE_NAME = B.TREE_NAME AND A.SETID = B.SETID AND A.EFFDT = B.EFFDT AND A.TREE_NODE_NUM = B.TREE_NODE_NUM AND D.ACCOUNT BETWEEN A.RANGE_FROM AND A.RANGE_TO AND D.SETID = 'NW' AND D.EFFDT = ( SELECT MAX(EFFDT) FROM PS_GL_ACCOUNT_TBL X WHERE D.ACCOUNT = X.ACCOUNT AND D.SETID = X.SETID)I created a view from the last union section of the SQL and Essbase returns a zero rows found error, although when I ran the view in SQL worksheet I was able to get rows returned. Any ideas on why the view does not return the expected results in Essbase?
before your query do:
<cfsavecontent
variable="emailmessagebody"><cfinclude
template="#mancbPath#/mancb_body.cfm"></cfsavecontent>
then in your query instead of using '<cfinclude ...>'
use
'#emailmessagebody#'
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com/ -
Dynamic Table Creation using RTTS - Question on Issue
I am using the RTTS services to dynamically create a table. However, when I attempt to use the get_components method it does not return all the components for all tables that I am working with.
Cases and End Results
1) Created structure in data dictionary get_components works.
2) Pass PA0001, P0001 or T001P to get_components and I do not receive the correct results. It only returns a small subset of these objects. The components table has all the entries; however, the get_components method only returns about 4 rows.
Can you explain this and point me to the correct logic sequence? I would like the logic to work with all tables.
Code excerpt below:
The logic for the get components works for case 1, but not case 2. When I pass into this method a "Z" custom table or structure name for parameter structure_name and the get_components() method executes and returns the correct results. However, when I pass in any of the objects listed above in case 2, the get_components method does not return the correct number of entries. When I check typ_struct which is populated right before the get_components line, I see the correct number of components in the components table.
method pb_add_column_headings .
constants: c_generic_struct type c length 19 value 'ZXX_COLUMN_HEADINGS'.
data: cnt_lines type sytabix,
rf_data type ref to data,
typ_field type ref to cl_abap_datadescr,
typ_struct type ref to cl_abap_structdescr,
typ_table type ref to cl_abap_tabledescr.
data: wa_col_headings type ddobjname.
data: rf_tbl_creation_exception type ref to
cx_sy_table_creation,
rf_struct_creation_exception type ref to
cx_sy_struct_creation.
data: t_comp_tab type
cl_abap_structdescr=>component_table,
t_comp_tab_new like t_comp_tab,
t_comp_tab_imported like t_comp_tab.
field-symbols: <fs_comp> like line of t_comp_tab,
<fs_col_headings_tbl> type any table.
**Get components of generic structure
wa_col_headings = c_generic_struct.
typ_struct ?= cl_abap_typedescr=>describe_by_name(
wa_col_headings ).
T_COMP_TAB = typ_struct->get_components( ).
**Determine how many components in imported structure.
typ_struct ?= cl_abap_typedescr=>describe_by_name(
structure_name ).
t_comp_tab_imported = typ_struct->get_components( ).
cnt_lines = lines( t_comp_tab_imported[] ).Hi Garton,
1. GET_COMPONENT_LIST
Use this FM.
It gives all fieldnames.
2. Use this code (just copy paste)
REPORT abc.
DATA : cmp LIKE TABLE OF rstrucinfo WITH HEADER LINE.
DATA : pa0001 LIKE TABLE OF pa0001 WITH HEADER LINE.
CALL FUNCTION 'GET_COMPONENT_LIST'
EXPORTING
program = sy-repid
fieldname = 'PA0001'
TABLES
components = cmp.
LOOP AT cmp.
WRITE :/ cmp-compname.
ENDLOOP.
regards,
amit m. -
Dynamic Dynpro Creation using RPY_DYNPRO_INSERT
Hi there,
Did anyone of you already worked with this function and could provide me some information about the following points?
1. How do I have to fill the CONTAINERS and FIELDS_TO_CONTAINERS tables to let the Dynpro show me e.g. a text field with the text "Hello World"? (The Dynpro header works fine and I also get the Dynpro shown, but without any fields, also the Flow Logic works fine) Which fields of the appropriate structures do I have to fill in which way?
2. Due to my task I need to generate the Screen at runtime and every time it is called I need a new one. Is there a possibility to delete these Screens dynamically again? So the program does not create thousands of Screens over time.
Thank you in advance for your help.
Kind Regards,
SebastianHi there,
Did anyone of you already worked with this function and could provide me some information about the following points?
1. How do I have to fill the CONTAINERS and FIELDS_TO_CONTAINERS tables to let the Dynpro show me e.g. a text field with the text "Hello World"? (The Dynpro header works fine and I also get the Dynpro shown, but without any fields, also the Flow Logic works fine) Which fields of the appropriate structures do I have to fill in which way?
2. Due to my task I need to generate the Screen at runtime and every time it is called I need a new one. Is there a possibility to delete these Screens dynamically again? So the program does not create thousands of Screens over time.
Thank you in advance for your help.
Kind Regards,
Sebastian -
DYNAMIC TABLE CREATION USING JSP
I WANT TO CREATE A DATABASE TABLE IN AN INTERACTIVE WAY ie MY QUESTION IS: HOW TO CREATE A TABLE USING JSP WITH TWO ARRAYS(FIRST ARRAY CONTAINS FIELD(COLUMN) NAMES AND THE SECOND ARRAY CONTAINS ITS CORRESPONDING DATATYPE)BOTH ARRAYS ARE OF VARYING SIZE.IF THE USER ENTERS SUPPOSE '6' AS THE INPUT TO FORM A TABLE OF 6 FIELDS SO, THE QUERY SHOULD BE DYNAMICALLY FORME USING THE ARRAY NAME FOR FIELD AND THE ARRANAME FOR ITS CORRESPONDING DATATYPE.HAVE ANY IDEA ON THIS PLEASE LET ME KNOW.
THANKSu need to know quite a few java technologies to make archieve your dream.
JDBC, dynamic array and JSP.
after reading tutorial regarding to these 3 materials, you should be able to get your job done. -
Dynamic table creation using JDBC
hi all, i am working in JDBC and using prepared statements.the problem i have is i need to create and read from tables,dynamically and i should also create tables with keys dynamically,i.e the user gives the table name and i should create it using JDBC.the user does not enter the full query he just types the table name.i am using oracle as backend.i have tried prepared statements to retrieve datas from tables whose names r given dynamically like
"select * from ?"
and then using
setString(1,the variable which holds the table name);
but this doesnt seem to work.it says invalid table name.how can i do this.i shd also create tables the same way like
"create table ? ..."
is there a way out of this problem or is there any other type of statement that i can use.please give a detailed example.thanks in advance.Usually when I work with Oracle DBA's they get real excited when I suggest that the application could create the tables dynamically. Because this means that there is absolutely no chance that there is a coherent implemetation of table allocation.
Seemed like a good point to me. -
Dynamic Tree Creation using JSP, Struts framework
I urgently require tips/information/code snippet for creating a Dynamic Tree structure.
Tree is the hierarchical folder structure that we see in windows operating system.
Dynamic tree in the sense that all nodes shall be populated from database & a radio button shall be present at each node that can be selected & submitted to form.
Tree should be done using JSP (& if required Javascript).
I am using Struts framework .
[email protected]u need to know quite a few java technologies to make archieve your dream.
JDBC, dynamic array and JSP.
after reading tutorial regarding to these 3 materials, you should be able to get your job done. -
Dynamic app creation using MXML?
I'm working on creating a small quiz application which will
be driven by pre-formatted external XML. I have designed various
custom question canvases for each of the question types (MCQ, short
answer, match-pairs etc.) and I'm wondering if there is some way to
implement the main application using MXML instead of ActionScript?
I've managed to hard-code the order of the questions, knowing
which canvases are needed in which order, but I need to be able to
detect the question type from the XML (that bit I can manage) and
then add the appropriate question canvas component in order in my
tabNavigator.
Essentially, I'm trying to replicate the function of a
switch:case clause in MXML. Does anyone know if this is possible?
I've started trying to implement it in ActionScript, but I'm a bit
of a newbie to AS3, and I keep getting errors I don't understand,
like "Access of undefined property" where I'm referring to an
object I've just declared and instantiated in the previous line of
code. E.g (anywhere I use mainPanel):
<mx:Script>
<![CDATA[
import mx.controls.Text;
import mx.containers.Canvas;
import mx.containers.Panel;
var mainPanel:Panel = new Panel();
Root.addChild(mainPanel);
mainPanel.layout = "absolute";
mainPanel.setStyle("left", 10);
mainPanel.setStyle("top", 10);
mainPanel.setStyle("right", 10);
mainPanel.setStyle("bottom", 10);
var testPage:Canvas = new Canvas();
var numQuestions:int = quizQns.childNodes.length;
var qTypes:Array = new Array(numQuestions);
var textLine:Array = new Array(numQuestions);
]]>
</mx:Script>You can declare and initialize variables outside functions in
your script block, but for most else you need to do it in a
function. I would continue learning AS3 as it will give you real
flexibility and power.
<?xml version="1.0"?>
<mx:Application xmlns:mx="
http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:Script>
<![CDATA[
import mx.controls.Text;
import mx.containers.Canvas;
import mx.containers.Panel;
private var mainPanel:Panel;
private var testPage:Canvas = new Canvas();
private var numQuestions:int = 10;
// private var numQuestions:int = quizQns.childNodes.length;
private var qTypes:Array = new Array(numQuestions);
private var textLine:Array = new Array(numQuestions);
public function init():void {
mainPanel = new Panel();
addChild(mainPanel);
mainPanel.layout = "absolute";
mainPanel.setStyle("left", 10);
mainPanel.setStyle("top", 10);
mainPanel.setStyle("right", 10);
mainPanel.setStyle("bottom", 10);
]]>
</mx:Script>
</mx:Application> -
Dynamically replacing pattern using SQL only
Hi ,
Table File name
CREATE TABLE file_name_table AS
( SELECT 'FILE_A_[PATTERN1]_[PETTERN2].txt' AS file_name FROM DUAL
UNION
SELECT 'FILE_B_[PATTERN3].txt' FROM DUAL
UNION
SELECT 'FILE_B_[PATTERN3]_[PATTERN4].txt' FROM DUAL)Pattern Table
CREATE TABLE pattern_table AS
( SELECT '[PATTERN1]' AS pattern, 'P00191' AS pattern_value FROM DUAL
UNION
SELECT '[PATTERN2]' AS pattern, 'P00293' AS pattern_value FROM DUAL
UNION
SELECT '[PATTERN3]' AS pattern, 'p567' AS pattern_value FROM DUAL
UNION
SELECT '[PATTERN4]' AS pattern, 'p879' AS pattern_value FROM DUAL
UNION
SELECT '[PATTERN5]' AS pattern, 'p005' AS pattern_value FROM DUAL)Now I need a view which will show the follwing output
'FILE_A_P00191_P00293.txt'
'FILE_B_p567.txt'
'FILE_B_p567_p879.txt'basically the in the output the pattern will be matched and the pattern in file name will be replaced by the pattern value of pattern table. Hope I am clear. Please help.
Edited by: Mr Lonely on May 22, 2013 1:25 PM -- Fixed the output.Hi Jeneesh,
This is working excellent.
However I have a small problem.
If filename contains something in [] for example filename_[FIXED] and that pattern does exists in the pattern table then it's replacing it with null.
For example.
FILE_NAME NEW_FNAME
FILE_B_[PATTERN3].txt FILE_B_p567.txt
TEST_[TEST_PATTERN].txt TEST_.txt
TEST_[TEST_PAT].txt TEST_LOL.txt
FILE_A_[PATTERN1]_[PETTERN2].txt FILE_A_P00191_.txt
FILE_B_[PATTERN3]_[PATTERN4].txt FILE_B_p567_p879.txt Edited by: Mr Lonely on May 22, 2013 3:21 PM -
How to send an email with attachment to dynamic emial address using PL/SQL
Hi,
i want to send an automated email with attachment everyday to differnet people so number people is not static.
so is it any way using PL/SQL ?
thanks for your support!i want to send an automated email with attachment everyday to differnet people so number people is not static.
Why? Explain it.
You can create a table and store your email id through front-end application day to day.
The table should look like this ->
satyaki>
satyaki>select * from v$version;
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for 32-bit Windows: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
Elapsed: 00:00:00.04
satyaki>
satyaki>
satyaki>create table email_master
2 (
3 email_grp_header varchar2(30) not null,
4 craete_time timestamp,
5 constraints pk_header primary key(email_grp_header)
6 );
Table created.
Elapsed: 00:00:02.12
satyaki>
satyaki>create table email_chld
2 (
3 email_grp_header varchar2(30) not null,
4 email_recepient varchar2(100),
5 craete_time timestamp,
6 constraint fk_header foreign key(email_grp_header) references email_master(email_grp_header)
7 );
Table created.
Elapsed: 00:00:00.09
satyaki>
satyaki>
satyaki>insert into email_master values('GRP_INVENTORY',systimestamp);
1 row created.
Elapsed: 00:00:00.07
satyaki>
satyaki>
satyaki>insert into email_master values('GRP_PURCHASE',systimestamp);
1 row created.
Elapsed: 00:00:00.03
satyaki>
satyaki>commit;
Commit complete.
Elapsed: 00:00:00.04
satyaki>
satyaki>select * from email_master;
EMAIL_GRP_HEADER CRAETE_TIME
GRP_INVENTORY 24-OCT-08 08.55.36.190000 PM
GRP_PURCHASE 24-OCT-08 08.55.54.481000 PM
Elapsed: 00:00:00.18
satyaki>
satyaki>
satyaki>insert into email_chld values('GRP_INVENTORY','[email protected]',systimestamp);
1 row created.
Elapsed: 00:00:00.07
satyaki>
satyaki>insert into email_chld values('GRP_INVENTORY','[email protected]',systimestamp);
1 row created.
Elapsed: 00:00:00.04
satyaki>
satyaki>insert into email_chld values('GRP_INVENTORY','[email protected]',systimestamp);
1 row created.
Elapsed: 00:00:00.03
satyaki>
satyaki>insert into email_chld values('GRP_PURCHASE','[email protected]',systimestamp);
1 row created.
Elapsed: 00:00:00.03
satyaki>
satyaki>insert into email_chld values('GRP_PURCHASE','[email protected]',systimestamp);
1 row created.
Elapsed: 00:00:00.11
satyaki>commit;
Commit complete.
Elapsed: 00:00:00.05
satyaki>
satyaki>select * from email_chld;
EMAIL_GRP_HEADER EMAIL_RECEPIENT CRAETE_TIME
GRP_INVENTORY [email protected] 24-OCT-08 08.56.46.107000 PM
GRP_INVENTORY [email protected] 24-OCT-08 08.57.03.551000 PM
GRP_INVENTORY [email protected] 24-OCT-08 08.57.36.277000 PM
GRP_PURCHASE [email protected] 24-OCT-08 08.58.06.129000 PM
GRP_PURCHASE [email protected] 24-OCT-08 08.58.26.900000 PM
Elapsed: 00:00:00.10
satyaki>And, then based on the group header you can get the list of recipient and use it dynamically inside your PL/SQL Application.
Regards.
Satyaki De. -
Dynamic Receiver Determination using Soap header
Hi ,
I am trying to use a field in SOAP Header to determine the receivers dynamically.
1, Using XPATH gives me only values in the Payload and not the SOAP header. Is it possible to pull the value from the SOAP header to the payload and then do dynamic receiver determination.
2. Using Context Object is it possible to transfer the value of the field in SOAP header to variable header Xheadername1 and then use it to determine the receiver. I am having problems in passing the value of the field in soap header to XHeadername1.
Any help is appreciated and points will be awarded.
Joe VellaiparambilHi Joe,
This is a good blog by William, hope this is helpful.
/people/william.li/blog/2009/07/30/how-to-read-soap-header-information
Let us know if you need more information.
Regards,
Neetesh -
Dynamic Load Plan creation using scripting
Hello All,
We have a requirement to create load plans dynamically i.e using script groovy. Idea is that we will store interface scenarios in a table and then script will read these scenarios an create dynamic load plans. Now following are my question.
1) Is it possible to create load plans through script ? (different blogs on net claims that you can do anything or everything whatever ODI studio can do)
2) Any pointer what API to use for this task ? I am very new to scripting and have zero idea about how to go about it . if possible please suggest sample script to create load plans (I can see some sample to create interface,folder etc on net.)
Thanks in advance for your reply.
Thanks & RegardsODI SDK apis allows dynamic creation of Loadplans. Oracle Fusion Middleware Java API Reference for Oracle Data Integrator
Studio too uses these APIs for LP related operations so you should be able to do using these whatever studio allows.
You can find SDK samples at Oracle Data Integration Sample Code -
How to show the VALUE as the Column Header using SQL query?
Hi
I have a requirement to show the picked value as the column header using SQL query.
Example:
======
SELECT EMPNO FROM EMP
WHERE EMPNO=7934;
Result Should be:
7934
7934I have a requirement to show the picked value as the column header using SQL query.In sql*plus you can do
SQL> set verify on
SQL> def e = 7934
old: SELECT empno "&&e" FROM emp WHERE empno = &&e
new: SELECT empno "7934" FROM emp WHERE empno = 7934
SQL> SELECT empno "7934" FROM emp WHERE empno = 7934
7934
7934
1 row selected. -
Is there a solution for dynamic reports and using Denes' Export to Excel?
Oracle 10.2.0.4.0
Application Express 3.2.1.00.10
Hello all!
I am using Denes Kubicek's Export_Excel_Pkg in my application and I'm having trouble exporting reports based on report regions created using a PL/SQL function body returning SQL query. I realize this is not an Oracle supported package, but was hoping someone here could shed some light on it. When I open up the Excel file, I get an error such as: Report Values Error: ORA-06550: line 22, column 5: PL/SQL: ORA-00907: missing right parenthesis.
I've searched the forum and already have done as others suggested by modifying the REPLACE on the v_sql variable in Export_Excel_Pkg.Get_Usable_SQL, but it did not work. My assumption is that there is an issue with the value being passed to the wwv_flow_utilities.get_binds function. I could not find documentation on this function, but I'm thinking that it cannot extract the bind variables within a PL/SQL block. The report only works when I have just use SQL with bind variables...doesn't work for PL/SQL. Nor does it work for dynamic SQL reports that use a "lexical" parameter (e.g. using WHERE &p_and_condition.) to build the WHERE clause.
Has anyone come up with a work-around to this? I somehow need to be able to extract reports based on dynamic SQL (or PL/SQL) to Excel.
Help is appreciated!
This is my example of a report based on PL/SQL function:
DECLARE
v_sql VARCHAR2(4000);
BEGIN
v_sql := q'[SELECT UPPER(t1.olo_name) agency_title,
t1.class_code,
UPPER(t1.class_title) class_title,
t1.pay_plan,
t1.pay_grade_code,
COUNT(t1.appt_fte) total_employees,
SUM(t1.appt_fte) filled_fte,
AVG(DECODE(t2.pay_cycle_code,
'UB',((t1.wage_type1_amt_for_pay * 26)/t1.appt_fte),
'UM',((t1.wage_type1_amt_for_pay * 12)/t1.appt_fte),
0)) avg_annual_rate
FROM my_schema.table1 t1,
my_schema.table2 t2,
my_schema.table3 pro
WHERE t1.pos_wk = t2.pos_wk
AND t2.pos_rate_active_flag = 'Y'
AND t1.ops_ind = 'N'
AND t1.employee_type IN ('1','2')
AND pro.ROLE_CODE = :F101_DW_ROLE
AND pro.pos_role_orgs_active_flag = 'Y']';
IF :P_MULTI_OLO IS NOT NULL THEN
v_sql := v_sql || q'[ AND INSTR(':'||']' || v('P_MULTI_OLO') || q'['||':', ':'||t1.olo_code||':') > 0]';
END IF;
v_sql := v_sql || q'[GROUP BY UPPER(t1.olo_name), t1.class_code, UPPER(t1.class_title), t1.pay_plan, t1.pay_grade_code ORDER BY t1.class_code ASC, avg_annual_rate]';
RETURN v_sql;
END;This is my example using a SQL statement with a lexical parameter:
SELECT UPPER(t1.olo_name) agency_title,
t1.class_code,
UPPER(t1.class_title) class_title,
t1.pay_plan,
t1.pay_grade_code,
COUNT(t1.appt_fte) total_employees,
SUM(t1.appt_fte) filled_fte,
AVG(DECODE(t2.pay_cycle_code,
'UB',((t1.wage_type1_amt_for_pay * 26)/t1.appt_fte),
'UM',((t1.wage_type1_amt_for_pay * 12)/t1.appt_fte),
0)) avg_annual_rate
FROM my_schema.table1 t1,
my_schema.table2 t2,
my_schema.table3 pro
WHERE t1.pos_wk = t2.pos_wk
AND t2.pos_rate_active_flag = 'Y'
AND t1.ops_ind = 'N'
AND t1.employee_type IN ('1','2')
AND pro.ROLE_CODE = :F101_DW_ROLE
AND pro.pos_role_orgs_active_flag = 'Y'
&P63_AND_CONDITION.
GROUP BY UPPER(t1.olo_name),
t1.class_code,
UPPER(t1.class_title),
t1.pay_plan,
t1.pay_grade_code
ORDER BY t1.class_code ASC, avg_annual_rateThe *&P63_AND_CONDITION.* value is populated based on a "Before Header" computation under Page Rendering, using the logic below. It is then used by the SQL query defined in the reports region at run time.
DECLARE
v_sql VARCHAR2(4000) := NULL;
BEGIN
v_sql := ' ';
IF :P_MULTI_OLO IS NOT NULL THEN
v_sql := v_sql || q'[ AND INSTR(':'||']' || v('P_MULTI_OLO') || q'['||':', ':' || t1.olo_code || ':') > 0]';
END IF;
RETURN v_sql;
END;Did you get an answer for this?
-
Dynamic service invocation using ws addressing reply-to
Hi,
I am sending soap request contains ws addressing header with message id, reply-to values to invoke a async bpel process.
So can I invoke a web service inside async bpel using input reply-to value dynamically?
Do I need to create a dynamic partner link using invoke or can I use callbackclient?
Please share your inputs.
Thanks.Bharat,
You dont need a Business Event setup to invoke a BPEL process from PL/SQL unless you have a special case and you need to process the response from the BPEL process in a separate thread (or in background)..
For a straight call to BPEL process from PL/SQL, here is a sample script -
function "MYTEST0" return varchar2 AS
soap_request varchar2(30000);
soap_respond varchar2(30000);
http_req utl_http.req;
http_resp utl_http.resp;
resp XMLType;
i integer;
helpStr varchar2(30000);
BEGIN
soap_request:= '<?xml version = ''1.0'' encoding = ''UTF-8''?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="
http://xmlns.oracle.com/TestWS">
<env:Body>
<ns0:TestWSProcessRequest>
<ns0:input>abc</ns0:input>
</ns0:TestWSProcessRequest>
</env:Body>
</env:Envelope>
/* the BPEL process name is TestWS */
http_req:= utl_http.begin_request
( 'http://hostname:7777/orabpel/default/TestWS/1.0'
, 'POST'
, 'HTTP/1.1'
utl_http.set_header(http_req, 'Content-Type', 'text/xml');
utl_http.set_header(http_req, 'Content-Length', length(soap_request));
utl_http.set_header(http_req, 'SOAPAction', 'process');
utl_http.write_text(http_req, soap_request);
http_resp:= utl_http.get_response(http_req);
utl_http.read_text(http_resp, soap_respond);
utl_http.end_response(http_resp);
resp:= XMLType.createXML(soap_respond);
resp:= resp.extract('/soap:Envelope/soap:Body/child::node()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
helpStr := '';
i:=0;
loop
helpStr := helpStr || substr(soap_respond,1+ i*255,250);
i:= i+1;
if i*250> length(soap_respond)
then
exit;
end if;
end loop;
return helpStr;
END;
Maybe you are looking for
-
I'm having problem with exporting video from premiere pro cc 2014
I'm using Adobe Premiere Pro CC 2014 and I'm having problem with exporting video. When I click Export and media, the window for exporting appears and it starts exporting video. But after a few minutes, it looks like it has completed exporting video a
-
Just purchased Pages for our iMac. When I opened a resume template, it is in Spanish instead of English. How do I change it to English?
-
How to reuse deleted personnel number in sap
Dear All. how to reuse deleted personnel number in sap please help me Regards, Baqar Iqbal
-
Intensive course Adobe CS5 DreamWeaver & Flash
hi there I'm a selfmade semipro in Illustrator, Photoshop, and InDesign commanding these tools really well (I mean, I can always do what I want to, and if some piece of knowledge is missing, the help manual is enough). I've worked with DreamWe
-
Hi experts can anybody send me the BDC Code for F-02. i am giving you the field names bellow. BKPF-BLDAT. BKPF-BLART. BKPF-BUKRS. BKPF-BUDAT. BKPF-MONAT. BKPF-WAERS. BSEG-WRBTR. BSEG-GSBER. BSEG-ZFBDT. RF05A-NEWBS. RF05A-NEWKO. BSEG-WRBTR. BSEG-GSBER