SQL query issue in a method
I am trying to use a method to query a database to gather a person's name when the Social Security Number is entered. However in the display, it seems to only bring back the field that you use to compare in the load statement. Can anyone tell me what I am doing wrong? The below example will bring back the SSN but if I change the last line in the example to HISTORY.fullName I get a "Null Value" returned back. Thanks.
input "Social Security Number of Employee to terminate: " : intSSN
//intSSN is a local variable
using title = "Termination Applet",
buttons = ["OK", "Cancel"]
returning selectedButton = selection
//pg 310 of Fuego 5.5 document
//Database name is HISTORY, local variable is ssn, seems to only only display what is in load
//and nothing else
load BpmDB.Dbo.HISTORY using ssn = intSSN
display HISTORY.ssn
load BpmDB.Dbo.HISTORY using ssn = intSSN
display HISTORY.ssnTry doing:
load BpmDB.Dbo.HISTORY using ssn = intSSN
display HISTORY //Note the difference, we're asking for the whole object,
not just the ssn
Juan
On Thu, 07 Sep 2006 13:52:39 -0300, Ben Sfanos wrote:
I am trying to use a method to query a database to gather a person's
name when the Social Security Number is entered. However in the
display, it seems to only bring back the field that you use to compare
in the load statement. Can anyone tell me what I am doing wrong? The
below example will bring back the SSN but if I change the last line in
the example to HISTORY.fullName I get a "Null Value" returned back.
Thanks.
input "Social Security Number of Employee to terminate: " : intSSN
//intSSN is a local variable
using title = "Termination Applet",
buttons = ["OK", "Cancel"]
returning selectedButton = selection
//pg 310 of Fuego 5.5 document
//Database name is HISTORY, local variable is ssn, seems to only only
display what is in load
//and nothing else
load BpmDB.Dbo.HISTORY using ssn = intSSN
display HISTORY.ssn
Similar Messages
-
Oracle Sql Query issue Running on Different DB Version
Hello All,
I have come into situation where we are pruning sql queries on different DB version of Oracle and have performance issue. Let me tell you in brief and i really appreciate for your prompt response as its very imperative stuff.
I have a query which is running on a DB of version 7.3.4 and it takes around 30 mins where as the same query when run on 8i it takes 15sec., its a huge difference. I have run the statistics to analyze on 7.3 and its comparatively very high. Question here is, the sql query trys to select data from same schema table and 2 tables from another DB using DB link and 2 other tables from another DB using DB link.So,how can we optimize this stuff and achieve this run as same time as 8i DB in 7.3. Hope i am clear about my question, Eagerly waiting for your replies.
Thanks in Advance.
Message was edited by:
Ram8Difficult to be sure without any more detailed information, but I suspect that O7 is in effect copying the remote tables to local temp space, then joining; 8i is factoring out a better query to send to the remote DBs, which does as much work as possible on the remote DB before shipping remaining rows back to local.
You should be able to use EXPLAIN PLAN to identify what SQL is being shipped to the remote DB, If you can't (and it's been quite a while since I tried DB links or O7) then get the remote DBs to yourself, and set SQL_TRACE on for the remote instances. Execute the query and then examine the remote trace files, And don't forget to turn off the tracing when you're done.
Of course it could just be that the CBO got better,,,
HTH - if not, post your query and plans for the local db, and the remote queries.
Regards Nigel -
SQL Query issue with large varchar column
I have a SQL Query (PL/SQL function body returning SQL query) which contains a large varchar column. Even if I substring the column to 30chars when it displays on the page it wraps. I have tried putting nowrap="wrap" for the HTML table cell attributes and it still wraps. I have tried setting the width attributes on the column even though it's not an updateable column. Does anyone have any ideas on how prevent this from wrapping. In some cases 1 line will take up 3 because of this wrapping issue and it's not nice to look at. It seems that the column is somewhere set to a fixed width, which is less than 30 characters, and anything beyond this fixed width wraps.
Hi Netha,
Can you please provide the DDLs of three tables you are using,
Also post us how many rows you are getting output for this query?
select * from dim.store st where
st.store_code = 'MAUR'
also try to run and update statement on this table as below and execute your query
update dim.store
set store_code
= ltrim(rtrim(store_code))
where
store_code = 'MAUR'
once you run this update, then run your query. Let us know the result. -
VO SQL Query issue... JHeadstart...
Hi,
I am presently using JHeadStart 10.1.3.3.81 in order to convert an Oracle Form FMB via an XML format to an ADF-JSF application as follows:-
1) Using the iff2xml90 utility provided with the Oracle designer converted the Oracle Form FMB to an XML file.
2) Using Jdeveloper(with JHeadstart 10.1.3.3.81) converted the XML file generated in STEP 1 above into a J2EE ADF-JSF project.
3) One of the VO's generated in the project has the following query:-
SELECT INITMV.INSTALLATION_ID,
INITMV.FACILITY_ID,
INITMV.DI_SHORT_NAME
FROM CP_INSTALLATIONS_ALL INITMV
WHERE ( CPPRI.ORG_ID in(select org_id from cp_system_controls ) and CPPRI.DELIVERY_LOCATION_NUMBER=nvl(:b_LOC_LOCATION_NUMBER,CPPRI.DELIVERY_LOCATION_NUMBER) and
(:b_LOC_CATEGORY_ID is null or CPPRI.INVENTORY_ITEM_ID in (select inventory_item_id from di_mtl_item_categories_v where category_id=:b_LOC_CATEGORY_ID)) and exists (select 1
from DI_DISTRIBUTION_PLANS_V dis where trunc(dis.plan_date)=trunc(sysdate) and CPPRI.facility_id=dis.facility_id and CPPRI.installation_id=dis.installation_id and
CPPRI.organization_id=dis.organization_id and CPPRI.inventory_item_id=dis.inventory_item_id and (dis.midcycle_call_flag='Y' or (CPPRI.call_days is not null and trunc
(dis.last_delivery_date+CPPRI.call_days)<=trunc(sysdate)))) ) ORDER BY DI_SHORT_NAME
As can be seen from the above query, the CPPRI reference does not point to any db table/view/synonym. Actually the CPPRI reference should be pointing to the CP_INSTALLATIONS_ALL table.
4) When I checked the XML file for the datablock to which this query belongs, I found the following:-
<Block Name="INITMV" ScrollbarLength="1200" DeleteAllowed="false" OrderByClause="order by DI_SHORT_NAME" WhereClause="where (&#10;CPPRI.ORG_ID in(select org_id from cp_system_controls )&#10;and CPPRI.DELIVERY_LOCATION_NUMBER=nvl(:LOC.LOCATION_NUMBER,CPPRI.DELIVERY_LOCATION_NUMBER)&#10;and (:LOC.CATEGORY_ID is null or CPPRI.INVENTORY_ITEM_ID in (select inventory_item_id from di_mtl_item_categories_v&#10;where category_id=:LOC.CATEGORY_ID))&#10;and exists (select 1&#10;from DI_DISTRIBUTION_PLANS_V dis&#10; where trunc(dis.plan_date)=trunc(sysdate)&#10; and CPPRI.facility_id=dis.facility_id&#10; and CPPRI.installation_id=dis.installation_id&#10; and CPPRI.organization_id=dis.organization_id&#10; and CPPRI.inventory_item_id=dis.inventory_item_id&#10; and (dis.midcycle_call_flag='Y'&#10; or&#10; (CPPRI.call_days is not null and trunc(dis.last_delivery_date+CPPRI.call_days)<=trunc(sysdate))))&#10;)" Alias="CPPRI" UpdateAllowed="false" NextNavigationBlockName="INSHST" InsertAllowed="false" DMLDataName="CP_INSTALLATIONS_ALL" ParentModuleType="25" ScrollbarYPosition="984" ScrollbarTabPageName="" QueryDataSourceName="CP_INSTALLATIONS_ALL" ParentType="3" RecordsBufferedCount="9" ParentName="CGSO$BLOCK_MR" DMLReturnValue="true" ParentFilename="aqmolb65.olb" PreviousNavigationBlockName="LOC" ParentModule="AQMOLB65" PersistentClientInfoLength="41" EnforcedPrimaryKey="true" RecordsDisplayCount="6" ScrollbarXPosition="6700" DirtyInfo="false" ScrollbarCanvasName="CG$PAGE_1">
I am not sure whether the above is at all a bug or whether the Oracle Form from which the sql query was generated in itself had a glitch in the first place(actually it works fine on the Oracle Forms side). If this is a bug, does this belong to the FMB to XML conversion or from the XML to J2EE conversion.
Regards,
Lester.Hi,
JHeadstart questions should be posted to
JHeadstart
Frank -
SQL query issue, how to improve it?
Hello all, I want to create a query with with result in the following result. Every first person of an department starts with the letter A and goes up like this:
Name department
A Person1 3
B Person2 3
C Person3 3
D Person4 3
E Person10 3
A Person6 10
B Person7 10
C Person8 10
A Person4 13
B Person9 13
It has to be a SQL query, unfortunately no PL/SQL
I was able to create this query, but its lacking. Department_id will be a variable, a person can choose one department or several departments, so the query varies in size.
select chr(64+rownum), name, department_id
from ( select name, department_id
from employees
where department_id = 3
order by id_but, naam
union
select chr(64+rownum), name, department_id
from ( select name, department_id
from employees
where department_id = 10
order by id_but, naam
union
select chr(64+rownum), name, department_id
from ( select name, department_id
from employees
where department_id = 13
order by id_but, naam
order by id_but, naam
The employees table has the following columns:
id, name, department_id
Can anyone help me make this query better? parhaps with the With clause?Use analytic function ROW_NUMBER:
with t as (
select 'A' name,3 department from dual union all
select 'B',3 from dual union all
select 'C',3 from dual union all
select 'D',3 from dual union all
select 'E',3 from dual union all
select 'A',10 from dual union all
select 'B',10 from dual union all
select 'C',10 from dual union all
select 'A',13 from dual union all
select 'B',13 from dual
select name,
'Person' || row_number() over(partition by department order by name) person,
department
from t
order by 3,
3
NAME PERSON DEPARTMENT
A Person1 3
B Person2 3
C Person3 3
D Person4 3
E Person5 3
A Person1 10
B Person2 10
C Person3 10
A Person1 13
B Person2 13
10 rows selected.
SQL> SY. -
SQL Query Issue - (inner not passing to outer query)
Hello everyone:
Here is my SQL query:
SELECT RD.SITE,
ROUND(
(SELECT COUNT (DISTINCT PB.EMP_ID)
FROM BOOK PB
WHERE PB.EMP_ID IN
(SELECT PB.EMP_ID FROM BOOK PB
(SELECT COUNT (DISTINCT PB.EMP_ID)
FROM BOOK PB
WHERE PB.EMP_ID IN
(SELECT PB.EMP_ID FROM BOOK PB
WHERE MO.QUALIFIER > 4
)* 100, 2) AS PERCENTAGE
FROM BOOK PB
LEFT JOIN POSITION MO
ON PB.EMP_ID = PO.EMP_ID
INNER JOIN PHYS_LOCATION RD
ON MO.HOUSED = RD.SITE_ID
WHERE MO.ACTUAL_END IS NULL
GROUP BY RD.SITE;Why am I getting the overall percentage for all Sites as opposed to each percentage calculating for each individual site. I grouped by RD.SITE, so I presumed it would calculate percentages for each site. What did I do wrong?
Thank you for your assistance.AquaNX4 wrote:
Hello everyone:
Here is my SQL query:
SELECT RD.SITE,
ROUND(
(SELECT COUNT (DISTINCT PB.EMP_ID)
FROM BOOK PB
WHERE PB.EMP_ID IN
(SELECT PB.EMP_ID FROM BOOK PB
(SELECT COUNT (DISTINCT PB.EMP_ID)
FROM BOOK PB
WHERE PB.EMP_ID IN
(SELECT PB.EMP_ID FROM BOOK PB
WHERE MO.QUALIFIER > 4
)* 100, 2) AS PERCENTAGE
FROM BOOK PB
LEFT JOIN POSITION MO
ON PB.EMP_ID = PO.EMP_ID
INNER JOIN PHYS_LOCATION RD
ON MO.HOUSED = RD.SITE_ID
WHERE MO.ACTUAL_END IS NULL
GROUP BY RD.SITE;Why am I getting the overall percentage for all Sites as opposed to each percentage calculating for each individual site. I grouped by RD.SITE, so I presumed it would calculate percentages for each site. What did I do wrong?Because that is what you are requesting. Your scalar subquery to get the percentage is not restricted by the current site. Add filter columns to restrict the selected values for the computation
Edited by: riedelme on May 8, 2013 7:26 AM -
I am attempting to connect to a Progress database using JDBC and am having a few issues with my SQL statement. The code concerned looks like this:
// Get a statement from the connection
Statement stmt = conn.createStatement() ;
// Execute the query
ResultSet rs = stmt.executeQuery( "SELECT * FROM pub.cust" ) ;
// Loop through the result set
while( rs.next() )
System.out.println( rs.getString( "cust-code" ) ) ;
That works just fine. Prints out each of the cust-code values. My issue comes when I try to refine the query to be:
ResultSet rs = stmt.executeQuery( "SELECT * FROM pub.cust WHERE cust.Cust-code='100001-0'" ) ;
or even
ResultSet rs = stmt.executeQuery( "SELECT Cust-code FROM pub.cust" ) ;
Both of these give me an error saying Column not found/specified.
if I wrap Cust-code in single quotes, the script prints Cust-code on each line, not the value for it. If I escape Cust-code like Cust\-code, I get an Illegal escape character. Any ideas?I have never used Progress, but maybe you have to fully qualify the field names like this:
ResultSet rs = stmt.executeQuery( "SELECT * FROM pub.cust WHERE pub.cust.Cust-code='100001-0'" ) ;
ResultSet rs = stmt.executeQuery( "SELECT pub.cust.Cust-code FROM pub.cust" ) ;Just a thought. -
Friends,
We are running ORACLE 11g in Unix enviornment. Every week, our application run a flow from application, its run a query everytime and its not use the right index due to this its take lot of time. I want to set in database, its use everytime our mention index and does not change execution plan. Any ideas?
Regards,
Irfan AhmadHi
Use a sql profile. You can have a hint to you the index so when application use the sql statement it will start using the sql statement with index hint .
DECLARE
test_task_name VARCHAR2(30);
test_sqltext CLOB;
BEGIN
test_sqltext := 'SELECT /*+ index(XX <your index name>) */ * from < your table> XX where co1=''yyyy'')';
test_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(
sql_text => test_sqltext,
user_name => '<your schema name>',
scope => 'COMPREHENSIVE',
time_limit => 60,
task_name => 'test_sql_tuning_task_2',
description => 'Test Task to tune a query');
END;
BEGIN
DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name => 'test_sql_tuning_task_2');
end;
Check the oracle support document 271196.1 for further clarification
Cheers
Kanchana.
Edited by: Kanchana Devasurendra on Nov 1, 2010 3:47 PM -
Hi all
I'm facing a problem with my code.
Dim cr As New CrystalReport1()
Dim newCmd As SqlCommand
Dim conn As SqlConnection
Dim da As New SqlDataAdapter
Dim ds As New DataSet
Dim cr As New CrystalReport1
Dim MyConnectionStr As String = "Data Source=MyDB;Initial catalog=MyCat;Integrated Security=true;" ' providerName=System.data.sqlClient"
conn = New SqlConnection(MyConnectionStr)
Dim cmdText As String
cmdText= " SELECT customer.customer_name, customer.customer_tel, orders.order_stuff_name, orders.order_number" & _
" FROM hesabres.dbo.orders orders inner JOIN hesabres.dbo.customer customer ON orders.order_customer_id=customer.customer_id"
da = New SqlDataAdapter(newCmd)
da.fill(ds)
cr.SetDataSource(ds.Tables(0))
crystalviewer1.ReportSource = cr
conn.Close()
newCmd.Dispose()
if i run the query, let's say it returns 2 rows
I my CR veiwer, it shows 4 rows (duplicates 2 x 2),
if the query returns 3 rows, CR displays 9 rows (3 x 3) and so on 10 (10x10)....
How is it possible??
In my Dataset, the number of rows is always correct!
Do you have any idea?
Thanks in advance.
B.See this wiki on how to troubleshoot issues with CR and datasets:
Troubleshooting Issues with VS .NET Datasets and Crystal Reports - Business Intelligence (BusinessObjects) - SCN Wiki
- Ludek
Senior Support Engineer AGS Product Support, Global Support Center
Canada
Follow us on Twitter -
Regarding accessing SQL query issued by any user in Oracle 10g
Hi all,
i want to know the queries issued by various users accessing a database...
But the in view DBA_AUDIT_TRAIL,I was getting empty value...(in SQLTEXT column) ...how can i get this value...
Thanx
in advance..Straight from the documentation :
The SQL_BIND and SQL_TEXT columns are only populated if the AUDIT_TRAIL initialization parameter is set to db,extended.In addition, you have to make sure you issued the AUDIT command on the objects you would like to AUDIT access on.
[Configuring and Administering Auditing|http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/cfgaudit.htm] -
SQL Query issue find difference in records
Hi All,
I am using oracle 10g. I need urgent help in finding difference in records based on date:
I have table sales as below:
salesman SALES_COUNT DATE
JOHN 20 04/01/2012
DENNY 15 04/01/2012
JOHN 30 04/02/2012
DENNY 30 04/02/2012
JOHN 45 04/03/2012
DENNY 50 04/03/2012
SALES_COUNT is increasing for sales man with date. Its like cumulative count. John has total sales from 04/01/2012 to 04/03/2012 is 50 and same case with Denny. This SALES_COUNT will keep on increasing with dates as sales keep adding in the table for each salesman.
But i want to have seprate counts for each salesman.
for e.g: SALES_COUNT JOHN on 04/02/2012 is 30-20 =10
SALES_COUNT JOHN on 04/03/2012 is 45-30 =15
SALES_COUNT DENNY on 04/02/2012 is 30-15 =15
SALES_COUNT JOHN on 04/03/2012 is 50-30 =20
Please help me with this scenario and let me know if need more information. I will greatly appreciate your help.
Thanks.Does this give you what you want?
with t as (
select 'JOHN' salesman, 20 sales_count, to_date('04/01/2012', 'mm/dd/yyyy') sale_date from dual
union all
select 'DENNY' salesman, 15 sales_count, to_date('04/01/2012', 'mm/dd/yyyy') sale_date from dual
union all
select 'JOHN' salesman, 30 sales_count, to_date('04/02/2012', 'mm/dd/yyyy') sale_date from dual
union all
select 'DENNY' salesman, 30 sales_count, to_date('04/02/2012', 'mm/dd/yyyy') sale_date from dual
union all
select 'JOHN' salesman, 45 sales_count, to_date('04/03/2012', 'mm/dd/yyyy') sale_date from dual
union all
select 'DENNY' salesman, 50 sales_count, to_date('04/03/2012', 'mm/dd/yyyy') sale_date from dual
select salesman,
sales_count sales_todate,
sale_date,
sales_count - lag(sales_count, 1, 0) over (partition by salesman order by sale_date) daily_sales
from t
SALESMAN,SALES_TODATE,SALE_DATE,DAILY_SALES
DENNY,15,4/1/2012,15
DENNY,30,4/2/2012,15
DENNY,50,4/3/2012,20
JOHN,20,4/1/2012,20
JOHN,30,4/2/2012,10
JOHN,45,4/3/2012,15
-
Hi all,
I think I'm being really stupid but I'm having SQL query issues.
I have a table with lots of lines of transactions which all refer to different stores, for example:
Store..............._Sales_............._Month_
Reading............200k..............April
Leeds...............50k................April
Manchester........70k................May
Reading............100k..............May
I need to come up with the average Sales for the combined months as a total. I.e. the average Store revenue for a given period is 200k+ 50k + 70k +100k / *3* (As there are only 3 unique stores) - hopefully this makes sense!
So essentially I am trying to do both a SUM query (and grouping by store) and then outputting the average of all stores together. Is this possible?
Thank you,Hello,
This query returns 140 what seems to be the correct value:
with data as
( select 'Reading' Store
, 200 sales
from dual
union
select 'Leeds'
, 50
from dual
union
select 'Manchester'
, 70
from dual
union
select 'Reading'
, 100
from dual
select sum(sales)
, count( distinct store )
, sum(sales)/count(distinct store)
from dataThere are multiple options:
1. You can get two IR's on one page (by using IFRAMEs - search for that word on the Forum)....
2. You create another region with the query above and position that just below the report
3. In the Region Footer call a PL/SQL process (using AJAX) that calculates the value using the query and prints it there (using htp.p)
Greetings,
Roel
http://roelhartman.blogspot.com/
http://www.bloggingaboutoracle.org/
http://www.logica.com/
You can award this reply to your question by marking it as either Helpful or Correct ;-) -
Build stored procedure from a dynamic SQL query
I have the following method, that receives a string from a textbox and creates a dynamic select command. Since I am using a dataSet I cannot execute a dynamic SQL query by calling a method of a strongly-typed dataset (.xsd). I have been told that the best
way to do this is to pass an array of values to the stored procedure.
But I have no clue how to build the stored procedure.
string[] allWords = txtSearch.Text.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
string sql = "SELECT Books.ISBN, Books.Title, Books.Tag, Books.Image, Books.photoType, Publishers.Name AS publisherName FROM Books INNER JOIN Publishers ON Books.codPublisher = Publishers.codPublisher WHERE ";
using (SqlCommand command = new SqlCommand())
for (int i = 0; i < allWords.Length; ++i)
if (i > 0)
sql += "OR ";
string paramName = "@param" + i.ToString();
sql += string.Format("(Books.Title LIKE {0}) ", paramName);
command.Parameters.AddWithValue(paramName, allWords[i] + "%");
command.CommandText = sql;
//execute the SQL query against the db...After hours around this, I have came with this solution.
private SqlConnection sqlConn = new SqlConnection();
private System.Data.DataSet dataSet = new System.Data.DataSet();
private System.Data.DataTable dataTable;
private System.Data.DataRow dataRow;
private SqlCommand search(string searchParam, int searchOption)
SqlCommand command = new SqlCommand();
string sql;
string[] allWords = searchParam.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
if (searchOption == 1)
sql = "SELECT Livros.ISBN, Livros.Titulo, Livros.Tema, Livros.Resumo, Livros.Imagem, Livros.fotoTipo, Editoras.Nome AS nomeEditora FROM Livros INNER JOIN Editoras ON Livros.codEditora = Editoras.codEditora WHERE ";
else
sql = "SELECT Livros.ISBN, Livros.Titulo, Livros.Tema, Livros.Resumo, Livros.Imagem, Livros.fotoTipo, Editoras.Nome AS nomeEditora FROM Livros INNER JOIN livrosAutores ON Livros.ISBN = livrosAutores.ISBN INNER JOIN Autores ON livrosAutores.idAutor = Autores.idAutor INNER JOIN Editoras ON Livros.codEditora = Editoras.codEditora WHERE ";
using (command)
for (int i = 0; i < allWords.Length; ++i)
if (i > 0)
sql += "OR ";
if (searchOption == 1)
sql += string.Format("(Livros.Titulo LIKE '%{0}%') ", allWords[i]);
else
sql += string.Format("(Livros.Autor LIKE '%{0}%') ", allWords[i]);
command.CommandText = sql;
return command;
protected void Bind()
sqlConn.ConnectionString = Properties.Settings.Default.BibliotecaConnectionString;
string connectionString = sqlConn.ConnectionString.ToString();
SqlDataAdapter sqlDataAdapter = new SqlDataAdapter(search(searchText, searchOption).CommandText, connectionString);
sqlDataAdapter.Fill(dataSet, "livrosTitulo");
dataTable = dataSet.Tables["livrosTitulo"];
dataGrid.DataContext = dataTable.DefaultView; -
I am trying to see the log file in Manage sessions for the sql query in Answers. I see that if we run the same report multiple times, the sql query is showing up only the first time. Second time if I run it is not showing up. If I do a brand new report with diff columns picked it is giving me the sql then. Where do I set this option to show the sql query everytime I run a report even if it is the same report run multiple times. Is this caching issue?
It shouldn't.... Have you unchecked the "Cache" on the physical layer for this table? If you go onto the Advanced tab, is the option "Bypass the Oracle BI cache" checked?
-
Issue with SQL Query with Presentation Variable as Data Source in BI Publisher
Hello All
I have an issue with creating BIP report based on OBIEE reports which is done using direct SQL. There is this one report in OBIEE dashboard, which is written using direct SQL. To create the pixel perfect version of this report, I am creating BIP data model using SQL Query as data source. The physical query that is used to create OBIEE report has several presentation variables in its where clause.
select TILE4,max(APPTS), 'Top Count' from
SELECT c5 as division,nvl(DECODE (C2,0,0,(c1/c2)*100),0) AS APPTS,NTILE (4) OVER ( ORDER BY nvl(DECODE (C2,0,0,(c1/c2)*100),0)) AS TILE4,
c4 as dept,c6 as month FROM
select sum(case when T6736.TYPE = 'ATM' then T7608.COUNT end ) as c1,
sum(case when T6736.TYPE in ('Call Center', 'LSM') then T7608.CONFIRMED_COUNT end ) as c2,
T802.NAME_LEVEL_6 as c3,
T802.NAME_LEVEL_1 as c4,
T6172.CALENDARMONTHNAMEANDYEAR as c5,
T6172.CALENDARMONTHNUMBERINYEAR as c6,
T802.DEPT_CODE as c7
from
DW_date_DIM T6736 /* z_dim_date */ ,
DW_MONTH_DIM T6172 /* z_dim_month */ ,
DW_GEOS_DIM T802 /* z_dim_dept_geo_hierarchy */ ,
DW_Count_MONTH_AGG T7608 /* z_fact_Count_month_agg */
where ( T802.DEpt_CODE = T7608.DEPT_CODE and T802.NAME_LEVEL_1 = '@{PV_D}{RSD}'
and T802.CALENDARMONTHNAMEANDYEAR = 'July 2013'
and T6172.MONTH_KEY = T7608.MONTH_KEY and T6736.DATE_KEY = T7608.DATE_KEY
and (T6172.CALENDARMONTHNUMBERINYEAR between substr('@{Month_Start}',0,6) and substr('@{Month_END}',8,13))
and (T6736.TYPE in ('Call Center', 'LSM')) )
group by T802.DEPT_CODE, T802.NAME_LEVEL_6, T802.NAME_LEVEL_1, T6172.CALENDARMONTHNAMEANDYEAR, T6172.CALENDARMONTHNUMBERINYEAR
order by c4, c3, c6, c7, c5
))where tile4=3 group by tile4
When I try to view data after creating the data set, I get the following error:
Failed to load XML
XML Parsing Error: mismatched tag. Expected: . Location: http://172.20.17.142:9704/xmlpserver/servlet/xdo Line Number 2, Column 580:
Now when I remove those Presention variables (@{PV1}, @{PV2}) in the query with some hard coded values, it is working fine.
So I know it is the PV that's causing this error.
How can I work around it?
There is no way to create equivalent report without using the direct sql..
Thanks in advanceI have found a solution to this problem after some more investigation. PowerQuery does not support to use SQL statement as source for Teradata (possibly same for other sources as well). This is "by design" according to Microsoft. Hence the problem
is not because different PowerQuery versions as mentioned above. When designing the query in PowerQuery in Excel make sure to use the interface/navigation to create the query/select tables and NOT a SQL statement. The SQL statement as source works fine on
a client machine but not when scheduling it in Power BI in the cloud. I would like to see that the functionality within PowerQuery and Excel should be the same as in Power BI in the cloud. And at least when there is a difference it would be nice with documentation
or more descriptive errors.
//Jonas
Maybe you are looking for
-
She also mentioned if I had an apple store here I could take it in it may be faster, we just had a new apple store that opened in our mall so I took it in, talked to the tech and he pushed the button to see what I meant, then he says yeah this is bro
-
Trouble using external display
I am trying to use my TV as an external display using a mini-dvi to dvi cable. My desktop picture shows up on my TV but nothing else. No Quicktime or Safari windows. The only thing window that show up on the TV is the Display window from system prefe
-
Copy photo's to ipad without internet
Hi, Is there any smart way to copy photo's and video's shot on the iPhone 5s to an iPad mini? This without an internet connection? tia Peter
-
Itunes won't display cover art correctly
When I view my music in the album list, the cover art for songs will show up very sporadically, despite displaying fine in the grid and cover flow formats. They also show up when I select "Get Info" as part of the information and in the cover section
-
Privileges to EXECUTE IMMEDIATE
Hi all, In PL/SQL code, I am getting error msg : " ORA-01031 Insufficient privileges " for EXECUTE IMMEDIATE 'CREATE TABLE ...' . which grants I have to provide for the same ? FYI that I can create a same table from same schema name using SQL prompt.