CRVS2010 Beta - Edit Sql query at runtine
Hello,
I'm migrating an old application in delphi to C#. This application is able to change the Sql query at run time (without using RecordSelectionFormula) to add filtering in where clause. I want to do the same, but I didn't found any equivalent property, and I don't think it's possible to convert the query into RecordSelectionFormula's format (too complex).
I can't modify rapports too btw.
Any help ?
Thanks,
And then again:
//Set the attributes for the logonPropsBag
logonProps.Add("Database", "xtreme");
logonProps.Add("DSN", "DSN Name");
logonProps.Add("UseDSNProperties", "False");
//Set the attributes
QEProps.Add("Database DLL", "crdb_odbc.dll");
QEProps.Add("QE_DatabaseName", "xtreme");
QEProps.Add("QE_DatabaseType", "ODBC (RDO)");
//Add the QE_LogonProperties we set in the logonProps Object
QEProps.Add("QE_LogonProperties", logonProps);
QEProps.Add("QE_ServerDescription", "Dwilliams1 - VAN-W-13-DWILLI");
QEProps.Add("QE_SQLDB", "True");
QEProps.Add("SSO Enabled", "False");
newConnInfo.Attributes = QEProps;
newConnInfo.UserName = "sa";
newConnInfo.Password = "password";
newConnInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
newTbl.ConnectionInfo = newConnInfo;
newTbl.CommandText = sql;
newTbl.Name = "Command";
//foreach(CrystalDecisions.ReportAppServer.DataDefModel.Table tbl in rcd.Database.Tables)
// use the above line for more than one table if required, Also note the Table[0] index needs to be updated also.
//oldTbl = tbl.Clone(true);
rcd.DatabaseController.SetTableLocationEx(oldTbl,newTbl);
oldTbl =(CrystalDecisions.ReportAppServer.DataDefModel.Table) rcd.Database.Tables[0].Clone(true);
rcd.DatabaseController.SetTableLocationEx(oldTbl, newTbl);
// save the report to a new folder
rcd.SaveAs(rcd.DisplayName, "c:
Updated
", 0);
Thank you
Don
Similar Messages
-
Validate and Edit SQL Query Errors
I am trying to "Validate or Edit SQL Query" in APEX 3.0. When I open up the SQL Query its highlighted in red and when I click on the Validate or Edit button it gives me an error.
I modified my marvel.conf file to include:
AddType text/xml xbl
AddType text/x-component htc
and this still didnt take care of it. Any ideas and thank you in advance.
PS: OPS - Windows Server 2003
Upgraded from 1.6 to 3.0I've gotten so used to command line editing, that I rarely us "ed". back in the days of DOS, the default editor was EDLIN - one of those goofy editors that only showed one line at a time, so it wasn't much of an improvement. you could switch to the old dos editor, but that wasn't much better (just checked, it's still there)
some nice things with command line editing
to change everthing between the first two single quotes
c/'...'/'new criteria'to remove everything after a specific string
c/from.../fromto change a string that contains (or will contain) slashes
c.1/2.1/4. -
How to Edit SQL Query in Crystal XI?
Post Author: sk8skiier
CA Forum: Data Connectivity and SQL
I'm wondering if any of you can help me. We've recently upgraded from Crystal Reports 6 to Crystal Reports XI, the version on my machine is 11.0.0.2178 and is the Professional version.
In Crystal 6, it was very easy to change the data that you wanted returned by editing the sql query, but in XI, I can only find a way to view the query, not edit it. Am I missing something?
Thanks for the help, I appreciate it.Post Author: yangster
CA Forum: Data Connectivity and SQL
Good news and bad news. Bad news is you can't edit the viewed sql statement anymore in any version of Crystal 9 or higher.Good news is you can write custom sql commands instead of dealing with having to join tables. So if you know the sql you want to produce that was in version 6 just copy and paste it into the add command feature and edit it in there and you will be exactly where you want to be. -
Post Author: Sbaptista
CA Forum: Data Connectivity and SQL
Hi All. I'm new to CR10, and have many reports created in CR8.5. However, when I open these reports in CR10, I cannot edit the SQL Query... it is completely greyed out. To add fuel to the fire, we are now attempting to retrieve the data from another database (same structure and data but different location). I'm able to see the new database and can create a basic report, but cannot modify the SQL query. Any thoughts? It's been years since I worked with Crystal so please bear with me. Thanks!Post Author: ph03nix
CA Forum: Data Connectivity and SQL
The short answer is: you can't. If you want to be able to edit your SQL queries, you need to do as the previous response indicated - use the Command option in the Database Expert. I don't know about 10, but in 11, you cannot add a Command once you've added any tables. (You may also want to check the licensing levels - I seem to recall something about a license above Developer that has/had additional functionality, at least in 11, but I'm not positive what that includes). -
Edit sql query in Database Fields Command
Is there any way to edit the query that is specified in the DatabaseFields > Command dinamically from java? If so, how would I do that? I need to edit/append its "where" clause.
I have been googling the topic for several days, and have found nothing.
Please help!Hi,
Tried that too. No luck. Gives me this.
The selected operation process could not be invoked.
An exception occured while invoking the webservice operation. Please see logs for more details.
oracle.sysman.emSDK.webservices.wsdlapi.SoapTestException: Exception occured when binding was invoked.
Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'selectUsingIn' failed due to: Pure SQL Exception.
Pure SQL Execute of select interface_id, property_name, property_value from ( (?) ) failed.
Caused by java.sql.SQLSyntaxErrorException: ORA-00903: invalid table name
The invoked JCA adapter raised a resource exception.
Please examine the above error message carefully to determine a resolution.
Regards,
Neeraj Sehgal -
SQL Query locked againest changes
Hi All,
I am trying to edit SQL query from SQ01. It is giving me an error message 'Query locked by user ASNG against changes'.
I tried the same in Development and Quality at different times, but all the time it is giving me the same error.
I can't see any mechanism to lock/unlock the queries againest changes in menu. Can anyone please help me to resolve this?
Regards,
Sridhar.Hi,
Changing Queries
Use
Provided that you have the appropriate authorizations, you are able to process a query that has been created already.
Procedure
Proceed as follows to change an existing query:
On the initial screen, choose a user group and type the query name. The query you specify must already exist in the user group.
Choose the Change function.
You are taken to the Title, Format screen.
In the Field Selection, Basic List, Statistics, and Ranked List series of screens, you make the changes that you require.
Additional Functions
Status info
Choose the Extras ® Status Info function, to find out who created the query or who last made changes to the query.
Ranjith. -
How can I edit custom query in Data Insight
1. Whenever I click the edit sql query by right clicking on the custom query, the system hangs up and does not proceed further
2. Once you create a query without retrieving data results, is it possible to change to retrieve the data and how.
Thanks - MahrukhHi Mahrukh,
I do not have this issue. What version of Data Insight are you using? What database is your metadata repository? What database is your source data in for the Data Insight query you are writing? Have you tried double clicking on the custom query - this should open it up for you to be able to edit it as well!
You should be able to open the query to edit it and either click the return data box or un-check it for any type of query.
Thanks,
Denise -
Editing CR's base SQL query?
Is there a way to edit the SQL query that Crystal Reports is using to pull its original data? Here's my problem:
I'm tasked with writing a report on transactions from the GL. Datatel's Colleague, our newly implemented system, stores transaction data in a table called "GLA_2008 (or whatever FY)". The beginning balance, however, is stored in another table called "GLS_2008". A for "activity", S for "summary", right? Now, the GLS table is keyed with the GL account numbers. The GLA table, however, is keyed with numbers that are the GL account number with the transaction number appended to that with an asterisk delimiter (11010102340000*198). Yes, this is crappy database design. Not my fault. More importantly, it's unchangeable as that's how this system needs it to be.
So, what I need to do is get into the query that CR is using to pull this data and join the GL account number from the GLS table with LEFT(GLA_2008.GLA_ID, 15) rather than the actual key field, as those won't join. Is there any way to do this? It seems like it would be rather simple, but the "Show SQL Query" thing is read-only.
It's worth pointing out that without that join, CR appears to pull in all records from both tables, and that crashes CR, so doing a formula field with LEFT() in it and making the join in the report rather than the original query doesn't seem to work.Just go to the "Select Expert" for Records and add:
LEFT(GLA_2008.GLA_ID, 15) = account number
It just tried it and it works, with the "LEFT" function and all (I used my own string field of course...).
It doesn't show up in "Show SQL", but it sure is filtering by it.
The Panda -
Better SQL Query for clients without boundaries?
I've been using and modifying/experimenting with Chris Nackers' SQL query for missing boundaries (http://myitforum.com/myitforumwp/2011/12/07/sql-query-to-identify-missing-smsconfigmgr-boundaries/)
below (changed to add aliases)--but this seems to mainly be showing us non-clients, as several computers that were indeed missing boundaries (using SCCM 2007 SP2 R3, and all our boundaries are protected, most are IP Range, a few IP Subnet, none AD Site) are
not being listed, and everything in the listing has NULL SYS.Client0.
Is there a better query to pinpoint this issue, or maybe using something (error code or log?) that would show computers that can't find a distribution point or some other evidence of not having a boundary?
Thanks!
SELECT DISTINCT SYS.Name0, SYS.Client0, IPA.IP_Addresses0, IPS.IP_Subnets0, SMSAS.SMS_Assigned_Sites0
FROM dbo.v_R_System SYS
LEFT OUTER JOIN dbo.v_RA_System_IPSubnets IPS ON SYS.ResourceID = IPS.ResourceID
LEFT OUTER JOIN dbo.v_RA_System_IPAddresses IPA ON SYS.ResourceID = IPA.ResourceID
LEFT OUTER JOIN dbo.v_RA_System_SMSAssignedSites SMSAS ON SYS.ResourceID = SMSAS.ResourceID
LEFT OUTER JOIN dbo.v_RA_System_SystemOUName SOU ON SYS.ResourceID = SOU.ResourceID
WHERE (SMSAS.SMS_Assigned_Sites0 IS NULL)
AND (NOT (IPA.IP_Addresses0 IS NULL))
AND (NOT (IPS.IP_Subnets0 IS NULL))
AND SYS.Operating_System_Name_and0 LIKE 'microsoft%server%'
ORDER BY IPS.IP_Subnets0, SYS.Name0I gotcha now... I think most people, myself included, rely on finding clients that are not assigned to determine if a boundary is missing. If you expect clients to not be assigned that's not going to work for you.
WHERE (SMSAS.SMS_Assigned_Sites0
IS NULL)
AND (NOT (IPA.IP_Addresses0
IS NULL))
AND (NOT
(IPS.IP_Subnets0 IS
NULL))
= This is saying show me all clients not assigned but they do have an IP address and they do have a subnet discovered.
In the case of CM12 it is actually possible for that not to work anyway because you can have separate boundaries for client assignment and content lookup.
I am not aware of any query that can compare the IP address, AD Site and IP subnet from each client to what's configured in boundaries and find machines that do not fall into any boundary.
John Marcum | http://myitforum.com/myitforumwp/author/johnmarcum/ -
CRVS2010 beta - Date field from database does not display in report
Hi there - can someone please help?!
I am getting a problem where a date field from the database does not display in the report viewer (It displays on my dev machine, but not on the client machines...details given below)
I upgraded to VS 2010
I am using the CRVS2010 Beta
My development machine is Windows 7 - and so is my fellow developer's
We are using Microsoft SQL Server 2000
We run the queries within VS and then we send the data table to VS using .SetDataSource
We have a few reports which display the date on our dev machines (whether we run the EXE or from within Visual Studio)
When we roll out to the client machines (running Windows XP SP3) then everything works, except that the date does not display (on quite a few reports)
This is the only real issue I have had - a show stopper for me
The rest works well - any input will be greatly appreciated
Regards,
RidwanHi Ridwan,
After much testing I have it all working now using CRDB_adoplus.dll as a data source ( XML )
Alter your Config file to look like this:
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0"/>
</startup>
Then using the code below, and CR requires the Schema to be able to read the date format.
private void SetToXML_Click(object sender, EventArgs e)
CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
ISCDReportClientDocument rcd;
rcd = rptClientDoc;
string connString = "Provider=SQLOLEDB;Data Source=dwcb12003;Database=xtreme;User ID=sb;Password=password";
string sqlString = "Select * From Orders";
OleDbConnection oleConn = new OleDbConnection(connString);
OleDbDataAdapter oleAdapter = new OleDbDataAdapter(sqlString, oleConn);
//OleDbDataAdapter oleAdapter2 = new OleDbDataAdapter(sqlString2, oleConn);
DataTable dt1 = new DataTable("Orders");
oleAdapter.Fill(dt1);
System.Data.DataSet ds = new System.Data.DataSet();
// We need the schema to get the data formats
ds.WriteXml("c:
sc.xml", XmlWriteMode.WriteSchema);
//Create a new Database Table to replace the reports current table.
CrystalDecisions.ReportAppServer.DataDefModel.Table boTable = new CrystalDecisions.ReportAppServer.DataDefModel.Table();
//boMainPropertyBag: These hold the attributes of the tables ConnectionInfo object
PropertyBag boMainPropertyBag = new PropertyBag();
//boInnerPropertyBag: These hold the attributes for the QE_LogonProperties
//In the main property bag (boMainPropertyBag)
PropertyBag boInnerPropertyBag = new PropertyBag();
//Set the attributes for the boInnerPropertyBag
boInnerPropertyBag.Add("File Path ", @"C:\sc.xml");
boInnerPropertyBag.Add("Internal Connection ID", "{680eee31-a16e-4f48-8efa-8765193dccdd}");
//Set the attributes for the boMainPropertyBag
boMainPropertyBag.Add("Database DLL", "crdb_adoplus.dll");
boMainPropertyBag.Add("QE_DatabaseName", "");
boMainPropertyBag.Add("QE_DatabaseType", "");
//Add the QE_LogonProperties we set in the boInnerPropertyBag Object
boMainPropertyBag.Add("QE_LogonProperties", boInnerPropertyBag);
boMainPropertyBag.Add("QE_ServerDescription", "NewDataSet");
boMainPropertyBag.Add("QE_SQLDB", "False");
boMainPropertyBag.Add("SSO Enabled", "False");
//Create a new ConnectionInfo object
CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo boConnectionInfo =
new CrystalDecisions.ReportAppServer.DataDefModel.ConnectionInfo();
//Pass the database properties to a connection info object
boConnectionInfo.Attributes = boMainPropertyBag;
//Set the connection kind
boConnectionInfo.Kind = CrConnectionInfoKindEnum.crConnectionInfoKindCRQE;
//*EDIT* Set the User Name and Password if required.
boConnectionInfo.UserName = "";
boConnectionInfo.Password = "";
//Pass the connection information to the table
boTable.ConnectionInfo = boConnectionInfo;
//Get the Database Tables Collection for your report
CrystalDecisions.ReportAppServer.DataDefModel.Tables boTables;
boTables = rptClientDoc.DatabaseController.Database.Tables;
//For each table in the report:
// - Set the Table Name properties.
// - Set the table location in the report to use the new modified table
boTable.Name = "Orders";
boTable.QualifiedName = "Orders";
boTable.Alias = "Orders";
rptClientDoc.DatabaseController.SetTableLocation(boTables[0], boTable);
//Verify the database after adding substituting the new table.
//To ensure that the table updates properly when adding Command tables or Stored Procedures.
rptClientDoc.VerifyDatabase();
MessageBox.Show("Data Source Set", "RAS", MessageBoxButtons.OK, MessageBoxIcon.Information);
Thanks again
Don -
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 -
Hi,
I need a help in writing an SQL query . I am actually confused how to write a query. Below is the scenario.
CREATE TABLE demand_tmp
( item_id NUMBER,
org_id NUMBER,
order_line_id NUMBER,
quantity NUMBER,
order_type NUMBER
CREATE TABLE order_tmp
( item_id NUMBER,
org_id NUMBER,
order_line_id NUMBER,
open_flag VARCHAR2(10)
INSERT INTO demand_tmp
SELECT 12438,82,821,100,30 FROM dual;
INSERT INTO demand_tmp
SELECT 12438,82,849,350,30 FROM dual;
INSERT INTO demand_tmp
SELECT 12438,82,NULL,150,29 FROM dual;
INSERT INTO demand_tmp
SELECT 12438,82,0,50,-1 FROM dual;
INSERT INTO order_tmp
SELECT 12438,82,821,'Y' FROM dual;
INSERT INTO order_tmp
SELECT 12438,82,849,'N' FROM dual;
Demand_tmp:
Item_id org_id order_line_id quantity order_type
12438 82 821 100 30
12438 82 849 350 30
12438 82 NULL 150 29
12438 82 0 50 -1
Order_tmp :
Item_id org_id order_line_id open_flag
12438 82 821 Y
12438 82 849 N I need to fetch the records from demand_tmp table whose order_line_id is present in order_tmp and having open_flag as 'Y' or if order_type in demand_tmp table is 29.
The below query will give the records whose order line id is present in order_tmp. But, If i need records which are having order_type=29 the below query wont return any records as order_line_id is NULL. If I place outer join I will get other records also (In this example order_type -1 records) . Please help me how can we write a query for this. Expected o/p is below.
Query :
Select item_id,org_id,order_line_id,quantity,order_type,open_flag
from demand_tmp dt , order_tmp ot
where dt.order_line_id = ot.order_line_id
AND dt.item_id=ot.item_id
AND dt.org_id = ot.org_id
AND ot.open_flag = 'Y';
Expected Output :
item_id org_id order_line_id quantity order_type open_flag
12438 82 821 100 30 Y
12438 82 NULL 150 29 NULL Thanks in advance,
Rakesh
Edited by: Venkat Rakesh on Oct 7, 2012 6:32 PM
Edited by: Venkat Rakesh on Oct 7, 2012 8:39 PMHi Rakesh,
the query is not working as you would like ( but IS working as expected ) since your trying to compare null to another value.
Comparing null always results in FALSE, also if you compare null to null. This is because null means undefined.
select 1 from dual where null=null results in no data found.
I would suggest using a non natural key to join the tables.
For example include a column ID in the master table which is filled with a sequence and include that field as a foreign key in the detail table.
This way you can easily join master and detail on ID = ID, and you don't have to worry about null values in this column since it's always filled with data.
Regards,
Bas
btw, using the INNER JOIN and OUTER JOIN syntax in your SQL makes it better readable, since you're separating join conditions from the where clause, just a tip ;) -
Creating reports in BI EE from PL/SQL query
Please provide me solution of how to create reports in Oracle BI EE tool while using PL/SQL query block.
Thanks
Rajni SharmaNarender Singh wrote:
Dear All,
We are using Oracle APPS, we have two tier structure.I bet it is actually 3-tier & WebServer exists
1) Application Tier
2) Database Tier
My requirement is to run a PL/SQL script to create directory structure in Unix box of Database Tier. I would be very grateful to person proving the input related to the same.
I want to create directory structure to store different type of files.
/usr/tmp/2000/jan/file1
/usr/tmp/2000/jan/file2
/usr/tmp/2000/jan/file3
/usr/tmp/2000/jan/file4
similarly, I have to create directory structure from year 2000- 2011 and for each year I have to 12 folder for months and then for each month I can have n number of file folders.
We are using 11g database.
Thanks in Advance!!
Regards,
Narender
Edited by: Narender Singh on Aug 9, 2011 10:50 AMDBMS_SCHEDULER that invokes OS shell script -
Failed to parse SQL query by one user
Hi all,
in my app i have a text-item with a submit button. In this item i type a name and a report after the item-region show me the result(s). this works for all my users (>2000) perfectly, but one of this users become an error in the report-region:
failed to parse SQL query:
ORA-01403: no data found
We try this with the same searchstring on the same computer/browser. If i logged in the result is ok, if the user logged in, the error message shows. If i try this on the computer from the user with me logged in, result ok. If the user try this on an other pc, results error.
I have an productive and a developer workspace. In the developer workspace the user can try this perfectly without errors. Only in the productive workspace the error shows.
The SQL-Select in the reprirt ist verry simple:
select id
, name
, raum
from table
where instr(upper(name), upper(:P60_SEARCH))>0
However all users can use this search-field with report perfectly, only this one user has the error. It is no restrictions on this item or report.
Can anybody help me?Carsten,
user preferences do not have anything to do with the fact where the user resides (apex built in, LDAP, whatever). User Preferences are saved for a named user and they are loaded next time the same user loggs in. For example, if you sort your report on a column x, apex will save this as a setting and next time you call the same report, this report will be sorted the same way. Since you don't have a permission to edit services, you should check your adminstrative permissions and conntact the real administrator of the workspace to do that "purge prefference" for you. I could bet this is the reason you are getting that strange error message.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
------------------------------------------------------------------------------ -
Hello there,
Can someone please help me:
I have this SQL query that is taking days to complete, and they say when it runs on the former DB version 8 it used to run for 1 hour but now we're using 10g ... it's taking days ... any help with that please?
TexasTexas B wrote:
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 119 | 3171 (2)| 00:00:39 |
| 1 | NESTED LOOPS | | 1 | 119 | 3171 (2)| 00:00:39 |
| 2 | MERGE JOIN CARTESIAN | | 1 | 71 | 3097 (2)| 00:00:38 |
|* 3 | TABLE ACCESS BY INDEX ROWID| PS_JRNL_LN | 1 | 41 | 388 (0)| 00:00:05 |
|* 4 | INDEX SKIP SCAN | PS_JRNL_LN | 6 | | 388 (0)| 00:00:05 |
| 5 | BUFFER SORT | | 116K| 3416K| 2709 (2)| 00:00:33 |
| 6 | TABLE ACCESS FULL | PS_BI_HDR | 116K| 3416K| 2709 (2)| 00:00:33 |
|* 7 | TABLE ACCESS BY INDEX ROWID | PS_BI_ACCT_ENTRY | 1 | 48 | 73 (0)| 00:00:01 |
|* 8 | INDEX RANGE SCAN | PS_BI_ACCT_ENTRY | 1 | | 73 (0)| 00:00:01 |
A few comments:
1. Please re-edit your post and add the "Predicate Information" section below the plan, so that the filter and access predicates can be seen. They're quite helpful to understand the execution plan better.
2. You're using bind variables, therefore the EXPLAIN PLAN output is only of limited use, since EXPLAIN PLAN doesn't perform "bind variable peeking". With "bind variable peeking" the optimizer peeks at the actual values passed when determining the execution plan. If you have a histogram generated on PS_JRNL_LN.JOURNAL_ID (check DBA/ALL/USER_TAB_COLUMNS.HISTOGRAM) or the values used are "out-of-range" (less or greater than recorded min and max value of column) then you might get different execution plans depending on the actual values passed.
3. You can get the actual execution plan(s) from the shared pool by obtaining the SQL_ID of the statement (e.g. check V$SESSION) and use the DBMS_XPLAN.DISPLAY_CURSOR function for this SQL_ID
4. The optimizer estimates that out of the 11 million rows of PS_JRNL_LN more or less no rows corresponds to this predicate:
A.JOURNAL_ID = :1
AND A.JRNL_LINE_STATUS = '1'
Since for the unknown bind variable a hard coded default selectivity of 5% is used which corresponds to a cardinality approx. 550,000 rows, the JRNL_LINE_STATUS = '1' predicate seems to be quite selective.
Is this estimate in the right ballpark or way off?
Due to this estimate the optimizer uses a cartesian join which could generate a very large intermediate set if the estimate is way off, e.g. if 1,000 rows are returned instead of 0 the cartesian join will already generate 1,000 * 116,000 => 116,000,000 rows.
This row source will then be used as driving source of a nested loop which means that many times the index and table lookup to PS_BI_ACCT_ENTRY will be performed.
Regards,
Randolf
Oracle related stuff blog:
http://oracle-randolf.blogspot.com/
SQLTools++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676/
http://sourceforge.net/projects/sqlt-pp/
Maybe you are looking for
-
Display sub header from second group in each page without page break
Hi All,. I need to show the sub header in each page in pdf output using rtf. I have two grouping region and category. I have used start:body and end:body concept to repeat the header in each page. The region is repeating in each page but I also want
-
I have to open the next window by right clicking on some link from previous site, who gives, '''''from drop down menu''''', option to [Open link in new tab] and then I can use that "fresh" tab. It is my desktop, if it's important to know for help. Pl
-
Error related to namespace mismatch in BPEL
Hi All We are facing an error related to NameSpace of a variable in BPEL process. We are sending a SOAP XML request to a third-party web service and fetching the XML response in a variable. There is a mismatch in the namespace of the variables. The x
-
Digital Booklet "Damaged or corrupted" in Adobe Reader X?
I purchased La Roux (Gold Edition) this morning. All of the files downloaded fine, but I cannot open my digital booklet. Am I the only one having this issue? can it be fixed?
-
Modeling: Is Fact Table partitioning that important?
I read of how much partitioning a fact table can speed a query. On an upcoming project with specifications for only 4 InfoCubes, how can we take advantage in partitioning to fact tables to speed up queries? Can this be factored into the design now o