Weird SQL/View Problem

I have the following query which runs quick...
select a.col1
,b.col2
,b.col3
from table1 a
,table2 b
where a.key = b.key
and a.col1 = 77902
order by a.col3;
Now if I create a view based on the above minus the order by and one of the conditions i.e..
create or replace view v_test as
select a.col1
,b.col2
,b.col3
from table1 a
,table2 b
where a.key = b.key;
and now do the following query:
select col1
,col2
,col3
from v_test
where col1 = 77902
order by col3;
The above query takes ages! I cannot understand why it should behave any different to my original query. All I have done is pushed the joins into a view and queried the view with the same condition and order by.
However, if I do a the following it is quick:
select *
from v_test
where col1 = 77902
order by col3;
Any suggestions will be appreciated.
Thanks

What is the database version?
Are the tables analyzed - CBO vs RBO?
What is the tkprof output for each of the three runs?

Similar Messages

  • Problem to run the Crystal report inside from SAP B1 based on SQL views.

    Hello,
    I have a problem to run my Crystal report inside from SAP B1 which is based on SQL views.And the SQL views are stored in a separate database in SQL server.The error which i am getting is saying the the tablename does not exist.What i need to do in order to sort this problem.
    Great if somebody can help me to sort out this so that i can run my report based on SQL views stored on separate database other than SAP databases inside from SAP B1.
    Edited by: rozenagrawal on Apr 19, 2011 11:51 AM

    Try using a SQL synonym in your company database for the views outside the company database. I don't know if SBO will let you get away with it, but its worth a shot.
    If your company database is MyCompany and you have a view called MyView in Views database, assuming the view belongs to schema dbo, and you want the synonym to belong to dbo schema in your company database, run this:
    Use MyCompany
    go
    create synonym dbo.OutsiderView for
    Views.dbo.MyView
    go
    select * from OutsiderView
    The select statement should return the contents of MyView in the Views database while you are connected to your MyCompany database.
    For more info, see the Books Online for MSSQL on topic synonym.
    You will need to change your CR options to include displaying synonyms along with tables, views, etc. You may also need to grant select to B1 users.
    Edited by: Cindy Lange on Apr 21, 2011 4:00 PM

  • Not Converted : Free-hand SQL connection problem

    While converting a Free Hand SQL report from Desktop Intelligence to Web Intelligence report in BI XI 3.1, I am faced with the problem
    Not Converted : <REPNAME> - Free-hand SQL connection problem
    It is be noted that there are some other Free Hand SQL Reports, that go converted and published without any error. The subject report has two Data Providers; one referring to the Universe and other from the Free Hand SQL tagged to a DB Connection

    Ajay,
    Some more points that can be of consideration to you to help understand my problems.
    The conversion from DeskI to WebI is in the same version BI XI 3.1 and not to BI 4.0 in which Free Hand SQLs is not supported.
    I have converted one other Free Hand SQL Report with an error "Partially Converted : <REPNAME2> - Conditional or permanent Hide Header not available in Web Intelligence", for which I had to edit the report in InfoView and un-tick the "Show When Empty" property of the table ( http://www.forumtopics.com/busobj/viewtopic.php?t=197157&view=next&sid=e6840aafa2d1267c66dae164d1dbf9db ). I think the solution mentioned in this link does not meet the purpose as the table is not displayed in the design time after the above untick.
    Coming back to our issue, further probing into this aspect I stumbled upon this link meant for RCT for BI 4.0 version
    https://csdwportal.dhhs.state.nc.us/downloads/Business%20Objects%20XI%20R4.0%20Docs/SAP%20BusinessObjects%20Report%20Con…
    where in Section 3.4.9, there is a mention of the limitation in conversion as under
    "Conversion of reports with free-hand SQL or stored procedures is only possible in Connected mode, since the Report Conversion Tool needs to use the secured connection to the database that is saved in the CMS."
    I want to how the secured connection to the database in REPNAME2 is different from the subject report REPNAME1 as REPNAME2 got partially converted. The error reported for Subject report is "Free Hand SQL Connection Problem" and not conversion problem which can occur after the connection is established.
    I did check the security properties of various FHSQL connections in the CMC and all of them are identical in nature.
    Please advise

  • SQL "View" with TS?

    Hello,
    is it possible to handel a SQL "View" with TestStand or the Database Viewer?
    I can see my tables but not the view.
    greetings
    schwede

    Thankyou,
    this is the first thing, the second is that i can`t write to the database.
    If i use a table everything is ok. When i took the view i get an error-message:
    -2146825037 The recordset don`t support updating. This can be a problem of the constriction of provider or lock type....
    Can you help me with this, too?
    greetings
    schwede

  • SQL Views for applications, deployment types and deployments

    Has anyone seen any diagrams yet of the relationship between the views in the database for applications?  They are needless to say quite a bit more complex than the old Packages/Programs/Advertisements views.  I can probably figure out what I need,
    but it would save quite a time to be able to see the relationships called out.  A description of what some of the views actually do would be helpful too, I can figure out some, but others are a bit obtuse.
    Unfortunately there isn't an out of the box report that shows the information my customer wants, so I have to create one from scratch.
    If anyone is currious they want to see the status for all the computers that are targetted with an application deployment, this would include error codes, status, ect...
    Bob

    Yes, I know this is an old post, but I’m trying to clean them up. Did you solve this problem, if so what was the solution?
    The SQL view document has been release, it should help you out.
    https://technet.microsoft.com/en-us/library/dn581978.aspx
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • SQL View Generator plug-in does not create LIMITMAP

    I was wondering if anyone has encountered an issue where they create a SQL View using the AWM plug-in over an OLAP dimension but then receieve the error "ORA-34492 Analytic Workspace object <AW>.LIMITMAP does not exist" when they try to query the dimension. I created several SQL Views over other dimensions and they work just fine.
    Thanks,
    Scott

    Hi Scott,
    There may be a couple of reasons for this and I have seen this error myself. Firstly I think you are using 10gOLAP, correct? You should be using 10.2.0.3 patchset, then you need to apply the addition OLAP A database patch. These two patches can be downloaded from Metalink.
    Next you need to download the updated version of AWM, 10.2.0.3.A from the OLAP home page on OTN. Then from the same page download and install the updated SQLView generator and make sure all the SQL scripts are installed correctly with no errors.
    Once all that is done, the next step is to look at the cube you are trying to view. There is a limit (not sure of the exact details in terms of size) on the size of the LIMITMAP command that can be generated. Typically, if you have very long column names and very long AW name this can cause problems. In the first screen (I think) of the view generator there is the option to change the column names, which gives you the option to reduce the size of the names assigned to each column.
    To try and debug this I would try creating a very simple view, based on one single measure from your cube and only select the dimension attribute "long description". Before you test the view, use the OLAP Worksheet within AWM to check if the LIMITMAP object was created. The name of the limitmap object is name_of_your_cube_LIMITMAP. If this object has not been created then I suspect there is something wrong with the PL/SQL package creating the view and we will need to switch on some tracing to determine why this is not working.
    Hope this helps
    Keith Laker
    Oracle Data Warehouse Product Management
    OLAP Blog: http://oracleOLAP.blogspot.com/
    OLAP Wiki: http://wiki.oracle.com/page/Oracle+OLAP+Option
    DM Blog: http://oracledmt.blogspot.com/
    OWB Blog : http://blogs.oracle.com/warehousebuilder/
    OWB Wiki : http://wiki.oracle.com/page/Oracle+Warehouse+Builder
    DW on OTN : http://www.oracle.com/technology/products/bi/db/11g/index.html

  • Use evdre to query data from a SQL View

    Hi all
    I believe that it is possible to use evdre to query data from a SQL View. If this is possible then how does one go about setting it up in the evdre options (assuming that the view has already been created)?
    Regards,
    Byron

    Byron,  perhaps this is no longer supported, it might be worth opening up a case at service.sap.com on this.  However, I did find the following on Page 11 of the "Usages and Considerations of EVDRE" pdf file.  This doc is imbedded in the helpfile for BPC 7 SP5 (which was released in August of 2009, well after note 1315011 was last updated.
    It looks like you are limited to one custom view per application, since you have to name the view in a parameter at the APPLICATION level.  Go into BPC Administration, login to the application related to the custom view, choose "Set Application Parameters" and enter the name of the view to the Application Parameter called "EVDRE_QUERYVIEWNAME"  If it is not listed, go ahead and create it at the bottom of the Application parameter screen.
    Also:  I interpreted the following info from Page 10 of the same doc:
    In your EVDRE, set the following options:
    QueryEngine: MANUAL
    QueryType:  enter either NEXJ  OR TUPLE  see below:
    NEXJ  - Use two-dimensional queries using the nonemptycrossjoin function
    TUPLE  - Use two-dimensional queries using tuples"
    And I'm assuming you'd enter a Y for the following two parameters:
    QueryViewName
    "..to enforce the query engine to use a used-defined SQL view of the fact tables, when trying to read the values using SQL queries. This option is typically used in conjunction with the SQLOnly option (see below). "
    Option SQLOnly
    "..to enforce the query engine to only execute SQL queries, when reading data. This can be achieved using this option."

  • Remote Control and Remote View Problem

    Hi,
    I work at a High School running Netware 6.0 SP5 and Zen works 4.01 ir7.
    Remote Control and Remote View works great but I noticed one problem.
    We have a logo of the school that is forced down on to the desktop when a
    user logs in through group policies. This logo works perfect for the
    desktop wall paper and loads every time a user logs in.
    When I Remote Control or Remote View a computer the users desktop wall
    paper turns from the logo being forced down through group policies to the
    desktop to a blue desktop wall paper.
    I would prefer the desktop wall paper staying the schools logo when I
    Remote Control or Remote View because if the desktop wall paper changes to
    the blue color I mentioned above when I Remote Control or Remote View the
    users computer, they will know that someone is taking over their computer
    which sometimes we dont want them knowing.
    We have Windows 98SE computer running Novell Client 3.4 and we have some
    computers running Windows XP Professional SP1 and Windows XP Professional
    SP2 both running Novell Client 4.91 SP2.
    The Remote Control and Remote View problem of the desktop wall paper
    changing on the users computer occurs on all operating systems mentioned
    above.
    Is there a solution to my above problem? When Remote Controlling and
    Remote Viewing someone's computer I don't want the desktop wall paper to
    change.
    Thanks!

    Bpilon,
    It appears that in the past few days you have not received a response to your
    posting. That concerns us, and has triggered this automated reply.
    Has your problem been resolved? If not, you might try one of the following options:
    - Do a search of our knowledgebase at http://support.novell.com/search/kb_index.jsp
    - Check all of the other support tools and options available at
    http://support.novell.com.
    - You could also try posting your message again. Make sure it is posted in the
    correct newsgroup. (http://support.novell.com/forums)
    Be sure to read the forum FAQ about what to expect in the way of responses:
    http://support.novell.com/forums/faq_general.html
    If this is a reply to a duplicate posting, please ignore and accept our apologies
    and rest assured we will issue a stern reprimand to our posting bot.
    Good luck!
    Your Novell Product Support Forums Team
    http://support.novell.com/forums/

  • Report Based on SQL view not pulling in all parameters

    Post Author: ronhawker
    CA Forum: .NET
    I based a report on a SQL view below:SELECT     TOP (100) PERCENT CorpDirectory.Position, CorpDirectory.PhoneDirect, CorpDirectory.Email, CorpDirectory.Store, CorpDirectory.Name,                       CorpDirectory.PhoneFaxWave, CorpDirectory.Department, Store.StoreName, Store.StoreStreetAddress, Store.StoreCity, Store.StoreState,                       Store.StoreZip, Store.StorePhone, CorpDirectory.DisplayOrderFROM         dbo.CorpDirectory AS CorpDirectory INNER JOIN                      dbo.Store AS Store ON CorpDirectory.Store = Store.StoreORDER BY CorpDirectory.Store, CorpDirectory.Department, CorpDirectory.DisplayOrder, CorpDirectory.Name When the report was created the order by sequence only brought in the first parameter of CorpDirectory.Store. It seemed to ignore the other three order by parameters. I am running 10.2 is VS2005.

    Sharmila,
    Thanks for your response. Maybe I wasn't clear enough in my previous statement. I will give an example of what I am trying to accomplish.
    Let's say I have 2 date fields(SUBMITDATE,COMPLETEDATE) in a table TABLE A
    I want to calculate a field called CYCLETIME with the following conditions:
    If COMPLTEDATE is NULL, then CYCLETIME = SYSDATE-SUBMITDATE
    IF COMPLTEEDATE is not null, then CYCLETIME = COMPLTEEDATE-SUBMITDATE
    Would appreciate any help.
    Thanks
    Dev
    Hi,
    You can do the calculation in the sql query itself. Here is an example which shows the sum of salaray for each department in the scott.emp table.
    select deptno,sum(sal) sal
    from scott.emp
    group by deptno
    Thanks,
    Sharmila

  • Coalesce in a SQL View?

    I have a table as shown below:
    I need to write a sql view that will show 1 row for the ReqNbr and then a column for the related service calls.  For example the result set should look something like this:
    ReqNbr, Call_Numbers
    10010, 0000013147;0000013097;0000013149;
    10592, 0000012994;0000012999;
    and so on.  I need a view that can do this as a function or stored procedure can't be used in the reporting tool that I'm dealing with.  In addition I would like the Service Call to be sorted ASC in the column when returned.
    Any ideas?

    You need to use a stuff operator for this purpose... see this
    http://sqlsaga.com/sql-server/how-to-concatenate-rows-into-one-row-using-stuff/
    DECLARE @Input TABLE
    ReqNbr INT,
    ServiceCall VARCHAR(20)
    INSERT INTO @Input VALUES(1, '0001'), (1, '0002'), (1, '0003'),(2,'0004'), (2,'0005'), (1, '0006')
    SELECT DISTINCT ReqNbr, STUFF((SELECT ';'+ServiceCall FROM @Input b WHERE a.ReqNbr = b.ReqNbr FOR XML PATH('')), 1, 1, '') AS ServiceCall
    FROM @Input a
    Please mark as answer, if this has helped you solve the issue.
    Good Luck :) .. visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.

  • Maintenance view problem "No data maintenance Authorization; Display only"

    Maintenance view problem
    <b>Question 1>>>></b>
    > I have created a table with Display/maintenance allowed and technical setting Data class - APPL0 (master data, transparent tables).
    >> Then I have created a maintenance view thought utilities->table maintenance generator where i have specified the Authorization group as &NC& (w/o auth. group)
    ->and also created a function group and specified in the maintenance screen-> I have selected maintenance type as one step-> i have given the overview screen number->and in Recording routine i have selected - no, or user ,recording routine.
    >>> Now when i go to transaction SM30  and put the table name and press on maintain button I get a information box saying "<b>No data maintenance Authorization; Display only"....</b> and it only displays the data.
    my problem is I want to enter data through maintenance view (SM30).
    <b>2nd Question >>>></b> once i create a function group for maintenance view how can i assign a transaction for this. <i>(as if i do it as we do for a module pool program it gives me error)</i>Thank you.
    kailash

    SE93.  Enter a transaction name.  Create.  In the pop up enter a title and select 'Transaction with parameters'.
    Next screen fill the following;
    Transaction 'SM30'
    Check 'Skip first screen'
    In the table control at the bottom of the screen
    Name of screen field 'VIEWNAME'
    Value <your table name>
    Name of screen field 'SHOW'
    Value 'X'
    Save.
    Job done.

  • Can a SQL view see data from an ODBC connection?

    Hi.  I currently have an application that pulls data from a custom SQL view in my SQL database.  This custom application can not be changed, so it expects to see the data exactly as presented by my custom SQL view.  This works fine
    when the data resides in SQL, but I am not sure if it is possible when the data resides outside of SQL.  I’d like to connect to another type of database via an ODBC connection from my SQL database, and still utilize my custom SQL view.  I would prefer to NOT
    use the SQL database as a warehouse, and simply use it to pass data.
    Is this possible?   Thank you for reading.

    Hi Robet,
    According to your description, you want to create view in SQL Server to pass data from OBDC database to custom application, right?
    In this case, we can create linked server to access an ODBC database when you are using an ODBC data source. Linked servers can use the OLE DB Provider for ODBC without using an ODBC data source. You can refer to the link below to see the details.
    http://technet.microsoft.com/en-us/library/ms191462(v=sql.105).aspx
    Regards,
    Charlie Liao
    TechNet Community Support

  • NEED HELP IN SQL HOMEWORK PROBLEMS

    I NEED HELP IN MY SQL HOMEWORK PROBLEMS....
    I CAN SEND IT VIA EMAIL ATTACHMENT IN MSWORD....

    Try this:
    SELECT SUBSTR( TN,
                   DECODE(LEVEL, 1, 1, INSTR(TN, '#', 1, LEVEL-1) + 1),
                   DECODE( INSTR(TN, '#', 1, LEVEL) , 0 ,
                           LENGTH(TN) + 1, INSTR(TN, '#', 1, LEVEL) )
                   - DECODE(LEVEL, 1, 1, INSTR(TN, '#', 1, LEVEL-1 ) + 1)
           ) xxx
    FROM (
        SELECT '234123#1254343#909823#908232#12345' TN FROM DUAL
    CONNECT BY LEVEL <= LENGTH(TN) - LENGTH(REPLACE(TN,'#')) + 1
    XXX                               
    234123                            
    1254343                           
    909823                            
    908232                            
    12345
    SELECT regexp_substr(tn, '[^#]+', 1, level) xx
    FROM (
        SELECT '234123#1254343#909823#908232#12345' TN FROM DUAL
    CONNECT BY LEVEL <= LENGTH(TN) - LENGTH(REPLACE(TN,'#')) + 1
    XX                                
    234123                            
    1254343                           
    909823                            
    908232                            
    12345 

  • Adobe Content Viewer problem. Please Help me...

    Hi after updating online. Folio, I tried to update the trial version of the publication on my iPad but I get this message: "the issue isavailable for dowload, but new signing for an application version. Update the application from the App Store. "I went to the AppStore and was not any update of the Content Viewer ... I deleted the version on my iPad I downloaded again ... but without success gives me the same problem ... Please help me ... how can I do??
    thanks

    Hello Bob and thank you for responding so quickly ... Would you be kind enough to send me the link where I can download older versions of Folio Builder and Folio Producers Panel tools for InDesign 5.5. I'm looking for them but I can not find them.
    Thank you for your patience.
    Il giorno 21/gen/2012, alle ore 16:18, Bob Levine ha scritto:
    Re: Adobe Content Viewer problem. Please Help me...
    created by Bob Levine in Digital Publishing Suite - View the full discussion
    As discussed in numerous threads already, the new viewer has not been approved by Apple yet.
    If you’re a pro or enterprise customer you can create your own viewer app. If not, you’ll have to wait or roll back to the older tools.
    Bob
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4155907#4155907
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4155907#4155907. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Digital Publishing Suite by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Declare @StartDate/@EndDate in SQL View; cannot save (for use w/ ODBC)

    I have searched all over to find out how, in proper syntax, to code a date range-specific query that works just fine in SAP, but cannot be saved in a SQL view (to in turn be linked to an Excel spreadsheet).  An answer that links me to the proper thread could be nice... if it truly explains how to begin and end a functioning basic query with a user supplied date range while working in Excel.
    The error I receive when starting my view with "declare" is "the Declare cursor SQL construct or statement is not supported."
    Here's the beginning and abbreviated end of code from a query that works just fine without the date clause in SQL view:
    DECLARE @StartDate DateTime
    DECLARE @EndDate DateTime
    SET              @StartDate = [%0]
    SET              @EndDate = [%1]
    SELECT     .........
    FROM        .........
    WHERE     (T0.DocDueDate >= @StartDate AND T0.DocDueDate <= @EndDate) AND ......
    Thank you in advance!
    Russell

    Hi Russell.
    You don't need to use Declare.
    Try this
    SELECT .........
    FROM .........
    WHERE (T0.DocDueDate >= '[[%0]]' AND T0.DocDueDate <= '[[%1]]') AND ......
    Antonio Ramos
    Edited by: Antonio Ramos on Feb 17, 2010 2:38 PM

Maybe you are looking for

  • The Report is Empty.

    Hi, Im using Crystal Reports 2008 on VS.NET 2005 and .NET 2.0 I set the dataset to the report programatically. The report viewer is empty. But the report has more than 2 pages. When I click next page on the Crystal Report Toolbar, the report data app

  • Question on Electronic bank statement

    HI, i am working on SWIFT MT 940 for uploading the EBS for customers. and want to use only SAP standard no customization (user exits) what are the details the bank statement should contain inorder to do posting to bank and clear the document of F110.

  • Bounce button becomes gray? Feature or bug?

    I discovered a tiny detail that I just can´t figure out: if I Ctrl - click and solo button in the Mixer, the Bnce button on the Output 1-2 channel strip becomes gray. I know that you can do exactly the above in order to disconnect the solo safe fader

  • Losing information of music during sync (Mac - XperiaS)

    Hi guys, I have this problem from 3 weeks now, when i try to sync music between my Mac and XperiaS, i lost some info of the songs (cover art, artist, title) and the title has in the name the number that has in the allbum (01 Yellow Flicker Beat). It'

  • Oracle BI EE (10.1.3.2): Maximum total number of cells in Pivot Table excee

    I'm trying to build a pivot table report from about source 1.3M rows. When I'm setting CubeMaxPopulatedCells to a small values (10'000 and less) I'm getting error: "Governor limit exceeded in cube generation (Maximum number of populated cells exceede