Query Builder - Data types & functions

Hi,
I have a couple of questions relating to the Query Builder
a) Why can I not select columns of datatype FLOAT? Are there any others?
b) Is it possible to add functions to the list of functions in Query Builder.
I am trying to read thru the User Guide but do not always have time. Are there sections of it that would be considered more pertinent??
Thanks
Steve

Hi,
I have a couple of questions relating to the Query
ry Builder
a) Why can I not select columns of datatype
atatype FLOAT? Are there any others?Use Number, and specify scale or the places after the decimal point
>
b) Is it possible to add functions to the
to the list of functions in Query Builder.Can't help on this topic.
>
I am trying to read thru the User Guide but do not
ot always have time. Are there sections of it that
would be considered more pertinent??
Thanks
Steve

Similar Messages

  • Query Parameter Data Type error betwee IE6 and IE7

    Hello all.
    This is a strange one. Using MII v12. When setting parameters for a SQL query from Javascript, the query executes properly on IE7 but generates errors on IE6. The errors are JDBC errors having to do with "Conversion failed when converting datetime from character string." and "Error converting data type varchar to numeric." I don't get any browser errors, only Java errors and NetWeaver log entries.
    What is the source of this data typing error?

    Hi, Sparks.
    Actually, IE was always an anomaly when it came to proper typing of objects in Javascript, so it let you get away with things that really shouldn't work.
    In general, you should use the Number Javascript type for number properties (e.g. setRowCount(), setXAxisMinRange(), etc) and strings for just about everything else.  If I recall, Javascript will handle most of the type conversions to a String property, but not necessarily to a Number property.
    You can use the parseInt() and parseFloat() methods to convert from strings to numbers in Javascript.
    In general, it's a good practice to be "type aware" in your Javascript code anyway, and this will ensure that it runs in other browsers and future browsers.
    Rick

  • Querying the data type of objects in an Array?

    I'm able to determine that an argument is an Array using the following query:
    SELECT DATA_TYPE
    FROM all_arguments
    WHERE OBJECT_NAME = 'MY_PROCEDURE' AND ARGUMENT_NAME = 'MY_ARRAY_PARAM'
    DATA_TYPE will be 'PL/SQL TABLE' if the argument/parameter is an array.
    My question is: Is there a way to query what the type of the objects in the array should be? Like NVARCHAR2, VARCHAR2, RAW, DECIMAL, etc.
    Any help is very appreciated!

    I guess the part I'm having trouble with is when the
    Array is defined in a package because the type
    doesn't get listed in "all_coll_types". well, the workaround here would be - the parsing of PACKAGE text - and finding your needed type of array:
    SQL> create or replace package TEST_PACK as
      2          TYPE test_type is table of varchar2(100);
      3   end test_pack;
      4  /
    Package created
    SQL>
    SQL> create or replace package body TEST_PACK as
      2    vc_array test_type;
      3    begin
      4     null;
      5    end;
      6  /
    Package body created
    SQL>
    SQL> select * from user_source t
      2   where name = 'TEST_PACK'
      3  /
    NAME                           TYPE               LINE TEXT
    TEST_PACK                      PACKAGE               1 package TEST_PACK as
    TEST_PACK                      PACKAGE               2         TYPE test_type is table of varchar2(100);
    TEST_PACK                      PACKAGE               3  end test_pack;
    TEST_PACK                      PACKAGE BODY          1 package body TEST_PACK as
    TEST_PACK                      PACKAGE BODY          2   vc_array test_type;
    TEST_PACK                      PACKAGE BODY          3   begin
    TEST_PACK                      PACKAGE BODY          4    null;
    TEST_PACK                      PACKAGE BODY          5   end;
    8 rows selected
    SQL>

  • Querying the data type of a table/view

    Is there a sql statement that will 'return' the data type of a specified table/view?
    For instance column x of table y has data type int, is there a statement such as:
    SELECT data_type FROM y WHERE column_name = 'x'
    I know the above won't work but it gives the gist of what I am looking for.

    SQL> select table_name, column_name, data_type, data_length, data_precision, data_scale
      2  from user_tab_columns
      3  where table_name = 'EMP';
    TABLE_NA COLUMN_N DATA_TYP DATA_LENGTH DATA_PRECISION DATA_SCALE
    EMP      EMPNO    NUMBER            22              4          0
    EMP      ENAME    VARCHAR2          10
    EMP      JOB      VARCHAR2           9
    EMP      MGR      NUMBER            22              4          0
    EMP      HIREDATE DATE               7
    EMP      SAL      NUMBER            22              7          2
    EMP      COMM     NUMBER            22              7          2
    EMP      DEPTNO   NUMBER            22              2          0
    8 rows selected.
    SQL> desc emp
    Name                                      Null?    Type
    EMPNO                                     NOT NULL NUMBER(4)
    ENAME                                              VARCHAR2(10)
    JOB                                                VARCHAR2(9)
    MGR                                                NUMBER(4)
    HIREDATE                                           DATE
    SAL                                                NUMBER(7,2)
    COMM                                               NUMBER(7,2)
    DEPTNO                                             NUMBER(2)
    SQL>Message was edited by:
    Jens Petersen

  • How to query geography data type?

    Hello
    In my db i create table having geography type column and insert location detail (lat & lon) using point method. How can i do query for getting that location in my console application?
    and also i try this got an error?

    It looks like you chose one line (the one beginning with "set") and ran it, stand-alone, in an SSMS query window. You need to run all 3 lines of code (i.e don't select any particular line, and hit the Run button). Or select all 3 lines and hit
    the Run button.
    What the error message says is that you are trying to use the variable @g without defining it. This could only mean that you're running only line 2 (the highlighted line).
    The lifetime of a SQL variable (@g) is one-batch long, a variable goes out of scope at the end of the batch. So running each line as a separate batch won't work with SSMS. You need to run them all at once.
    Cheers, Bob

  • Data Type enhancement Query.

    Hi All ,
    I have a query regarding Data type enhancement . We can create a Data Type enhancement based on a standrd Data Type and give a new name to this DataTypeEnhancement (DTE_Test). This is clear . My question is how do we actually use this newly created DataTypeEnhancement .
    In my case I do not want to change the Orignal Standard Objects.  I want to create Objects in a separate Custom SWCV . Can we create a new DataType / MessageType based on this DataTypeEnhancement and Use it. 
    Thanks
    Nilesh.

    Nilesh,
    Check this document 3.3 and its usage:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c0bb5687-00b2-2a10-ed8f-c9af69942e5d?overridelayout=true
    Regards,
    ---Satish

  • Equals(=) vs. LIKE for date data type

    First, I'm aware that the equals (=) operator is a "comparison operator compares two values for equality."  In other words, in an SQL statement, it won't return true unless both sides of the equation are equal.  For example:
    SELECT * FROM Store WHERE Quantity = 200;
    The LIKE operator "implements a pattern match comparison" that attempts to match "a string value against a pattern string containing wild-card characters."  For example:
    SELECT * FROM Employees WHERE Name LIKE 'Chris%';
    Here,
    I query about date type data on ORACLE database, I found the following, when I write select statment in this way:
    SELECT ACCOUNT.ACCOUNT_ID, ACCOUNT.LAST_TRANSACTION_DATE FROM ACCOUNT WHERE ACCOUNT.LAST_TRANSACTION_DATE LIKE '30-JUL-07';
    I get all rows I'm looking for. but when I use the sign equal = instead :
    SELECT ACCOUNT.ACCOUNT_ID, ACCOUNT.LAST_TRANSACTION_DATE FROM ACCOUNT WHERE ACCOUNT.LAST_TRANSACTION_DATE = '30-JUL-07';
    I get nothing even though nothing is different except the equal sign. Can I find any explanation for this please ?

    You are relying on implicit datatype conversions between DATE and VARCHAR2.  This is not only bad practice but it's unreliable as it depends on NLS_DATE_FORMAT parameter settings.
    My NLS_DATE_FORMAT parameter is different from yours, so if I do the same sort of test...
    SQL> select * from emp;
         EMPNO ENAME      JOB              MGR HIREDATE                    SAL       COMM     DEPTNO
          7369 SMITH      CLERK           7902 17-DEC-1980 00:00:00        800                    20
          7499 ALLEN      SALESMAN        7698 20-FEB-1981 00:00:00       1600        300         30
          7521 WARD       SALESMAN        7698 22-FEB-1981 00:00:00       1250        500         30
          7566 JONES      MANAGER         7839 02-APR-1981 00:00:00       2975                    20
          7654 MARTIN     SALESMAN        7698 28-SEP-1981 00:00:00       1250       1400         30
          7698 BLAKE      MANAGER         7839 01-MAY-1981 00:00:00       2850                    30
          7782 CLARK      MANAGER         7839 09-JUN-1981 00:00:00       2450                    10
          7788 SCOTT      ANALYST         7566 19-APR-1987 00:00:00       3000                    20
          7839 KING       PRESIDENT            17-NOV-1981 00:00:00       5000                    10
          7844 TURNER     SALESMAN        7698 08-SEP-1981 00:00:00       1500          0         30
          7876 ADAMS      CLERK           7788 23-MAY-1987 00:00:00       1100                    20
          7900 JAMES      CLERK           7698 03-DEC-1981 00:00:00        950                    30
          7902 FORD       ANALYST         7566 03-DEC-1981 00:00:00       3000                    20
          7934 MILLER     CLERK           7782 23-JAN-1982 00:00:00       1300                    10
    14 rows selected.
    SQL> select * from emp where hiredate like '19-APR-87';
    no rows selected
    SQL> select * from emp where hiredate = '19-APR-87';
    no rows selected
    The LIKE operator is intended to be used for strings... DON'T attempt to use them on dates, and remember when you specify dates that you need to use TO_DATE (or the DATE internal format) to convert your string to DATE datatype
    e.g.
    SQL> select * from emp where hiredate = date '1987-04-19';
         EMPNO ENAME      JOB              MGR HIREDATE                    SAL       COMM     DEPTNO
          7788 SCOTT      ANALYST         7566 19-APR-1987 00:00:00       3000                    20

  • How to Convert Data types here

    Hi All,
    My stored proc is as below,
    create or replace procedure proc_sec_synch (
    Begin
    FOR sec_Update in (
    Select
    SsM_ID ,
    CYCLE_DATE ,
    TARGET_TABLE ,
    COLUMN_NAME ,
    NEW_DATA  ,
    COLUMN_TYPE from PM_OWN.test_synch order by target_table
    Loop
    *'Update' || sec_Update.target_table ||' dest SET dest.' ||sec_Update.column_name||' =*
    *(select src.new_data from pm_own.test_synch src where src.ssm_id = '||sec_Update.target_table||'.ssm_id)'*
    END Loop;
    END proc_sec_synch;
    actually I'm updating different tables using one table. the one table consists all the data like target table name and column name and the values also.
    in the above query, the data type of value what I'm retreiving from pm_own.test_synch is different from target table column datatype.
    so how could I change the type of retreiving value to the destination table column data type.
    help me.

    Here is the answer...
    Actuallly I have two databases which I need to synch 2nd database using first database, synch in the not entore database but only few tables and only few columns and that too on specific where condotions. so I made so many queries and retreiving data into temp tables and then updating into target tables,
    instead of above what I'm trying is I have created a stagiing table where I'll update the data (by using all above seelect queries) and update the target tables in one shot withoput using temp tables.
    Bottom line is:
    I need to get the report for the data that is getting updated daily before updating.
    and before updating I should have previllage to decide whether to update or not..?
    Cheers,
    Naresh

  • Function in report query builder

    Hi,
    It is possible to call a function in the select statement of a report query builder as followed :
    select my_func()
    from my_table
    The function is defined as :
    create or replace my_func() return vachar2 is
    v_temp vachar2(100);
    begin
    v_temp := 'column_1, column_2, column_3';
    return(v_temp);
    end;
    Therefore, the query should be interpreted as:
    select column_1, column_2, column_3
    from my_table
    and the fields "column_1", "column_2" and "column_3" with the same alias name would be created for the report.
    Thank you,
    DS

    Ok. Here is the way!
    Create user parameter p_query. Datatype Character. Width 10000. Set initial value as
    select RPAD('n',10) c1, RPAD('n',10) c2, RPAD('n',10) c3 from dual
    ** Suppose type of column 1, 2 and 3 is character and maximum length can be 10. So using this in above select statement.
    Get value in After Parameter Form trigger
    begin
    :p_query := yourfuntion;
    return(true);
    end;
    data model will have only this:
    &p_query
    Now you will see three columns in data model
    c1
    c2
    c3
    NOW error ORA-24333 can appear, when function/procedure doesn't return back anything for data model, I mean lexical parameter p_query is empty.
    ** You can replace whole select statement with lexical parameter.

  • Dates in BEx query coming into designer as a dimension with Char data type

    This must be an old issue with a well documented work around ...   but alas i can find it !
    When i build a universe over a BEx query with dates the universe designer builds them as Dimensions of CHAR type not DATE.  Therefore all WebI date functionality fails ..  eg sorting, automatic time hierarchies etc.
    What is the workaround ?
    Andrew Fox

    Is the data source an InfoSet or an InfoCube?  It appears the date type object has not been implemented yet for Infosets.  Here's SAP Note 1370410:
    Symptom
    Infoset date type objects (DATS type) are mapped as Character types in a universe based on a SAP BEX Query.
    Prompts related to the Date field variables are coming as List of values instead of Calendar in WebIntelligence.
    Reproducing the Issue
    Create a BusinessOjects universe on a Super Query which is based on a multiprovider containing an Infoset or
    Create a BEx superquery directly on Infoset.
    BusinessObjects Enterprise XI 3.1
    SAP Integrated Solutions Kit XI 3.1
    Cause
    This behaviour has been considered as an enhancement request and tracked under ADAPT01229917.
    Resolution
    This enhancement request is scheduled to be addressed in Service Pack 3 (SP3) for BusinessObjects Enterprise XI 3.1 due approximately April 2010.
    I did try a BEx query that uses an InfoCUBE as a source and the objects are coming into the universe correctly as dates.

  • Problem to get ResultSet when it is used a Date type in the query condition

    hello ,
    I having a bit of nightmare getting a ResultSet how result of one simple Query for a table when the condition WHERE involve a Date type.
    To change the String value in a date to use in the query condition, I tried both:
    String strDate = "dd/mm/yyyy";
    (1.) java.sql.Date sqlDate = new java.sql.Date(strDate.getTime() )
    (2.) SimpleDateFormat formatter = new SimpleDateFormat(strDate) ; sqlDate = formatter.parse(strDate);
    and finally I use this code to get the ResultSet:
    sql = "SELECT * FROM myTable Where (idCli = " + cd_Cli + " And dateReg = " + sqlDate + ")";
    statement = connection.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_READ_ONLY);
    resultSet = statement.executeQuery(sql);
    boolean ok = resultSet.last();
    totNumberOfRegistration = resultSet.getRow();
    But In both the cases I get a empty resultSet.
    I shoul like if someone would look my code to say me where it is the mistake...
    thank you
    tonyMrsangelo
    P.S. I tryed using PrepareStatement too to get the ResultSet, but in that case I couldn't use the ResultSet because executing the statement resultSet.last() I get the error: "Result set type is TYPE_FORWARD_ONLY"

    In a database like Oracle, you need to use a function like TO_DATE; other databases may have something similar.
    However, the proper way to do this is to use a PreparedStatement. Then you can say
    PreparedStatement ps = conn.prepareStatement("update SOMETABLE set SOME_DATE=? where SOME_ID=?");
    ps.setDate(1, new java.sql.Date(someJavaUtilDate.getTime()));
    ps.setInt(2, theId);
    ps.executeUpdate();

  • Query Builder won't apply chosen date to the where clause

    Does anybody know why when I chose a date field, in the where clause, when using Query Builder, it won't actually write the chosen date to the actual query?
    If I select the "View Query" tab, no date shows up. Also if I press the "Run Report" button in the "View Result" tab, I get this error:
    "An error was encountered performing requested operation: ORA-00936: missing expression"
    This is because actual date data is missing.
    After I hit the "Apply" button, I have to manually type the date data.
    I thought this was a bug of the previous version, but I just installed version 1.5.4 and I have no different result.
    Thanks.

    I just wanted to add my name to the list of people having this issue.
    Oracle Techies, please help.

  • Query Builder - Where Clause - Could not format error using date comparison

    We've come across a bug in the Query Builder, under the Create Where Clause tab, if you select a column of Date type plus one of the comparison operators =, !=, <, >, <=, >=, BETWEEN or NOT BETWEEN it displays an error in the Logging Page:
    Level: Severe
    Source: o.d.r.queryBuilder.SQLGenerator
    Message: Could not format :2010-09-02 16:20:31.0
    Then under the Show SQL tab it doesn't display the date(s) you selected, e.g.
    WHERE LAST_UPDATE BETWEEN AND
    Also the View Results tab does not display any results.
    You can still press Apply to add the SQL as is to the editor window and from there you have to manually code in the date parameters.
    We're using the latest version of SQL Developer 2.1.1.64.45 Windows 32bit version with JDK

    Hi Gordon,
    When I add the following lines:
    declare @refdt1 date
    set @refdt =
    /*select 1 from jdt1 t0 where t0.RefDate*/ '[%1]'
    declare @refdt2 date
    set @refdt =
    /*select 1 from jdt2 t0 where t0.RefDate*/ '[%2]'
    WHERE T0.RefDate >= @refdt1 and T0.RefDate <= @refdt2
    ... the error message is now:
    Must declare the scalar variable @refdt1
    Note: Before adding these lines, the query works perfectly, and returns totals from the whole database (with dynamically generated column headings!)
    Thanks
    Leon Lai
    AMENDED QUERY:
    declare @refdt1 date
    set @refdt1 =
    /*select 1 from jdt1 t0 where t0.RefDate*/ '[%1]'
    declare @refdt2 date
    set @refdt2 =
    /*select 1 from jdt1 t0 where t0.RefDate*/ '[%2]'
    --------- I inserted the 6 lines above ---------------------
    DECLARE @listCol VARCHAR(2000)
    DECLARE @query VARCHAR(4000)
    SELECT @listCol =
    STUFF
    ( SELECT DISTINCT   '],['    +    CAST(month(T0.RefDate) AS varchar)
    FROM  JDT1 T0
    FOR XML PATH('')
    ), 1, 2, ' ') +   ']'
    SET @query =
    'SELECT * FROM
    (SELECT Account, month (T0.RefDate) Month , Debit
    FROM JDT1 T0
    ------------------- I add the WHERE clause below --------------------
    WHERE T0.RefDate >= @refdt1 and T0.RefDate <= @refdt2
    GROUP BY Account, RefDate, Debit
    ) S
    PIVOT
    Sum(Debit)
    FOR Month IN ('+@listCol+')
    ) AS pvt'
    EXECUTE (@query)
    Edited by: LEONLAI on Oct 21, 2011 2:36 PM

  • Building a table with a string data type

    I am using the Build Table function and I would like to be able to label my columns on the first iteration with a string data type, which doesn't seem to be an acceptable signal for the Build Table function. However, the express table is located under "text indicators" on the front panel, so it seems like there should be a way to do this..

    Ah, the "Build Table" Express VI. I hate Express VIs.
    That Express VI is nothing more than a really complicated way of creating a 2D array of strings. The Express VI has no inputs for the row and column headers, so you need to add them in yourself. The same would be true for a regular table control/indicator. Here's what you need to do:
    Right-click on the table indicator and select Visible Items -> Column Headers.
    Right-click on the table indicator and select Create -> Property Node -> Column Header Strings[]. LabVIEW will attach a property node to the cursor and switch to the block diagram. Plop down the property node on the block diagram.
    Right-click on the property node on the block diagram and select "Change All to Write".
    Right-click on the property node and select "Create -> Constant". This will give you an array of strings, and you can enter the column headers in each array element.
    Wire the array to the property node.
    Connect the property node to the Build Table Express VI using the error clusters.
    Message Edited by smercurio_fc on 07-02-2008 09:25 AM
    Attachments:
    Example_VI_BD6.png ‏3 KB

  • 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

