Direct Database Request - Incorrect Column Data type

Hello All -
hope you can help with this. I'm using the Direct Database Request in Oracle BI to send a complex query directly to our data warehouse. My problem is that the result columns containing my measures are converted to integer by Oracle BI when they should be double. The integer conversion causes decimal values to be rounded, reading to incorrect results in my reports. I've tried several tweeks to my query in an attempt to allow OBIEE to make the correct guess on the data type but nothing has worked.
Is there a way to force OBIEE to recognize the correct data type for a column in a Direct Database Request Query?
Thanks in advance for you help!
Mac

Thank you both.
David's response was helpful from a style/readability perspective (the columns in question were complex expressions) but I had already attempted the approach and it hadn't solved the formatting issue. Nico's response solved the problem.
Regards,
Mac

Similar Messages

  • Table Functions, Direct Database Requests, and NUMBER data types

    Hello. I call a number of table functions from our BI Enterprise server, and I've elected to do so using Direct Database Requests (I believe you can also call table functions in the physical layer of the repository, but that's not what I'm doing). The problem is that whenever I return any number from the table function that is not a whole number (1.23, for example), BI assigns the INTEGER datatype to the field instead of the DOUBLE datatype, thereby rounding my number to the nearest integer. Here's a concise example:
    Create these 3 database objects:
    CREATE OR REPLACE TYPE my_row AS OBJECT (my_num NUMBER);
    CREATE OR REPLACE TYPE my_tab AS TABLE OF my_row;
    CREATE OR REPLACE FUNCTION my_table_function RETURN my_tab
    PIPELINED IS
    BEGIN
    PIPE ROW(my_row(1.23));
    END;
    Then make this your query in your Direct Database Request:
    SELECT my_num FROM table(my_table_function);
    That query correctly returns "1.23" when it's called from the database. In BI, on the other hand, it returns "1" (and labels the field an INTEGER instead of DOUBLE data type). If in the Direct Database Request you change the Column Properties ->Data Format -> Decimal Places from 0 to 2, it then not surprisingly displays "1.00". I then tried changing MY_ROW.MY_NUM's datatype by explicitly specifying precision, and no luck. BI still labels this field as an INTEGER. Then I started trying to trick BI by massaging the SQL statement itself. None of the following worked:
    SELECT to_number(my_num) as my_num2 FROM table(my_table_function);
    SELECT my_num2 + 0.01 as my_num3 FROM (SELECT my_num - 0.01 AS my_num2 FROM table(my_table_function));
    SELECT to_number(to_char(my_num)) as my_num2 FROM table(my_table_function);
    SELECT to_number(substr(to_char('x'||my_num),2)) as my_num2 FROM table(my_table_function);
    Now I did find a solution, but I'm surprised that I have to resort to this:
    SELECT * FROM (SELECT /*+ NO_MERGE */ my_num FROM table(my_table_function));
    Does anyone out there know of a better way to do this? The above is a hack in my opinion. :)
    Thanks in advance for any input.
    -Jim

    Yes, it's really amazing.
    But I got it.
    CREATE OR REPLACE TYPE my_row AS OBJECT (my_num NUMBER(10,2));and in your SQL :
    SELECT cast(my_num as double precision) as my_num2 FROM table(my_table_function);I have the good result and I see the numbers after the comma.
    Very tricky !
    Edited by: gerardnico on Jul 7, 2009 2:55 PM change number(10,2) by double precision ......... pfffff

  • Date format in Direct database request

    I have a report with direct database request.
    I have a date prompt..I am storing the date in a Presentation Variable named pv_date.
    In the direct database request, I have a where clause:
    WHERE business_date IN ( @{pv_date}{'1/1/2013'} )
    when I run open dashboard for the first time, its throwing me an error near TIMESTAMP.
    WHERE business_date IN( TIMESTAMP ''2013-01-01 00:00:00'')
    AND ALSO When I run this report from dashboard after choosing a date say 2/20/2013, I see the query as:
    WHERE business_date IN (2013-02-20 00:00:00)
    and hence throwing error.
    Its throwing error in both the cases. How do I change the format in WHERE clause..
    Ideally, I want the query to be WHERE business_date IN ('2/20/2013') or Business_date IN ('2013-02-20')

    Thank you both.
    I am using Sybase and hence used convert function.
    But still I see the word TIMESTAMP in the query which is causing issue.
    business_date IN(CONVERT(char(10), TIMESTAMP ''2013-03-27 00:00:00'',101))
    and when I run the report by choosing any date, I see this: business_date IN(CONVERT(char(10),2013-03-27 00:00:00,101)) ; throwing error because No single quoted for the date.
    How do I remove the word TIMESTAMP?? and how do I impose single quotes..

  • Cannot sort on a column in direct database request analysis

    We are having an issue on sorting on a field. The analysis was created using a direct database request.  Once the results are displayed in Table/Pivot table, users would like to sort on a particular column, but this is not working currently. Any idea as to how to fix this?
    Thanks,
    Ravi

    There is definitely an easier way in later JDeveloper releases, but using the <jbo:* > tag library the way involves either using the orderbyclause property of the <jbo:DataSource> tag, or programmatically invoking a method in your ViewObject or ApplicationModule's public service interface that internally accomplishing the same thing which is to invoke the setOrderByClause() API on the view object in question.

  • Conditional Formatting of a Direct Database Request Columns in OBIEE 11g

    Hi All,
    I need to do the conditional formatting like changing the
    column color based of some condition, but i can do to the conditional
    formatting in the normal answers in the column properties. But i want to do
    it in the rows of Direct Database Request.
    When i check the Column properties conditinal format is disabled.
    Regards
    Shanker

    Hi Shanker,
    It is a limitation, You cannot use conditional formatting in Direct Database Request
    Regards,
    Dpka

  • Direct database request and session variable value

    Hi,
    I have a problem by doing the following : idea is to have report with a list of all tables in user schema (which are not all in repository physical layer).
    By clicking on the name of any, should bring answer report which is done as direct database request doing basically select * from table_clicked (this will be basically the same table with sufix _err holding error rows).
    What I'm trying to do is having some kind report for error rows which can be in different tables in my database. So i had in mind to construct name of table i need , and pass it to database request through session variable. Am i doing right by doing direct database request like this :
    select * from 'VALUEOF(NQ_SESSION.TestVar2)'
    Is there another easyer way of doing this? I know this can be done by gourl by passing parameters but not sure how when i can't filter columns in direct database request (this can be different tables with different names of columns). I hope i didn't complicated this too much.
    Thnx in adwance

    Hi,
    I know this is a hack, and would be much more easy to create one table with dimension and measures, but this is intended to be used with code generator, which can produce different error tables with different column names in different time: It is not conviniet for somebody to add them to repository every 5 minutes. For example : i run my workflow and for first run I have errors in table1(let us say customer table with 30 columns) and if click on the table name in some answer report, i want to see all the bad records in the table. Tomorrow after the run, there are bad records in table1 and in table2 (lets say products) so I would have choice to pick table 1 or table2 and see al the bad records in any of these tables. This means that I can not now which tables will I have tomorrow, and as it is generic, I can manually add some tables in my model, and would have to add err table also as a possibility to have error rows?
    I saw post saying that you can pass parameter value by using go url functionality, by modifying configinstance file, but didn't suceed - http://gerardnico.com/wiki/dat/obiee/logical_sql/obiee_session_variable_go_url . Maybe some mistake or any better solution? I created session variable TestVar2, also modified instanceconfig.xml by adding this before </ServerInstance>
    <ParamList>
    <Param name="NQ_SESSION.TestVar2" source="url" nameInSource="SETVAR"/>
    </ParamList>
    and used go url in column formula : ''||"Physical Targets"."Physical Table"||''
    Can I use @1 for using first column value?
    Thnx

  • Applying Prompt on Direct Database Request in OBIEE 11g

    Hi
    I am creating Analysis by using 'Direct Database Request' and i am executing SQL Query to direct Database i am NOT creating Business and Presentation Model in RPD. Now i have to apply Filters on Report. any idea how i can do that?
    Example:
    Prompt (filter) :   Year                 Employee Department
                              2011                    HR
                              2012                    IT
                              2013                    Finanical
    Employee Name |    Employee Age   | Gender  | Leave Status     |    Leave Type
    abc                            31                      male       on leave              Sick leave
    xyz                             39                    Female    on leave               Annual leave
    i want to filter by YEAR and Employee Department.
    Regards
    Baig

    NO!!!!!!!!!!
    You Direst SQL query should contain the url
    ex:
    SELECT COL1,COL2,
    '<a href=http://obiapps:9704/analytics/saw.dll?Go&Path=/Answers&path=%2Fshared%2FAppslink%20Dashboards%2F_portal%2FAppslink%20Dashboards%2FEmployee%20Department=Navigate&P0='+BUSINESS_GROUP_NAME+' target=_new>'+BUSINESS_GROUP_NAME+'</a>
    FROM TABLE
    then go for the column format
    Note: in MS SQL + is for concat, you might have to change based on your db.

  • Use of Filter in Direct Database Request for Custom Navigation

    Because of union and other complex sql code I am using Direct Database Request. (DDR) In 1st request based on DDR containing column Region, I need to do Region column value navigation to the Target report. The Target report is also based on DDR and has column Region.
    For 1st Report Region Column Value Navigation to work
    1. I did activate value interaction in 1st Report for Region column and set Target to Report 2.
    2. In 2nd Report, I have to use Filter and make region column "Is Prompted". But in DDR the filter is not available. How do I solve this problem?

    by using Direct database request your bypassing all the wanderful metadata you built in the BMM layer, as such much functionality is not available.
    If you really need to use such complex SQL, I would suggest creating an inline view in the phyiscal layer and at least model this through your BMM either as a flat data source (ie include the dimension columns and model the same inline view into your BMM star)
    If you do that, the BI Server will know what other logical columns this data source can relate you and you should find the navigation works as expected.
    If you dont fancy that good practice, have a look at creating GOURL formulas as the column fx's, format as HTML to present the data as a hyperlink and manually pass all the parameters to the 2nd report.
    I'd do the first option, its more inline with intended use.
    What cant you do using the 'normal modelling / answers techniqes with union (see combined request in answers) and complex sql (evaluate function in RPD)??

  • Direct Database Request

    Hi All,
    I am trying to set up a Dashboard Prompt using the SQL results of a Direct Database Request. I am using Oracle 11g.
    So far I have created the connection and created the analysis using the Direct Database Request. I am using Presentation Variable to pass into the Where Statement to filter however, I need a Dashboard prompt that will display the results of a particular column (country) in the Choice list options for filtering. I have tried to go into Dashboard Prompts and create a presentation variable and then use a SQL statement to render results for the prompt choices but that does not seem to work. Does anyone have an suggetions on how to Populate a Dashboard Prompt using Direct Database Request?
    SQL CODE FOR DASHBOARD PROMPT
    SELECT COUNTRY_CODE FROM POA_ADDRESS_DIM

    Thats Srini,
    I already have that presentation variable in my analysis in the where clause to limit the data request. The issue I am trying to resolve is similar to creating a filter based on another analysis.
    I created an analysis using DDR the DDR results is what I want to incorporate into a dashboard prompt. So the best logical way to put it is Take the results from a DDR and place it into a Dashboard Prompt as user choices. An added bonus if I could make the presentation variable pick up multiple selections from the Dashboard prompt. I know we could change the operator to IN however the formating of the choices would have to be something like this ('@{PV_COUNTRY}') <--- minus the paranthesis.

  • Direct Database Request & prompts

    Is it possible to use Prompts in a Request base on a "Direct Database Request". How do I access the prompt variables in my SQL query?

    user643210 wrote:
    Hi,
    I am unable to get the data based on the prompt applied this way. Can u please tell how to get the data using prompt on dashboard?It has been outlined for you above.
    Define a presentation variable using your dashboard prompt,
    In your SQL in the direct request, filter your column using the value in the variable using :
    where column1= '@{somevar1}'
    where @{somevar1} is the name of your presentation variable.
    To Debug why your are not getting results, have a look at the what value got substituted into the Physical SQL being sent to the the underlying database using the session manager.

  • Direct Database Request with Dashboard Prompt LOV Source

    I have complex Direct Database Request query having Dashboard Prompt. In Dashboard prompt I want to have LOV. But to create the DPrompt having LOV, I must have the table/column in Subject Area. How I can have table in RPD not connected or joined with any table in RPD?
    The idea is to do the reporting based on direct query with Prompt/LOV but do not want to include the prompt source table with other my main logical model which is used for other purpose.

    Hi Kishore
    Thanks for the reply but it is little less clear because I already have working Dashboard level prompt where
    1. Instead of LOV I type the value, use the Presentation Variable as Set Variable on Dashboard Prompt, say pDepartment
    2. Created direct database rqeuest query having where condition .. WHERE Department= '@{pDepartment}'
    And the above Dashboard works great. Only problem is that I want to have LOV for Department for which I need to have the respective table/column in RPD
    I liked your idea about BI publisher but how do you really deploy the BI Publisher?
    Thanks
    OBIEEFAN

  • Reg-Direct database request Prompt

    Hi
    I have a direct database request I kept this report on dashboard with request date as a prompt
    the filter on the report is
    TRUNC(FCR.request_date) = TO_DATE('@{Date1}{07/23/2012}','mm/dd/YYYY').(Data is coming fine)
    but
    I wanted to show the data for the current_date on the dashboard "default"
    When I try to do
    TRUNC(FCR.request_date) = TO_DATE('@{Date1}{Sysdate}','mm/dd/YYYY') Its throwing an error.
    I am not sure whether we have to use Sysdate or Current_date.Please let me know how to achieve this.
    Thanks
    Edited by: user13545914 on Jul 23, 2012 2:27 PM

    Prompt should like this:
    1) Column->Date [IF you do any formula here, you have to do every place, in this case I'm not doing any formula]
    2) Operator-> is equals to is in
    3) Control-> Calendar
    4)Default to ->SQL Results
    use query like
    SELECT Time.Date FROM "Service - CRM Service Requests" where Time.Date=current_date
    This would show default value select as todays date
    5) Set Variable -> PS
    Call the PS variable in the report without any default value. this should work fine, once you get confidence and this approach start doing what ever you want.
    if you want you can try same scenario with couple of columns.
    Just relax and read all threads and do it.

  • OBIEE Answers Direct Database Request

    The issue is that I want to link two reports created using Direct Database Request. i.e. when I click on a column of Report A I should be directed to Report B with the filter passed from Report A. The issue that we are facing is that we can access the presentation variables in Report A, but are unable to pass them to Report B.
    Any Idea ?
    Regards,

    we can access the presentation variables in Report A, but are unable to pass them to Report B.
    If you are not using the prompts, How can you refer a Presentation Variable?
    GOURL can be implemented to Direct Database Requests...
    Go to Column Properties ==> Data Format ==>Check Override Default Data Format and Choose Custom .. Format
    Here specify the Go URL..
    For GO URL concepts, go through the link given by Christian..

  • Error in Oracle BI EE Analytics when running a direct database request

    This is in the Oracle Answers portion of the Analytics tool. When a query is entered into the Direct Database Query text box and the "Validate SQL and Retrieve Columns" button is clicked, the columns are indeed returned (which would seem to indicate that the connection pool settings are correct etc.), but when I click on the results tab it throws an error:
    View Display Error
    Error generating view. You don't currently have the necessary privileges to execute Direct Database Requests.
    Error Details
    Error Codes: OAMP2OPY:Q4NU7XSN
    Invalid Handle Of 'class saw::NQWebView *' Exception
    I am at a loss trying to figure this error out - clearly it is connected to the DB since it can see column names, and I was able to use the Administration tool to create a repository which Analytics can use, so why can't I directly query my database? Any help would be greatly appreciated.

    It sounds like the setting has not been set to allow you to execute a direct database query.
    You can do this by logging into the Presentation services as the Administrator user. Clicking on the Settings tab and then selecting the Administration option. On the Oracle BI Presentation Services Administration window select the Manage Privileges option. This brings up the Privileges Administration window, scroll down to the Answers section (listed on the left) and check the Execute Direct Database Requests privilege setting this is defaulted to let no one execute Direct SQL request. Reset the privileges such that the group that the user trying to execute the direct database request belongs to is set to be able to execute the direct database requests. This should alleviate the error that you are getting.
    I hope that this helps.
    Tim

  • How to find the Column data type changes in table

    Hi All,
    I need to find out the column data type changes where made recently in table .
    How do i check past changes in column data type. Any data dictionary are there to find out the data type changes in the column .
    Thanks in advance..

    <FONT FACE="Arial" size=2 color="2D0000">
    You have the answer on hand (user_arguments / all_arguments)!
    SQL> desc user_arguments
    Name                                      Null?    Typ
    OBJECT_NAME      VARCHAR2(30)
    PACKAGE_NAME     VARCHAR2(30)
    OBJECT_ID     NOT NULL NUMBER
    OVERLOAD       VARCHAR2(40)
    ARGUMENT_NAME  VARCHAR2(30)
    POSITION       NOT NULL NUMBER
    SEQUENCE       NOT NULL NUMBER
    DATA_LEVEL     NOT NULL NUMBER
    DATA_TYPE      VARCHAR2(30) --> Data Type
    DEFAULT_VALUE  LONG
    DEFAULT_LENGTH NUMBER
    IN_OUT         VARCHAR2(9) -->Argument direction (IN,OUT,or IN/OUT)
    DATA_LENGTH    NUMBER
    DATA_PRECISION NUMBER
    DATA_SCALE     NUMBER
    RADIX          NUMBER
    CHARACTER_SET_NAME VARCHAR2(44)
    TYPE_OWNER         VARCHAR2(30)
    TYPE_NAME          VARCHAR2(30)
    TYPE_SUBNAME       VARCHAR2(30)
    TYPE_LINK          VARCHAR2(128)
    PLS_TYPE           VARCHAR2(30)
    CHAR_LENGTH        NUMBER
    CHAR_USED          VARCHAR2(1)
    Look for Data_Type where IN_OUT say OUT. That will be the data type retruned by that function.
    Edited :
    or POSITION in argument list,or null for function return value
    -SK
    </FONT>

