Using SQL Query Values as Report Parameters
Why can I not use a page item to pass a value to a report when that page item is populated by a SQL query? If the item is populated as a database item, it can be passed, but not otherwise. Is there a way to work around this problem so that I can pass parameters to a report?
Hi, Jeff
Thanks for asking about this problem. This issue involves two tables mainly and others peripherally. I have a person table with borrower names and addresses, and each record in this table has an identifier in a column called IDENT. There is also a loan table with essential data on the loan, e.g.., loan identifier (DKTNR), the amount, interest rate, maturity date, etc., and also the IDENT linking to the person table. The borrower can be identified from any table that has the DKTNR in it by querying the borrower's name from the person table via the IDENT in the loan table. E.g., select borrower's name from loan_table, person_table where loan_table.ident = person_table.ident and the dktnr here equals the dktnr in the loan table.
I put the borrower's name on each APEX page using this query. I have one table, for example, which stores default accountings (i.e., accountings on loans that have defaulted and, generally, on which the lender has had to expend money to maintain the loan's maritine collateral). The records in this table are identified by the DKTNR. So on the reports page which shows this accounting, there is a non-database_column field (page item) populated via this query. If I want to use the value of this page item on an Oracle report that can be printed, I cannot do so. I place it into a variable (I forgot the name of the variable type, but it is the &PX_ITEM_NAME. type) in the URL which calls the report, but it will not be placed in the report. It is as if I have put a null value into the variable.
Ideas?
Similar Messages
-
How to use SQL Query in OBIEE Reports
Hi all,
I need to use direct sql query in report function column.. How can I implement that.
For example
Our report name is /shared/Automotive/Vehicle Services/Most Serviced Vehicle Models
we have to eliminate /shared/Automotive/Vehicle Services/ part from above report name.. I have done this in sql using the Query SUBSTR(COL,INSTR(COL,'/',1,4)+1).
So kindly help how to implement above sql query in Obiee.. Urgent.
Thanx in advance796797 wrote:
Hi all,
I need to use direct sql query in report function column.. How can I implement that.
For example
Our report name is /shared/Automotive/Vehicle Services/Most Serviced Vehicle Models
we have to eliminate /shared/Automotive/Vehicle Services/ part from above report name.. I have done this in sql using the Query SUBSTR(COL,INSTR(COL,'/',1,4)+1).
So kindly help how to implement above sql query in Obiee.. Urgent.
Thanx in advanceArrggh. I wish people wouldn't just answer a question without taking the time to actually think about what the user is asking for and if it makes sense. I like Diney's response best: Why not use the Title View? (i.e., asking questions until it is clear what is needed.) So along those lines, why are you trying to put the name of your report in a column of your report?? And why do you need to use direct sql to do this??
Kindly or not, urgent or not, state what you are trying to achieve and why you need it (if the obvious answer like "using the Title View" doesn't work for you), instead of simply assuming your method is right and you need to know how to do what envision. Your method may not be correct or necessary. -
Problem use SQL query in coding report with SBO
Hi everyone!
I have problem in execute query to delete and create a report with SQL 2000 in SAP.
Try
oForm.DataSources.DataTables.Item(0).ExecuteQuery("DELETE FROM rptReport")
Catch ex As Exception
End Try
oForm.DataSources.DataTables.Add("TestReport")
oForm.DataSources.DataTables.Item(0).ExecuteQuery("SELECT Number, RefDate, Memo into rptReport FROM dbo.OJDT")
oTable = oForm.DataSources.DataTables.Item("TestReport")
This code is error. I don't know how to execute 2 this sql command. Hope everyone help me hix hix! ./Invalid query tree [300-33]. The SQL error is 8180/
But search in SQL book hasn't got that err. Some person spoke ExecuteQuery property wasn't support Table Delete and Create, it only support simple Select... I tried to use Recordset but don't success. Can I use "Delete" and "Select ... Into..." query another style??? Help me, please...!!! -
Retreving Hexadecimal Values from a table using SQL query.
Hi,
I'm looking for a query to retreive Hexadecimal values contained in a column using SQL query.
The column contains the values of all types, alphanumeric, numeric and hexadecimal.
I need to retreive only hexadecimal values.
any help to me in this regard will be appreciated.
ThanksPresumably, you can be sure that any valid hex value is indeed MEANT to BE a hex value. For example the value 'ACE' is meant to be a hexadecimal value and not the word.
-
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. -
ReportViewer using SQL Query error states: Incorrect syntax near ','.
Hello Community
Using Visual Studio 2008 and SQL Server 2008 I created a Windows Application
that uses SQL Server Reporting Services. The application uses ReportViewer and
calls a method written using SQL query.
1-First I created the form.
2-Next I dragged the ReportViewer (Toolbox) and Table (from DataSource) onto the form.
The problem is that when it reaches the last line of the SQL query (ie, da.Fill(ds, "TableOne");)
the code fails stating the error message:
"Incorrect syntax near ','."
The following is the code behind the form containing the query:
private void ReportPgm1_Load(object sender, EventArgs e)
// TODO: This line of code loads data into the 'ReportDBDataSet.TableOne' table. You can move, or remove it, as needed.
this.TableOneTableAdapter.Fill(this.ReportDBDataSet.TableOne);
reportViewer1.ProcessingMode = ProcessingMode.Local;
LocalReport ReportOneLocalReport = reportViewer1.LocalReport;
DataSet ds = new DataSet("ReportDBDataSet.TableOne");
pgmReportOne(FromDate, ToDate, ds);
ReportDataSource ds = new ReportDataSource("ReportDBDataSet.TableOne");
ds.Value = dataset.Tables["TableOne"];
ReportOneLocalReport.DataSources.Clear();
ReportOneLocalReport.DataSources.Add(ds);
this.reportViewer1.RefreshReport();
private void pgmReportOne(DateTime FromDate, DateTime ToDate, DataSet ds)
SqlConnection connection = new SqlConnection("Data Source=ReportDBServer;Initial Catalog=ReportDB;Uid=sa;pwd=Password");
string sqlReportOne = "Select ([InDate], [FirstName], [LastName], [AGe]" +
"from TableOne";
SqlCommand command = new SqlCommand(sqlReportONe, connection);
command.Parameters.Add(new SqlParameter("paramFDate", FromDate));
command.Parameters.Add(new SqlParameter("paramTDate", ToDate));
SqlDataAdapter da = new SqlDataAdapter(command);
da.Fill(ds, "TableOne");
Why does the last line throw an error?
Thank you
Shabeaut--NOTE: The statement below cannot be run on SQL Server 2012
--If you have an earlier version and can set the compatibility
--level to 80, it can be run.
SELECT sso.SpecialOfferID, Description, DiscountPct, ProductID
FROM Sales.SpecialOffer sso,
Sales.SpecialOfferProduct ssop
WHERE sso.SpecialOfferID *= ssop.SpecialOfferID
AND sso.SpecialOfferID != 1
Hi Scott
The *= is old syntax and not compatible with SQL Server 2012 (as stated in the comments).
You could do something like this instead
SELECT sso.SpecialOfferID
,Description
,DiscountPct
,ProductID
FROM Sales.SpecialOffer sso
left outer join Sales.SpecialOfferProduct ssop on sso.SpecialOfferID = ssop.SpecialOfferID
WHERE sso.SpecialOfferID != 1 -
How to get tax break up of TDS using SQL query ?
Hi all,
We are developing a TDS report using SQL query
Report will contain VendorCode,Date(ap inv date),Vendor name,
Bill value,TDS Amount,
Bill Value 100.000,
TDS (2%) - 2.000,
TDS Surcharge(10% on TDS) - 0.2,
TDS Cess(2%(TDS+TDS Surcharge)) - 0.044,
TDS HeCess(1%(TDS+TDS Surcharge)) - 0.022.
We have developed this report which displays upto
VendorCode,Date(ap inv date),Vendor name,
Bill value,TDS Amount.
How to show tax break up of TDS in SQL query ?
Thanks,
With regards,
Jeyakanthan.Hi gauraw,
Thank for your reply.
I modified the query , pasted the query
as below in query generator,
Select T0.DocNum,T0.DocDate,T0.CardCode as 'Ledger',T1.TaxbleAmnt As 'Bill value',T1.WTAmnt as 'TDSAmt',(TDSAmt * 0.1) as 'TDS_Surch',
(((TDSAmt0.1) + TDSAmt)0.02) as 'TDSCess',
(((TDSAmt0.1) + TDSAmt)0.01) as 'TDSHCess'
FROM OPCH T0 INNER JOIN PCH5 T1 ON T0.DocEntry = T1.AbsEntry
WHERE (T0.DocDate >= '[%0]' and T0.DocDate <= '[%1]')
on clicking execute its showing error message invalid column
name 'TDSAmt'.
With regards,
Jeyakanthan -
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 -
See sql query from crystal report without crystal report
see sql query from crystal report without crystal report
Hi,
Depends on datasource type but you could have a look at ODBC trace or if you have access to the SQL Server you could use profiler to monitor the session.
Regards,
Craig
And this will only be of use if you know which Server/Insstance/Database the Report is connecting to...
Please click "Mark As Answer" if my post helped. Tony C. -
How to Use SQL Query having IN Clause With DB Adapter
Hi,
I am using 11.1.1.5 want to find out how to Use SQL Query having IN Clause With DB Adapter. I want to pass the IN values dynamically. Any ideas.
Thanksinvoke a stored procedure, it's safer than trying to put together an arbitrary SQL statement in the JCA adapter
-
How to enable show SQL Query in Crystal report tool
Hi,
How can we enable the show SQL Query under Database tab in crystal report...
We have a requirement to modify the SQL query in Crystal reports.
Thanks,
GanaGana,
CR has an "Add Command" feature that will allow you to use hand-coded SQL as your data source.
Look at Defining an SQL Command in CR's online help (F1).
If a command was used in the original report creation, it's a simple matter to go in and edit that SQL.
If the report was not originally built w/ a Command you may find it difficult to switch over. In most cases it easier to start over from scratch, creating a new, blank report, that uses the command.
Jason -
How to numberformat when using sql:query alogn with c:forEach JSTL tags
Is there anyway to format the numeric values returned from the database when using <sql:query> alogn with <c:forEach> tags
Here is my jsp code
<sql:query..../>
<c:forEach var="row" items="${queryResults.rows}">
<tr>
<td><c:out value="${row.COL1}" /></td>
<td><c:out value="${row.COL2}" /></td>
</tr>
</c:forEach>
Col1 values are numeric without any formats Eg: 1000, 10000, 1000000 etc.
how can i format them to 1,000 , 10,1000 , 100,000 etcIt is polite to mention what your answer was. These posts are not just here for you to ask questions, but to be used as a resource for other people to find answers. Saying "I solved it" with no details helps noone.
I presume you discovered the JSTL <fmt:formatNumber> tag? -
Modify SQL query in Crystal Reports 2013
Bonjour,
Je voulais savoir s'il était possible de modifier la requête SQL dans Crystal Reports 2013, car les bases de données de notre application pour bibliothèque utilise un format de date particulier qu'il nous faut corriger directement dans la requête SQL.
Merci pour vos informations.
Cordialement
Claude Marcilly
Cannes - France
Hello,
I wanted to know if it was possible to modify the SQL query in Crystal Reports 2013. Databases of our application library indeed use a particular date format that we need to fix directly into the SQL query.
Thank you for your information.
Best regards
Claude Marcilly
Cannes - FranceHi Claude,
If you are creating reports using tables then go in Database menu and click on show SQL query, this will show the SQL generated by crystal reports. Now go in database expert and expend your connection and double click on Add Command and past the query which was generated by Crystal and try to modify the date format and click OK.
Now you need to redesign your reports based on Add command.
or
If your reports datasource is Add command you can directly go in add command and change it.
-Sastry -
List of Project Permission in PS 2010 Using SQL query
Hi
Is there any way to get a list of Project permissions associated with user using sql query. If i go manually Project center --> select project plan --> project permission it would take lot of time to find out for each user
Regards
SantoshBefore you continue (which you probably will overlook) - please understand that you should only be querying the REPORTING database and not the published database. A recommendation is to use a select statement statement to insert the tables into a table
int the reporting database, then query that table for your results/report.
The following page I believe has what you're looking for (Users with direct permissions- query below)
and more
http://pmpspecialists.com/Blog/2013/10/
SELECT MSP_RESOURCES.RES_NAME AS Resourcename, CONV.CONV_STRING AS Permission, MSP_WEB_SECURITY_SP_CAT_PERMISSIONS.WSEC_DENY AS Denied,
MSP_WEB_SECURITY_SP_CAT_PERMISSIONS.WSEC_ALLOW AS Allowed
FROM MSP_WEB_SECURITY_SP_CAT_PERMISSIONS INNER JOIN
MSP_WEB_SECURITY_SP_CAT_RELATIONS ON
MSP_WEB_SECURITY_SP_CAT_PERMISSIONS.WSEC_REL_UID = MSP_WEB_SECURITY_SP_CAT_RELATIONS.WSEC_REL_UID INNER JOIN
MSP_WEB_SECURITY_FEATURES_ACTIONS ON
MSP_WEB_SECURITY_FEATURES_ACTIONS.WSEC_FEA_ACT_UID = MSP_WEB_SECURITY_SP_CAT_PERMISSIONS.WSEC_FEA_ACT_UID INNER JOIN
MSP_WEB_CONVERSIONS AS CONV ON CONV.CONV_VALUE = MSP_WEB_SECURITY_FEATURES_ACTIONS.WSEC_FEA_ACT_NAME_ID INNER JOIN
MSP_RESOURCES ON MSP_WEB_SECURITY_SP_CAT_RELATIONS.WSEC_SP_GUID = MSP_RESOURCES.RES_SECURITY_GUID
WHERE (CONV.LANG_ID = 1033)
ORDER BY Resourcename, Permission -
How to retrive the blob data from a table using sql query
Hi gurus,
I have a table which has " BLOB "content in a column .I want to view the data From BLOB column using sql query .It would be helpfull If some one share their idea.
Regards,
vardhani.You can use data templates.
See this: http://blogs.oracle.com/xmlpublisher/entry/blob_clob_raw_and_looooong
http://blogs.oracle.com/xmlpublisher/entry/inserting_blobs_into_your_repo
Thanks,
Bipuser
Maybe you are looking for
-
hello, I recently had to set up my network. Now My ipad and iphone no longer see the time machine. I have all green on the time machine and two airport express, my internet connection is a modern 2wire. Before the latest set up I could see the time m
-
How to find out the IBU of the logges in user with some relationship?
Hi, How to find out the IBU of the logges in user with some relationship? Regards, Jaya
-
Hi, I have a G5 running tiger (soon to be running leopard hopefully) with a DVI cinema display. I have a PC that I use for testing my work on the Web. I was able to switch back and forth easily with a Belkin KVM switch back when I was using a VGA mon
-
Can't click on users during startup screen
Hi, I am unable to select user accounts by clicking them in the startup screen. But my trackpad is working fine once I am logged in by selecting the user account by pressing arrow. Please advice on this. Regards, Adarsh Sudheesan
-
Where are my apps from my old phone
I just synced my new phone with my desktop and cannot find any of my purchased apps. Even when I go to the app store, it shows no purchased apps. Help!