Maybe you are looking for

  • HP Officejet 5600 drivers for Mavericks

    Hi, I just got a new macbook pro and installed Mavericks. Well, among a couple of problems there is one important thin: No recognition of my HP Officet 5600 series printer. Even though is the support section of the apple.com it says it has the driver

  • IPod won't turn on, cannot be reset

    I got my iPod Touch 2g for Christmas and have been using it without problem (no dropping it, smashing it, etc.) I had it synced to my laptop for a week but then wanted to sync it to my desktop today. I plugged it in and my desktop recognized it, iTun

  • PDF Printer will not print in Acrobat 7.0 Professsional

    After installing my Adobe Creative Suite 2 on my Windows Vista Home Premium System, all of my Adobe Programs worked fine. Recently I am unable to Print to PDF or create a PDF from Microsoft Office Document. I have applied all the suggested solutions

  • Snow Leopard, FCP, AFX & Gamma

    Hi all. First of all I'd like to say that I've already googled about this for hours and that I wouldn't post a question on the subject if wasn't on a tight deadline and had already pulled out whatever hair I had left. We are finishing a project using

  • Invoice ALE Distribution

    Hi everyone, I' trying to figure out if there is a way to create an Invoice IDoc every time an invoice is created or updated and then send it to an outbound LS. Please post anything that might be useful. Kind regards, Julian