Maybe you are looking for

  • Logic Studio install - Sound Effects option disabled

    When I go to install Logic Studio, in the list of things to install the selections "Sound Effects" and "Music Beds" are greyed out and uncheckable. If I install everything I can select, it skips the discs Audio Content 1 and 2. Is there a way to get

  • Re-installing Photoshop gets error 213:5

    My HD crashed last week. Replaced it yesterday. Re-downloaded Photoshop CS5 twice last night and twice this morning (2x each for 2 different links) and each time I get error message 213:5 -- I'm in HOUR SIX of trying to get back the software I paid f

  • Brand new imac won't start HELP!!

    Just got an iMac, fresh out of the box I hit the power button, everything looks normal, OS X does its normal checks, then the desktop comes up with multicolour stripes - the desktop is cluttered with all kinds of files - a darwin console opens up the

  • Scrollbar Corruption

    I came across an odd situation in LV 2009 SP1. I was trying to set my background color to the system "Panel & Object" color after setting some other VI properties to make this VI look like a system dialog box.  Somewhere along the line while using th

  • How do I set VS4VS2010 Options?

    In Crystal Reports XI it is possible to set the Editor options to "Crystal Syntax" or "Basic Syntax" I can't find a place to set it. Everutime I open a Crystal Report Editor I have to change the Syntax dropdown. Sometimes I forget and when I check a