Passing entire SQL query to BIP server from Forms
Hi
I want to pass the entire SQL statement or only a WHERE clause dynamically constructed on Forms side to BI Publisher server at runtime.
I have come across this article:
http://blogs.oracle.com/BIDeveloper/2009/12/dynamic_sql_query_in_data_template.html
It mentions about using pwhereclause which could be constructed dynamically.
Is it possible to pass the entire SELECT statement and has anyone done this before? May I have some tips on this?
Thanks and kind regards,
Aparna
My requirement is as follows:
1) I have a customised application which contains the definition of the report (report id, report name, the screen id on which the report is to appear as a record in the list and so on). This is where I would like to record the SQL statement which will be used to retrieve data for the report.
2) Once I launch the report from my application, it will pass SQL statement and other data (template, format, output file name, path where the output file will be saved, URL from which the output file will be launched after saving).
Thus, on BI Publisher server side, I shall only create a report, and will create a data template that will reference the SQL query that has been passed from application. I don't want to even specify parameters in Bi Publisher and want to specify them only in the application.
Is this possible?
Currently, I'm using a web service called 'PublicReportService' of BI Publisher to pass template, format, output file name, report path etc.). However, I am not sure how to pass an SQL query from Oracle Forms via this web service to BI Publisher.
Can someone please guide me?
Thanks and kind regards,
Aparna
Similar Messages
-
How to connect to SQL Server from Forms 10g?
Hello all,
How do we connect to SQL Server database from Forms 10g?
In Oracle Metalink site they have suggested using Transparent Gateway for SQL Server as a solution.
But is there a way we can connect directly to SQL Server from Forms using an ODBC connection
without installing anything on the database server?
Pls help!
Regards,
SamHello all,
I was able to connect to SQL Server from Oracle using Generic Connectivity (HSODBC).
Transparent gateway was not required.
Followed metalink note 109730.1
So, after I created a dblink to SQL Server, I created a synonym for the dblinked SQL Server table.
When I used the synonym as the table source in Oracle Forms, I got the following error while querying.
"ORA-02070 - ROWID is not supported in this context."
This is because Forms has an invisible ROWID field and when data is fetched from SQL Server table
no Rowid is fetched since SQL Server table doesn't have one.
Is there a way to overcome this issue or do we have populate the block manually using a SQL query ?
Pls suggest.
Regards,
Sam -
SQL query to fetch records from 26 onwards
Want to know SQL query to fetch records from 26 onwards.
See the fifth entry on the FAQ page:
Re: How to attach a java bean in forms6i -
How will write SQL query to fetch data from each Sub-partition..
Hi All,
Anyone does have any idea about How to write SQL query to fetch data from Sub-partition.
Actually i have one table having composite paritition(Range+list)
Now if i want to fetch data from main partition(Range) the query will be
SELECT * FROM emp PARTITION(q1_2005);
Now i want to fetch data at sub-partition level(List) .But i am not able to get any SQL query for that.
Pls help me to sort out.
Thanks in Advance.
AnwarSELECT * FROM emp SUBPARTITION(sp1);
-
Sql query to get numbers from 0 to 99
How can we write an sql query to get values from 0 to 99 ... this shouldn't be coming from any table
Bawer wrote:
Result: (quickly replied by oracle)
SQL-Error: ORA-30009 (Not enough memory for connect by - 1GB reserved for oracle on VirtualBox)Oracle version? Takes about 8 seconds on my:
SQL> select * from v$version
2 /
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
Elapsed: 00:00:00.14
SQL> select count(*) from (
2 SELECT LEVEL - 1
3 FROM DUAL
4 CONNECT BY LEVEL <= 10000000
5 )
6 /
COUNT(*)
10000000
Elapsed: 00:00:07.76
SQL> SY. -
Start report server from forms.
Hello everybody, merry chrismats to all.
Im working with Forms & Developer DevSuite in Red Hat Linux ES/AS.
Sometimes when I call a report from form using RUN_REPORT_OBJECT the report server is up & working but the forms dont find it & say FRM-41213 error, but after trying sometimes it begin to work.
Question : ¿ Is there anyway to start and stop report server from forms ?
Thanks in advanced & regards.Hello,
For all queries involving testcases or queries that are potentially bug related
we recommend you log a Service Request (SR) with Support via Metalink (http://metalink.oracle.com).
This will ensure your query is tracked appropriately and any urgent requests can be
dealt with in a timely manner by Global Support Services. May we also take this opportunity to remind you that the Metalink Library pages contain many Forms / Reports
articles which could be of use to you.
Best Regards
Denis SEGARD -
How to write sql query for counting pairs from below table??
Below is my SQL table structure.
user_id | Name | join_side | left_leg | right_leg | Parent_id
100001 Tinku Left 100002 100003 0
100002 Harish Left 100004 100005 100001
100003 Gorav Right 100006 100007 100001
100004 Prince Left 100008 NULL 100002
100005 Ajay Right NULL NULL 100002
100006 Simran Left NULL NULL 100003
100007 Raman Right NULL NULL 100003
100008 Vijay Left NULL NULL 100004
It is a binary table structure.. Every user has to add two per id under him, one is left_leg and second is right_leg... Parent_id is under which user current user is added.. Hope you will be understand..
I have to write sql query for counting pairs under id "100001". i know there will be important role of parent_id for counting pairs. * what is pair( suppose if any user contains both left_leg and right_leg id, then it is called pair.)
I know there are three pairs under id "100001" :-
1. 100002 and 100003
2. 100004 and 100005
3. 100006 and 100007
100008 will not be counted as pair because it does not have right leg..
But i dont know how to write sql query for this... Any help will be appreciated... This is my college project... And tommorow is the last date of submission.... Hope anyone will help me...
Suppose i have to count pair for id '100002'. Then there is only one pair under id '100002'. i.e 100004 and 100005Sounds like this to me
DECLARE @ID int
SET @ID = 100001--your passed value
SELECT left_leg,right_leg
FROM table
WHERE (user_id = @ID
OR parent_id = @ID)
AND left_leg IS NOT NULL
AND right_leg IS NOT NULL
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Help Required -- Can we use SQL Query to READ data from SAP MDM Tables
Hi All,
Please help.........
Can we use SQL Query to READ(No Creation/Updation/Deletion just Read) Data from SAP MDM tables directly, without using MDM Syndicator.
Or direct SQL access to SAP MDM tables is not possible. Only through MDM Syndicator can we export data.
Thanks in Advance
RegardsAll the tables you create in Repository comes under A2i_CM_Tables in Database named as your repository name. So the tables names are fields of table A2i_CM_Tables. Now i tried it but cant make it.
Now, I dont think its possible to extract all fields in tables and there values using select query. May be pure sql guy can do that or not.
But there is no relation of data extraction and syndicator. Data is viewed in Data Manager. and you can also store data in a file from DM also.
BR,
Alok -
SQL query with Java Server Pages
Hey,
I'm trying to read some information from database with SQL Query. How I can put the parameter that I get from previous *.jsp page to SQL query?
Technologies that I use are WML, JSP and MySQL.
I can get the parameter by method getParameter() and it is correct.
But how to but the requested parameter into sql query and complete the sql query?
Should I read it to some variable before putting it to sql query?
*/ this works fine */
out.println("<p>periodi"+request.getParameter("periodi"+"loppu</p>");
/* this doesn't work */
ResultSet tulokset = lause.executeQuery("select * from kurssi where periodi='+request.getParameter("periodi")+'");
/* this doesn't work */
String periodi=request.getParameter("periodi");
ResultSet tulokset = lause.executeQuery("select * from kurssi where periodi='periodi' '");
Thanks,
RampeHey,
I'm trying to read some information from database
se with SQL Query. How I can put the parameter that I
get from previous *.jsp page to SQL query?
Technologies that I use are WML, JSP and MySQL.
I can get the parameter by method getParameter()
() and it is correct.
But how to but the requested parameter into sql
ql query and complete the sql query?
Should I read it to some variable before putting it
it to sql query?
*/ this works fine */
out.println("<p>periodi"+request.getParameter("periodi"
"loppu</p>");
/* this doesn't work */
ResultSet tulokset = lause.executeQuery("select * from
kurssi where
periodi='+request.getParameter("periodi")+'");
/* this doesn't work */
String periodi=request.getParameter("periodi");
ResultSet tulokset = lause.executeQuery("select *
* from kurssi where periodi='periodi' '");
Thanks,
RampeTry this
ResultSet tulokset = lause.executeQuery("select * from kurssi where periodi=" + "'" +request.getParameter("periodi")+"' " );this should work -
Executing sql query(not through sqlfile) from batchfile
Hi,
I have written a batchfile below which should execute the sql query. Can someone please help me in modifying the below code. I know we can make use of sql file ,but wanted it to be more robust and hence everything in a single batch file instead of having combination of sqlfile and batchfile.
@echo off
set ORACLE_HOME=%RAMBOH%
set ORACLE_SID=%RAMBSID%
set path=%RAMBOH%\bin;%RAMBOH%\admin\Ramb_Scripts;%path%
sqlplus sys/XXX as sysdba
@echo SET SERVEROUTPUT ON;
@echo DECLARE
@echo v1 DATE;
@echo BEGIN
@echo SELECT SYSDATE INTO V1 FROM DUAL;
@echo DBMS_OUTPUT.PUT_LINE(v1);
@echo END;
@echo /I used the below syntax to execute a procedure
set ORACLE_SID=orcl
echo exec MyProcedure;
echo exit
)|sqlplus system/manager >MyProcedure.log
Try making modifications to this and see if this helps you in executing the SQL from the batch file -
Pass jstl sql query result to jsp
Hi I have the following code which works perfectly
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<sql:setDataSource dataSource="jdbc/dbtest"/>
<sql:query var="items" sql="SELECT * FROM homepagesubscriptions">
</sql:query>
<table border="0" align="center" valign="top">
<c:forEach var="row" items="${items.rows}" begin = "0" end="10" >
<tr>
<td>
<img src="${row.imgurl}" width="100" height = "100"></a>
</td>
<tr>
</c:forEach>
</table> Now what I want is to perform the query in one page and then display the data in another, as such
index.jsp
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<sql:setDataSource dataSource="jdbc/dbtest"/>
<sql:query var="items" sql="SELECT * FROM homepagesubscriptions">
</sql:query>
<!-- NOT SURE WHAT TO DO HERE
<jsp:useBean id="resultBean" scope="request"
class="javax.servlet.jsp.jstl.sql.ResultSupport" />
<jsp:setProperty name="rs" property="rs" />
<jsp:forward page="test.jsp" />
-->
test.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="items" value="${resultBean}" />
<table border="0" align="center" valign="top">
<c:forEach var="row" items="${items.rows}" begin = "0" end="10" >
<tr>
<td>
<img src="${row.imgurl}" width="100" height = "100"></a>
</td>
<tr>
</c:forEach>
</table> I know in index.jsp I can use jsp forward and usebean but am not sure how to? What type is the result from the query? thanksTake a look at the "scope" attribute of the <sql:query> tag.
query.jsp:
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>
<sql:setDataSource dataSource="jdbc/dbtest"/>
<sql:query var="items" scope="request" sql="SELECT * FROM homepagesubscriptions"/>
<jsp:forward page="test.jsp" />and then test.jsp:
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<table border="0" align="center" valign="top">
<c:forEach var="row" items="${items.rows}" begin = "0" end="10" >
<tr>
<td>
<img src="${row.imgurl}" width="100" height = "100"></a>
</td>
<tr>
</c:forEach>
</table> -
Any ideas how to execute a .sql file on database server from java?
Any ideas how to execute a xyz.sql file (which is fisically on
database server) from java?
thanksTry
sqlplus "sys/oracletest as sysdba" @bpk.sql
Working locally, and having set the ORACLE_SID, you don't need to specify the SqlNet alias (@testdb).
Remember to put an exit at the end of the bpk.sql script. -
Extract Sql Query with Actual Parameters from Report
Hi
I am able to extract query from Crystal Report using the following code :
ReportDocument.ReportClientDocument.RowSetController.GetSqlStatement(new GroupPath, out tmp);
But the sql query retrieve comes in the following format :
select name , trans_code, account_code from command_query.accounts
where account_code = {?Command_query_Prompt0} and effective_date < '{?Command_query_prompt1 }'
The parameters which I m using in the reports are :
Account_Code and Effective_Date .
Why does my extracted sql translates it into {?Command_query_Prompt0} and '{?Command_query_prompt1 }' .
Is there any way to map this to the actual parameter values ?
OR
Can we extract the query after assigning the values ?
Any help is appreciated ...
Thanks
Sanchethi,
You can create nested sql query with conditional parameters,
For example
Select Code From OITT Where Code IN (Select ItemCode From OITM
Where ItemName LIKE '[%0]' + '%%')
Edited by: Jeyakanthan A on Jun 9, 2009 12:31 PM -
SQL query to retrieve totals from "supporting Details"
We've had a strange issue where the totals from the supporting details aren't adding up to the value submitted in essbase.
In effect our RDMS is out of sync with Planning.
In order to remedy this, I'm trying to build a SQL query to retrieve the value of the supporting details.
Here is my Sql statement so far :
SELECT
HO1.OBJECT_NAME SCENARIO,
HO2.OBJECT_NAME ACCOUNT,
HO3.OBJECT_NAME ENTITY,
HO4.OBJECT_NAME Month,
HO5.OBJECT_NAME Version,
HO6.OBJECT_NAME Currency,
HO7.OBJECT_NAME Year,
HO8.OBJECT_NAME Project,
HO10.OBJECT_NAME CC,
HO12.OBJECT_NAME Grplcl,
HO13.OBJECT_NAME Product,
HO15.OBJECT_NAME SalesRegion,
HO16.OBJECT_NAME ContractAnalysis,
HO17.OBJECT_NAME IC,
SUM(NVL(HCDI.VALUE,0)) AMOUNT
FROM hsp_column_detail HCD,
hsp_column_detail_ITEM HCDI,
HSP_OBJECT HO1,
HSP_OBJECT HO2,
HSP_OBJECT HO3,
HSP_OBJECT HO4,
HSP_OBJECT HO5,
HSP_OBJECT HO6,
HSP_OBJECT HO7,
HSP_OBJECT HO8,
HSP_OBJECT HO10,
HSP_OBJECT HO12,
HSP_OBJECT HO13,
HSP_OBJECT HO15,
HSP_OBJECT HO16,
HSP_OBJECT HO17
WHERE hcd.detail_id = hcdi.detail_id
AND hcd.dim1 = ho1.object_id
AND hcd.dim2 = ho2.object_id
AND hcd.dim3 = ho3.object_id
AND hcd.dim4 = ho4.object_id
AND hcd.dim5 = ho5.object_id
AND hcd.dim6 = ho6.object_id
AND hcd.dim7 = ho7.object_id
AND hcd.dim8 = ho8.object_id
AND hcd.dim10 = ho10.object_id
AND hcd.dim12 = ho12.object_id
AND hcd.dim13 = ho13.object_id
AND hcd.dim15 = ho15.object_id
AND hcd.dim16 = ho16.object_id
AND hcd.dim17 = ho17.object_id
and hcdi.generation = 0
GROUP BY HO1.OBJECT_NAME, HO2.OBJECT_NAME, HO3.OBJECT_NAME, HO4.OBJECT_NAME,
HO5.OBJECT_NAME,
HO6.OBJECT_NAME,
HO7.OBJECT_NAME,
HO8.OBJECT_NAME,
HO10.OBJECT_NAME,
HO12.OBJECT_NAME,
HO13.OBJECT_NAME,
HO15.OBJECT_NAME,
HO16.OBJECT_NAME,
HO17.OBJECT_NAME
ORDER BY HO1.OBJECT_NAME, HO3.OBJECT_NAME, HO2.OBJECT_NAMEThis query works using PL SQL and has been used on Oracle 9.2.3.
Cheers,
Jeremie
Here is the Query:
set serveroutput on;
set serveroutput on size 1000000;
--set buffer_size 10000000;
--set line_size 2000;
--DBMS_OUTPUT.size = 2000000;
DECLARE
CURSOR BUDGET_HEADERS_CU IS
SELECT
hcd.detail_id,
HO1.OBJECT_NAME SCENARIO,
HO2.OBJECT_NAME ACCOUNT,
HO3.OBJECT_NAME ENTITY,
HO4.OBJECT_NAME Month,
HO5.OBJECT_NAME Version,
HO6.OBJECT_NAME Currency,
HO7.OBJECT_NAME Year,
HO8.OBJECT_NAME Project,
HO10.OBJECT_NAME CC,
HO12.OBJECT_NAME Grplcl,
HO13.OBJECT_NAME Product,
HO15.OBJECT_NAME SalesRegion,
HO16.OBJECT_NAME ContractAnalysis,
HO17.OBJECT_NAME IC,
hcd.dim1 SCENARIO_id,
hcd.dim2 ACCOUNT_id,
hcd.dim3 ENTITY_id,
hcd.dim4 Month_id,
hcd.dim5 Version_id,
hcd.dim6 Currency_ID,
hcd.dim7 Year_ID,
hcd.dim8 Project_ID,
hcd.dim10 CC_ID,
hcd.dim12 Grplcl_ID,
hcd.dim13 Product_ID,
hcd.dim15 SalesRegion_ID,
hcd.dim16 ContractAnalysis_ID,
hcd.dim17 IC_ID
FROM hsp_column_detail HCD, /*hsp_column_detail_item HCDi,*/
HSP_OBJECT HO1,
HSP_OBJECT HO2,
HSP_OBJECT HO3,
HSP_OBJECT HO4,
HSP_OBJECT HO5,
HSP_OBJECT HO6,
HSP_OBJECT HO7,
HSP_OBJECT HO8,
HSP_OBJECT HO10,
HSP_OBJECT HO12,
HSP_OBJECT HO13,
HSP_OBJECT HO15,
HSP_OBJECT HO16,
HSP_OBJECT HO17
WHERE /*hcd.detail_id = hcdi.detail_id
AND*/ hcd.dim1 = ho1.object_id
AND hcd.dim2 = ho2.object_id
AND hcd.dim3 = ho3.object_id
AND hcd.dim4 = ho4.object_id
AND hcd.dim5 = ho5.object_id
AND hcd.dim6 = ho6.object_id
AND hcd.dim7 = ho7.object_id
AND hcd.dim8 = ho8.object_id
AND hcd.dim10 = ho10.object_id
AND hcd.dim12 = ho12.object_id
AND hcd.dim13 = ho13.object_id
AND hcd.dim15 = ho15.object_id
AND hcd.dim16 = ho16.object_id
AND hcd.dim17 = ho17.object_id
and HO5.OBJECT_NAME = 'Working'
--and hcdi.generation != 0
--and hcdi.label like 'JRTEST-%'
--and hcd.detail_id = 253102
/*GROUP BY HCD.Dim1, HCD.Dim2, HCD.Dim3, HCD.Dim4,
HCD.Dim5,
HCD.Dim6,
HCD.Dim7,
HCD.Dim8,
HCD.Dim10,
HCD.Dim12,
HCD.Dim13,
HCD.Dim15,
HCD.Dim16,
HCD.Dim17*/;
CURSOR BUDGET_DETAILS_CU(
/*scenario_p in varchar2,
account_p in varchar2,
entity_p in varchar2,
month_p in varchar2,
version_p in varchar2,
currency_p in varchar2,
year_p in varchar2,
project_p in varchar2,
cc_p in varchar2,
grplcl_p in varchar2,
product_p in varchar2,
salesregion_p in varchar2,
contractanalysis_p in varchar2,
ic_p in varchar2*/
detail_id_p in number
IS
SELECT
/* HO1.OBJECT_NAME SCENARIO,
HO2.OBJECT_NAME ACCOUNT,
HO3.OBJECT_NAME ENTITY,
HO4.OBJECT_NAME Month,
HO5.OBJECT_NAME Version,
HO6.OBJECT_NAME Currency,
HO7.OBJECT_NAME Year,
HO8.OBJECT_NAME Project,
HO10.OBJECT_NAME CC,
HO12.OBJECT_NAME Grplcl,
HO13.OBJECT_NAME Product,
HO15.OBJECT_NAME SalesRegion,
HO16.OBJECT_NAME ContractAnalysis,
HO17.OBJECT_NAME IC, */
label,
NVL(HCDI.VALUE,0) AMOUNT,
HCDI.Position,
HCDI.operator,
HCDI.generation
FROM /*hsp_column_detail HCD,*/
hsp_column_detail_ITEM HCDI
/* HSP_OBJECT HO1,
HSP_OBJECT HO2,
HSP_OBJECT HO3,
HSP_OBJECT HO4,
HSP_OBJECT HO5,
HSP_OBJECT HO6,
HSP_OBJECT HO7,
HSP_OBJECT HO8,
HSP_OBJECT HO10,
HSP_OBJECT HO12,
HSP_OBJECT HO13,
HSP_OBJECT HO15,
HSP_OBJECT HO16,
HSP_OBJECT HO17*/
--WHERE hcd.detail_id = hcdi.detail_id
WHERE hcdi.detail_id = detail_id_p
/*AND hcd.dim1 = ho1.object_id
AND hcd.dim2 = ho2.object_id
AND hcd.dim3 = ho3.object_id
AND hcd.dim4 = ho4.object_id
AND hcd.dim5 = ho5.object_id
AND hcd.dim6 = ho6.object_id
AND hcd.dim7 = ho7.object_id
AND hcd.dim8 = ho8.object_id
AND hcd.dim10 = ho10.object_id
AND hcd.dim12 = ho12.object_id
AND hcd.dim13 = ho13.object_id
AND hcd.dim15 = ho15.object_id
AND hcd.dim16 = ho16.object_id
AND hcd.dim17 = ho17.object_id*/
--and hcdi.generation != 0
--and label like 'JRTEST-%'
/*AND HCD.Dim1 = scenario_p
AND HCD.Dim2 = account_p
AND HCD.Dim3 = entity_p
AND HCD.Dim4 = month_p
AND HCD.Dim5 = version_p
AND HCD.Dim6 = currency_p
AND HCD.Dim7 = year_p
AND HCD.Dim8 = project_p
AND HCD.Dim10 = cc_p
AND HCD.Dim12 = grplcl_p
AND HCD.Dim13 = product_p
AND HCD.Dim15 = salesregion_p
AND HCD.Dim16 = contractanalysis_p
AND HCD.Dim17 = ic_p*/
ORDER BY hcdi.position;
-- Variable Declaration
running_total_ln number :=0;
prev_running_total_ln number :=0;
add_amount number :=0;
multiply_amount number :=1;
prev_generation number :=0;
prev_add_amount number :=0;
prev_multiply_amount number :=1;
running_total_gen0 number :=0;
running_gen0_op number :=0;
running_total_gen1 number :=0;
running_gen1_op number :=0;
running_total_gen2 number :=0;
running_gen2_op number :=0;
running_total_gen3 number :=0;
running_gen3_op number :=0;
running_total_gen4 number :=0;
running_gen4_op number :=0;
running_total_gen5 number :=0;
running_gen5_op number :=0;
output_file utl_file.file_type;
-- Begin PL/SQL processing
BEGIN
--DBMS_OUTPUT.
DBMS_OUTPUT.ENABLE(1000000);
DBMS_OUTPUT.PUT_LINE('Begin Processing');
output_file := utl_file.fopen ('C:\temp', 'test.txt', 'W');
-- Begin Header For Loop
FOR BUDGET_HEADERS_CV IN BUDGET_HEADERS_CU
LOOP
--Reset Running Totals
running_total_ln:=0;
prev_running_total_ln:=0;
add_amount:=0;
multiply_amount:=1;
prev_generation:=0;
prev_add_amount:=0;
prev_multiply_amount:=1;
running_total_gen0:=0;
running_gen0_op:=0;
running_total_gen1:=0;
running_gen1_op:=0;
running_total_gen2:=0;
running_gen2_op:=0;
running_total_gen3:=0;
running_gen3_op:=0;
running_total_gen4:=0;
running_gen4_op:=0;
running_total_gen5:=0;
running_gen5_op:=0;
-- Begin Detail For Loop
FOR BUDGET_DETAILS_CV IN BUDGET_DETAILS_CU(
BUDGET_HEADERS_CV.Detail_ID
/*BUDGET_HEADERS_CV.SCENARIO_ID,
BUDGET_HEADERS_CV.ACCOUNT_ID,
BUDGET_HEADERS_CV.ENTITY_ID,
BUDGET_HEADERS_CV.Month_ID,
BUDGET_HEADERS_CV.Version_ID,
BUDGET_HEADERS_CV.Currency_ID,
BUDGET_HEADERS_CV.Year_ID,
BUDGET_HEADERS_CV.Project_ID,
BUDGET_HEADERS_CV.CC_ID,
BUDGET_HEADERS_CV.Grplcl_ID,
BUDGET_HEADERS_CV.Product_ID,
BUDGET_HEADERS_CV.SalesRegion_ID,
BUDGET_HEADERS_CV.ContractAnalysis_ID,
BUDGET_HEADERS_CV.IC_ID*/
LOOP
-- Null;
add_amount :=0;
multiply_amount :=1;
IF BUDGET_DETAILS_CV.OPERATOR = 1 THEN
add_amount := BUDGET_DETAILS_CV.Amount;
End if;
IF BUDGET_DETAILS_CV.OPERATOR = 2 THEN
add_amount := BUDGET_DETAILS_CV.Amount * -1;
End if;
IF BUDGET_DETAILS_CV.OPERATOR = 3 THEN
multiply_amount := BUDGET_DETAILS_CV.Amount;
End if;
IF BUDGET_DETAILS_CV.OPERATOR = 4 THEN
multiply_amount := 1/BUDGET_DETAILS_CV.Amount;
End if;
IF BUDGET_DETAILS_CV.Position = 0 then
running_total_gen0 := add_amount*multiply_amount;-- we are dealing with the first line
Else
if BUDGET_DETAILS_CV.GENERATION = prev_generation then
-- run whatever total we are on up
if BUDGET_DETAILS_CV.GENERATION = 0 then
running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
end if;
if BUDGET_DETAILS_CV.GENERATION = 1 then
running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
end if;
if BUDGET_DETAILS_CV.GENERATION = 2 then
running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
end if;
if BUDGET_DETAILS_CV.GENERATION = 3 then
running_total_gen3 := (running_total_gen3 + add_amount)*multiply_amount;
end if;
end if;
if BUDGET_DETAILS_CV.GENERATION = prev_generation +1 then
-- we are going up a generation
-- (we cannot go up to gen0
if BUDGET_DETAILS_CV.GENERATION = 1 then
running_total_gen1:=0;-- reset gen1 counter
running_gen0_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
running_total_gen0 := running_total_gen0/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 0 total
running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
end if;
if BUDGET_DETAILS_CV.GENERATION = 2 then
running_total_gen2:=0;-- reset gen1 counter
running_gen1_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
running_total_gen1 := running_total_gen1/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 1 total
running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
end if;
if BUDGET_DETAILS_CV.GENERATION = 3 then
running_total_gen3:=0;-- reset gen1 counter
running_gen2_op:=BUDGET_DETAILS_CV.OPERATOR; -- Store the sign for later operation
running_total_gen2 := running_total_gen2/prev_multiply_amount - prev_add_amount; -- Remove parent from Gen 2 total
running_total_gen3 := (running_total_gen3 + add_amount)*multiply_amount;
end if;
end if;
if BUDGET_DETAILS_CV.GENERATION = prev_generation - 1 then
-- we are Down a generation
if BUDGET_DETAILS_CV.GENERATION = 0 then
--we need to "add" back the previous gen 1 parent
IF running_gen0_op = 1 THEN
running_total_gen0 := running_total_gen0 + running_total_gen1;
End if;
IF running_gen0_op = 2 THEN
running_total_gen0 := running_total_gen0 - running_total_gen1;
End if;
IF running_gen0_op = 3 THEN
running_total_gen0 := running_total_gen0 * running_total_gen1;
End if;
IF running_gen0_op = 4 THEN
running_total_gen0 := running_total_gen0 / running_total_gen1;
End if;
-- we need to add the current member to the gen0
running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
END IF;
if BUDGET_DETAILS_CV.GENERATION = 1 then
--we need to "add" back the previous gen 2 parent
IF running_gen1_op = 1 THEN
running_total_gen1 := running_total_gen1 + running_total_gen2;
End if;
IF running_gen1_op = 2 THEN
running_total_gen1 := running_total_gen1 - running_total_gen2;
End if;
IF running_gen1_op = 3 THEN
running_total_gen1 := running_total_gen1 * running_total_gen2;
End if;
IF running_gen1_op = 4 THEN
running_total_gen1 := running_total_gen1 / running_total_gen2;
End if;
-- we need to add the current member to the gen1
running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
end if;
if BUDGET_DETAILS_CV.GENERATION = 2 then
--we need to "add" back the previous gen 3 parent
IF running_gen1_op = 1 THEN
running_total_gen2 := running_total_gen2 + running_total_gen3;
End if;
IF running_gen1_op = 2 THEN
running_total_gen2 := running_total_gen2 - running_total_gen3;
End if;
IF running_gen1_op = 3 THEN
running_total_gen2 := running_total_gen2 * running_total_gen3;
End if;
IF running_gen1_op = 4 THEN
running_total_gen2 := running_total_gen2 / running_total_gen3;
End if;
-- we need to add the current member to the gen2
running_total_gen2 := (running_total_gen2 + add_amount)*multiply_amount;
end if;
end if;
if BUDGET_DETAILS_CV.GENERATION = prev_generation - 2 then
-- we are Down 2 generations
if BUDGET_DETAILS_CV.GENERATION = 0 then
--we need to "add" back the previous gen 2 parent
IF running_gen1_op = 1 THEN
running_total_gen1 := running_total_gen1 + running_total_gen2;
End if;
IF running_gen1_op = 2 THEN
running_total_gen1 := running_total_gen1 - running_total_gen2;
End if;
IF running_gen1_op = 3 THEN
running_total_gen1 := running_total_gen1 * running_total_gen2;
End if;
IF running_gen1_op = 4 THEN
running_total_gen1 := running_total_gen1 / running_total_gen2;
End if;
--we need to "add" back the previous gen 1 parent
IF running_gen0_op = 1 THEN
running_total_gen0 := running_total_gen0 + running_total_gen1;
End if;
IF running_gen0_op = 2 THEN
running_total_gen0 := running_total_gen0 - running_total_gen1;
End if;
IF running_gen0_op = 3 THEN
running_total_gen0 := running_total_gen0 * running_total_gen1;
End if;
IF running_gen0_op = 4 THEN
running_total_gen0 := running_total_gen0 / running_total_gen1;
End if;
-- we need to add the current member to the gen0
running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
END IF;
if BUDGET_DETAILS_CV.GENERATION = 1 then
--we need to "add" back the previous gen 3 parent
IF running_gen1_op = 1 THEN
running_total_gen2 := running_total_gen2 + running_total_gen3;
End if;
IF running_gen1_op = 2 THEN
running_total_gen2 := running_total_gen2 - running_total_gen3;
End if;
IF running_gen1_op = 3 THEN
running_total_gen2 := running_total_gen2 * running_total_gen3;
End if;
IF running_gen1_op = 4 THEN
running_total_gen2 := running_total_gen2 / running_total_gen3;
End if;
--we need to "add" back the previous gen 2 parent
IF running_gen1_op = 1 THEN
running_total_gen1 := running_total_gen1 + running_total_gen2;
End if;
IF running_gen1_op = 2 THEN
running_total_gen1 := running_total_gen1 - running_total_gen2;
End if;
IF running_gen1_op = 3 THEN
running_total_gen1 := running_total_gen1 * running_total_gen2;
End if;
IF running_gen1_op = 4 THEN
running_total_gen1 := running_total_gen1 / running_total_gen2;
End if;
-- we need to add the current member to the gen1
running_total_gen1 := (running_total_gen1 + add_amount)*multiply_amount;
END IF;
if BUDGET_DETAILS_CV.GENERATION = prev_generation - 3 then
-- we are Down 3 generations
if BUDGET_DETAILS_CV.GENERATION = 0 then
--we need to "add" back the previous gen 3 parent
IF running_gen1_op = 1 THEN
running_total_gen2 := running_total_gen2 + running_total_gen3;
End if;
IF running_gen1_op = 2 THEN
running_total_gen2 := running_total_gen2 - running_total_gen3;
End if;
IF running_gen1_op = 3 THEN
running_total_gen2 := running_total_gen2 * running_total_gen3;
End if;
IF running_gen1_op = 4 THEN
running_total_gen2 := running_total_gen2 / running_total_gen3;
End if;
--we need to "add" back the previous gen 2 parent
IF running_gen1_op = 1 THEN
running_total_gen1 := running_total_gen1 + running_total_gen2;
End if;
IF running_gen1_op = 2 THEN
running_total_gen1 := running_total_gen1 - running_total_gen2;
End if;
IF running_gen1_op = 3 THEN
running_total_gen1 := running_total_gen1 * running_total_gen2;
End if;
IF running_gen1_op = 4 THEN
running_total_gen1 := running_total_gen1 / running_total_gen2;
End if;
--we need to "add" back the previous gen 1 parent
IF running_gen0_op = 1 THEN
running_total_gen0 := running_total_gen0 + running_total_gen1;
End if;
IF running_gen0_op = 2 THEN
running_total_gen0 := running_total_gen0 - running_total_gen1;
End if;
IF running_gen0_op = 3 THEN
running_total_gen0 := running_total_gen0 * running_total_gen1;
End if;
IF running_gen0_op = 4 THEN
running_total_gen0 := running_total_gen0 / running_total_gen1;
End if;
-- we need to add the current member to the gen0
running_total_gen0 := (running_total_gen0 + add_amount)*multiply_amount;
END IF;
end if;
END IF;
End IF;
END LOOP; -- End of Detail Loop
--DBMS_OUTPUT.PUT_LINE(BUDGET_HEADERS_CV.SCENARIO||';'||BUDGET_HEADERS_CV.ACCOUNT||';'||BUDGET_HEADERS_CV.ENTITY||';'||BUDGET_HEADERS_CV.Month||';'||BUDGET_HEADERS_CV.Version||';'||BUDGET_HEADERS_CV.Currency||';'||BUDGET_HEADERS_CV.Year||';'||BUDGET_HEADERS_CV.Project||';'||BUDGET_HEADERS_CV.CC||';'||BUDGET_HEADERS_CV.Grplcl||';'||BUDGET_HEADERS_CV.Product||';'||BUDGET_HEADERS_CV.SalesRegion||';'||BUDGET_HEADERS_CV.ContractAnalysis||';'||BUDGET_HEADERS_CV.IC||';'||running_total_gen0);
utl_file.put_line(output_file,BUDGET_HEADERS_CV.SCENARIO||';'||BUDGET_HEADERS_CV.ACCOUNT||';'||BUDGET_HEADERS_CV.ENTITY||';'||BUDGET_HEADERS_CV.Month||';'||BUDGET_HEADERS_CV.Version||';'||BUDGET_HEADERS_CV.Currency||';'||BUDGET_HEADERS_CV.Year||';'||BUDGET_HEADERS_CV.Project||';'||BUDGET_HEADERS_CV.CC||';'||BUDGET_HEADERS_CV.Grplcl||';'||BUDGET_HEADERS_CV.Product||';'||BUDGET_HEADERS_CV.SalesRegion||';'||BUDGET_HEADERS_CV.ContractAnalysis||';'||BUDGET_HEADERS_CV.IC||';'||running_total_gen0);
/*BUDGET_HEADERS_CV.SCENARIO, BUDGET_HEADERS_CV.ACCOUNT, BUDGET_HEADERS_CV.ENTITY, BUDGET_HEADERS_CV.Month, BUDGET_HEADERS_CV.Version,BUDGET_HEADERS_CV.Currency, BUDGET_HEADERS_CV.Year, BUDGET_HEADERS_CV.Project, BUDGET_HEADERS_CV.CC, BUDGET_HEADERS_CV.Grplcl, BUDGET_HEADERS_CV.Product, BUDGET_HEADERS_CV.SalesRegion, BUDGET_HEADERS_CV.ContractAnalysis, BUDGET_HEADERS_CV.IC */
END LOOP; -- End of Header Loop
--DBMS_OUTPUT.PUT_LINE('Total');
-- DBMS_OUTPUT.PUT_LINE('End Processing');
utl_file.fclose(output_file);
END;
Edited by: JeremieR on Apr 18, 2011 5:02 AM -
Connecting To Domino Server From Forms 6.0
Dear OTN Members,
I have a problem for which I can't seem to find a solution. I
need to communicate from Forms 6.0 to a Domino server running
Lotus notes. Can anyone please help me?
Thank you
nullGeorge Salloum (guest) wrote:
: Dear OTN Members,
: I have a problem for which I can't seem to find a solution. I
: need to communicate from Forms 6.0 to a Domino server running
: Lotus notes. Can anyone please help me?
: Thank you
Haven't done it, but appears do-able. go to
http://lotus.com/home.nsf/welcome/techzone. The most promising
option is the JDBC driver for Notes. Also you could use OLE or
there are third party OCX's to access Notes. Hopefully one of
these would work...
null
Maybe you are looking for
-
Sony PC Companion Saving Update to Wrong Drive
Hi I have an SSD with my Win 8.1 loaded and a HHD with all the programs, data, etc. I have an update waiting for my Z3 Compact but the Sony PC Companion keeps trying save the update to the SSD which doesn't have enough room. Thre is no option to tell
-
okay so i updated itunes and now it wont let me sync anything it keeps giving me that "you can only be synced with one computer at a time erase and sync" but this is the only computer ive ever used!!! pleeeease help!! <Edited By Host>
-
AppleTV no longer appearing in iTunes. Suggestions?
Let me start off this post by saying that I work as a computer programmer, so I'm not unfamiliar with following support guides, etc. So with that said, please don't tell me to follow Apple Support for this, as I've done every single step out there. I
-
Payment Run Not Printing Check. No Spool Created.
Hi Gurus, We did a payment run and it generated a spool at 1st and it was at "waiting status" which is strange because when we do this, it prints immediately. So, then the spool disappeared and no checks was printed. We tried to reprint it and no spo
-
FMLE won't recognize audio drivers.
My FMLE will only recognize my microphone as a potential audio input source, and won't recognize RealTek Audio at all. In the dropdown menu, the only option is for the microphone. Is this a bug, or something I can fix?