Database application - direct incorrect column data type
Hello all-hope you can help with this. I use the live database request in Oracle BI to send a complex query directly to our data warehouse. My problem is that the columns of results containing my measurements are converted by Oracle BI so they should be double. The conversion of integer causes decimals to round values, reading to incorrect results in my reports. I tried several tweeks to my request to allow OBIEE correct estimate 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 query request to the live database?
Thanks in advance for you help!
Mac
Click here for a solution using the cast function:
http://gerardnico.com/wiki/dat/OBIEE/direct_database_request_table_function#oracle_number_data_type_as_an_integer
See you soon
Nico
Tags: Business Intelligence
Similar Questions
-
Confusion of length of column data type
Hi all
To learn about my column data type and length, I have run the following query. However, when I confirm it with the table_name desc command, I see that the lengths of data do not correspond. You have an idea?
> > select column_name | » '|| DATA_TYPE | » ('|| ( data_length|') ' col_info all_tab_columns where table_name = 'CUSTTABLE' and column_name = 'ACCOUNTNUM;
> > ACCOUNTNUM NVARCHAR2 (24)
> > desc CUSTTABLE.
> > ACCOUNTNUM 1 N NVARCHAR2 (12)
Concerning
Charlie
NightWing wrote:
By the way I couln t understand what were you thinking when you explain to no.
I missed you NVARCHAR2 column and thought it was VARCHAR2. When you declare the semantics of VARCHAR2 column length is specified explicitly or implicitly. Explicitly suffixing length with BYTE or CHAR and implicitly when you specify the length of the right itself. Then length is based on the value NLS_LENGTH_SEMANTICS session. So let's assume you generate table create statement (and it seems that you is, based on column_name |) » '|| DATA_TYPE | » ('|| ( data_length|') ' ). Then it does not matter if use use data_length or char_col_decl_length. It will be regadless semantics implied length of what you use. Therefore, when you run create table instructions column length will be interpreted as bytes if current NLS_LENGTH_SEMANTICS byte value. But same length is interpreted as the characters if current NLS_LENGTH_SEMANTICS a char value. As you can see, in order to generate create table statement we use explicit semantic length column, otherwise create table statement can produce lengths of different column in the source table.
SY.
-
Column data type not supported
Hello
I have Oracle 12 c installed in my system. I created an SP that returns a Table when I try to run it in SQL Developer, it gives me the correct results, but when I call it my DOTNET application it gives me the error-'datatype of the column unsupported. I'm trying to fill a dataset using a data adapter. To check I commented all the code in the procedure and returned the table using the code below.
Declare rc sys_refcursor; Begin OPEN rc FOR SELECT 'Sayam' AS "Error" FROM dual; SYS.DBMS_SQL.RETURN_RESULT (rc, TRUE) ; END;
But the problem was still same. This is the track of the same thing.
Oracle.ManagedDataAccess.Client.OracleException took
HResult =-1450
Message = data type of column not supported
Source = Oracle Data Provider for .NET, pilot managed
ErrorCode =-1450
DataSource =""
Number =-1450
Procedure =""
StackTrace:
at Oracle.ManagedDataAccess.Client.OracleParameter.PreBind (OracleConnectionImpl connImpl, ColumnDescribeInfo cachedParamMetadata, Boolean, bMetadataModified, Int32 arrayBindCount, ColumnDescribeInfo, paramMetaData, object & paramValue, Boolean isEFSelectStatement)
at OracleInternal.ServiceObjects.OracleCommandImpl.InitializeParamInfo (ICollection paramColl, OracleConnectionImpl connectionImpl, ColumnDescribeInfo cachedParamMetadata [], Boolean & bMetadataModified, isEFSelectStatement Boolean, MarshalBindParameterValueHelper & marshalBindValuesHelper)
to OracleInternal.ServiceObjects.OracleCommandImpl.ProcessParameters (OracleParameterCollection paramColl, OracleConnectionImpl connectionImpl, ColumnDescribeInfo cachedParamMetadata [], Boolean, bBindMetadataModified, isEFSelectStatement Boolean, MarshalBindParameterValueHelper & marshalBindValuesHelper, Boolean & bAllInputBinds)
at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader (String commandText, OracleParameterCollection, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl paramColl & rdrImpl, longFetchSize of Int32, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, scnForExecution of Int64 [], Int64 [] scnFromExecution, OracleParameterCollection, internalInitialLOBFS, OracleException & exceptionForArrayBindDML, Boolean isDescribeOnly, Boolean isFromEF, Boolean bBindParamPresent, Int64 & bindByPositionParamColl)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader (Boolean requery, fillRequest Boolean, CommandBehavior behavior)
to Oracle.ManagedDataAccess.Client.OracleDataAdapter.Fill (DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, command IDbCommand, CommandBehavior behavior)
at System.Data.Common.DbDataAdapter.Fill (DataSet dataSet)
at DataAccessLayer.DataAccessService.OracleGetData_Load (String SPName, XElement QueryParam, Exception & e, Boolean bFlag) in d:\Sayam\April\Multiplay\DataAccessLayer\DataAccessLayer\DAS.cs:line 187
Please let me know if I need to change anywhere.
Thank you
Siradji
Hello
I did a search for two days and found the link below to set up the DLL
http://www.Oracle.com/technetwork/database/Windows/downloads/index-090165.html
It worked well when installing using CMD
Thank you.
-
XMLTable: definition of the columns data type of table
Hello world
I am using ORACLE 11 g and you want to shred XML into a table called test used. I was hoping I'd be able to get the types of data to the employees table existing instead of specify them in the clause of columns. Is this possible?
Here is an example of what I'm trying to do. But I get an error: PL/SQL: ORA-00907: lack the right parenthesis on the line starting with columns.
Error detailsinsert into EMPLOYEES select * from xmltable( '/employees/employee' passing EMP_XML columns FIRST_NAME EMPLOYEES.FIRST_NAME%TYPE path 'first_name', LAST_NAME EMPLOYEES.LAST_NAME%TYPE path 'last_name', GENDER EMPLOYEES.GENDER%TYPE path 'gender', AGE EMPLOYEES.AGE%TYPE path 'age' );
Thank you.columns FIRST_NAME EMPLOYEES.FIRST_NAME%TYPE path 'first_name', * ERROR at line 16: ORA-06550: line 16, column 42: PL/SQL: ORA-00907: missing right parenthesis ORA-06550: line 11, column 5: PL/SQL: SQL Statement ignored
Specification of column names is required, but you can omit the declaration of data types.
See: the function XMLTABLE SQL/XML in Oracle XML DB
XMLTable is used with storage XML based on a schema of XMLType data type is optional. If absent, the data type is inferred from the XML schema. If Oracle > XML DB is unable to determine the right type of a node, a default type VARCHAR2 (4000) is used.
It is an Oracle extension; in the SQL/XML standard, the data type is always required.
Note:
The alleged data type might change as a result of the application of a patch or upgrade of Oracle XML DB. In particular, a new set of release or patch might be able to > determine the data type when the previous version was unable to do so (and therefore not reimbursed to VARCHAR2 (4000)). To protect against such an eventuality, specify an explicit data type with the data type. -
Timestamp for date columns data type are not imported in discoverer admin
Hi all
Someone you will suggest why timestamp data type columns are not imported into admin. discoverer other types of data import you correctly, but the timestamp data type columns are missed.
Please let me know to change the type of data is not possible at this time.
Thank youHello
You will be disappointed because the timestamp columns are not one of the recognized data types supported by the discoverer. He acknowledges only dates, strings and (integer and decimal) numbers.Maybe you could put up a view that matches the table you use, convert the timestamp in a rather ordinary date?
Then, inside your end-user license, all you would have to do is redirect the folder to view.
Best wishes
Michael -
ODI 12 - problem with missing data in the store column data types
Hello world
We have recently installed Studio 12 on Oracle RDBMS ODI. We have created some topologies, contexts and the logical architecture. We have created the necessary templates and made reverse engineering. The strange thing is when a model data store opening, we have noticed, the data types of its attributes are not displayed and cannot be selected in the drop-down list because they do not exist yet. You can see the image below.
So the mappings are not correctly executed because on the stage of the creation of work tables CREATE script was not generated correctly. (It's something like "CREATE TABLE < name > ()")
Anyone can give an idea what could be the reason for this and how might be solved?
Any ideas would be appreciated.
Thank you in advance.
Hello
Please see the links below this should help you.
http://gerardnico.com/doc/ODI/Webhelp/en/refmanual/topology/snpdt.htm
http://gerardnico.com/doc/ODI/Webhelp/en/UserManual/topology/topology/topo_reverse_datatypes.htm
http://odiexperts.com/data-types-creating-what-is-missing-for-any-technology/
-
query on the column data type CLOB display part of instruction. Why?
Hi all
Why when I have queries on the CLOB column display only part of instruction.
as follows
drop table test_clob;
create table test_clob (number (9) id, article clob);
insert into test_clob values (1,' 1. Quality and perfection: the international quality
standards, including port of commitment and discipline,
and to discover the best of the features that cater to the
charity society has been able to get the most important
International certificates in achieving quality, administrative, industrial and food. ") ;
SQL > select * from test_clob;
ARTICLE ID
---------- ----------------------------------------
1-1. Quality and perfection: the boarding school
international quality
standards, including what
but in the request of me don't show that part of the statement
concerning
Waelset long 5000
-
How can I find what is the data type of a column of a Table in oracle or SQL?
(a) what happens if I want to know the type of data in a specific column in the Table.
(b) how to find the column data types?
Can someone help me please. I am new to oracle and try to learn a few tricks
Hello
How to do
SQL > desc
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)
-
Supported or not supported data Type Confusion
Hello
Before starting my goldengate installation and initial load, I ran full - DB_CheckOracle_12072011.sql to my database source according to the MOS ID 1379932.1.
Here are the following results (does not include everything):
---------
# Separate column data types and their number in the schema:
DATA type TOTAL
BLOB * 4 *.
CHAR * 381 *.
CLOB * 3 *.
DATE * 11832 *.
LONG * 18 *.
NCHAR * 1 *.
NUMBER * 30255 *.
NVARCHAR2 * 35 *.
GROSS * 12 *.
ROWID * 4 *.
TIMESTAMP (6) * 2 *.
UNDEFINED * 124 *.
VARCHAR2 * 48047 *.
# Tables with constraints of deferred payment. Deferred constraints can cause TRANDATA to choose an incorrect key SP2-0552: Bind "B0" undeclared variable.
# Tables set with the size of > 2M line in all schemas
# Tables with number primary key or a Unique Index and column length > 1 M
# Tables with CLOB, BLOB, LONG, NCLOB or LONG RAW columns in all schemas
OWNER TABLENAME DATA type
PR_COLLMAIN ALLOC_TEST LONG
PR_COLLMAIN BOD_TEST LONG
--------
Question:
LONG (1) is included in the list of goldengate data types supported, how is this report shows that the following tables (with long data_type) will do my TRANDATA to choose an incorrect key?
Thanks in advance!
Mela
Published by: 840534 on February 25, 2013 23:46
Published by: 840534 on February 25, 2013 23:46There is no link between "chose an incorrect key SP2-0552: Bind variable undeclared" B0"AND"LONG tables of data type"both are different results, there are two distinct sqls are executed in the database for"# Tables with constraints of payment deferred"AND"# Tables with CLOB, BLOB, LONG, NCLOB or LONG RAW columns in all schemas.
# - These symbols are used for each query result comment line.
This means,
# Tables with constraints of deferred payment. Deferred constraints can cause TRANDATA to choose an incorrect key SP2-0552: Bind "B0" undeclared variable.
no selected line
# Tables set with the size of > 2M line in all schemas
no selected line
# Tables with number primary key or a Unique Index and length 1 M column >
no selected line
# Tables with CLOB, BLOB, LONG, NCLOB or LONG RAW columns in all schemas
THE DATA OWNER TABLENAME TYPE
PR_COLLMAIN ALLOC_TEST LONG
PR_COLLMAIN BOD_TEST LONGIf you open this file and read 'full - DB_CheckOracle_12072011.sql' you can see the sqls separated for each control and output results.
Finally, there are no Tables with constraints carried forward in your database that will impact Trandata.
HTH
Annamalai.
-
Hi all
We can overload subprogrammes that setting differ in the number, order, and type of family data. But impossible to overload if the parameter differs only in the void type.
If I see the standard package, I get
subtype types BINARY_FLOAT is NUMBER;
subtype BINARY_DOUBLE is NUMBER;
But I am able to overload the two procedures, we have a parameter types binary_float and binary_double other. They are of subtype of the same data type. that is the number. So, how is it possible. Also, most of the subtypes have no difference. So, why are there these number of subtypes? Oracle defines subtypes as data type with some sort of constraint on the base data type, but is valid for all? for example, smallint, and decimal.
type of NUMBER is NUMBER_BASE;
subtype of FLOAT is NUMBER;
ACTUAL subtype is FLOAT;
subtype 'DOUBLE PRECISION' is FLOAT;
INTEGER subtype is NUMBER (38.0).
subtype INT is INTEGER;
subtype SMALLINT is NUMBER (38.0).
DECIMAL subtype is NUMBER (38.0).
DIGITAL subtype is DECIMAL;
DEC subtype is DECIMAL;>
We can overload subprogrammes that setting differ in the number, order, and type of family data. But impossible to overload if the parameter differs only in the void type.If I see the standard package, I get
subtype types BINARY_FLOAT is NUMBER;
subtype BINARY_DOUBLE is NUMBER;But I am able to overload the two procedures, we have a parameter types binary_float and binary_double other. They are of subtype of the same data type. that is the number. So, how is it possible. Also, most of the subtypes have no difference. So, why are there these number of subtypes? Oracle defines subtypes as data type with some sort of constraint on the base data type, but is valid for all? for example, smallint, and decimal.
type of NUMBER is NUMBER_BASE;
subtype of FLOAT is NUMBER;
ACTUAL subtype is FLOAT;
subtype 'DOUBLE PRECISION' is FLOAT;
INTEGER subtype is NUMBER (38.0).
subtype INT is INTEGER;
subtype SMALLINT is NUMBER (38.0).
DECIMAL subtype is NUMBER (38.0).
DIGITAL subtype is DECIMAL;
DEC subtype is DECIMAL;
>
Some of those who, as a smallint, SQL ANSI data types. See table 2-6 ANSI Datatypes converted to Oracle data types in the doc of the SQL language
http://docs.Oracle.com/CD/B28359_01/server.111/b28286/sql_elements001.htmOracle allows the name of the ANSI data type to use and combines the name of the ANSI for the appropriate Oracle data type
>
ANSI SQL/DS and DB2 data typesThe SQL statements that create tables and clusters allows also ANSI data types and products IBM SQL/DS and DB2 data types. Oracle recognizes the ANSI or IBM data type name that differs from the Oracle database data type name. It converts the data type for the equivalent Oracle data type, stores the Oracle data type under the name of the column data type and stores the data in the column in the data type Oracle based on the conversions listed in the following tables.
>
But BINARY_FLOAT and BINARY_DOUBLE types are each defined as unique data types (see table 2-1 in this doc).Because they are unique Oracle data types, they can be overloaded.
-
FRM-41335: Populate_List: invalid column for column 1 type
Hello world
I can't fill my list item file. I use Oracle Forms 6i, running on windows 64-bit
Here is my code.
DECLARE
REPORT NUMBER;
list_id POINT;
BEGIN
set_item_property ('spn.lst_year_annual', visible, property_true);
set_item_property ('spn.lst_year_annual', enabled, property_true);
list_id: = Find_Item ('spn.lst_year_annual');
-to fill the
STATUS: = POPULATE_GROUP ('RG_YEAR_RANGE');
-Make sure that the select statement is executed successfully.
CLEAR_LIST (list_id);
POPULATE_LIST (list_id, 'RG_YEAR_RANGE');
END;
Here's my query for RG_YEAR_RANGE group
Select years, years
v $ year_range
v$ year_range view query
SELECT ((TO_CHAR (SYSDATE, 'YYYY') + 1) - ROWNUM) years
OF object where rownum < = 20PoPList column data types are VARCHAR2. Make sure you cast it explicitly your columns to the query of VARCHAR2 using the function TO_CHAR.
select TO_CHAR(years), TO_CHAR(years) from v$year_range
Craig...
-
NVL function varies from char to varchar2 data type
My question is why nvl function varies from char to varchar2 data type?SQL> select * from v$version; BANNER -------------------------------------------------------------------------------- Oracle Database 11g Release 11.2.0.1.0 - Production PL/SQL Release 11.2.0.1.0 - Production CORE 11.2.0.1.0 Production TNS for 32-bit Windows: Version 11.2.0.1.0 - Production NLSRTL Version 11.2.0.1.0 - Production SQL> create table fullJoinTest1(col1 char(14)); Table created. SQL> create table fullJoinTest2(col1 char(14)); Table created. SQL> insert all 2 into fullJoinTest1 values('aaa') 3 into fullJoinTest1 values('bbb') 4 into fullJoinTest2 values('aaa') 5 into fullJoinTest2 values('ccc') 6 select 1 from dual; 4 rows created. SQL> select nvl(a.col1,b.col1) as aaaa 2 from fullJoinTest1 a full join fullJoinTest2 b 3 on a.col1=b.col1 4 where nvl(a.col1,b.col1)= 'ccc'; no rows selected SQL> create table fullJoinTest3 as 2 select nvl(a.col1,b.col1) as "WhatIsType?" 3 from fullJoinTest1 a full join fullJoinTest2 b 4 on a.col1=b.col1 5 where nvl(a.col1,b.col1)= 'ccc'; Table created. SQL> desc fullJoinTest3 Name Null? Type ------------- -------- ------------ WhatIsType? VARCHAR2(14) SQL> create table fullJoinTest4 as 2 select case when a.col1 is not null then a.col1 else b.col1 end as "WhatIsType?" 3 from fullJoinTest1 a full join fullJoinTest2 b 4 on a.col1=b.col1; Table created. SQL> desc fullJoinTest4 Name Null? Type ----------- -------- -------- WhatIsType? CHAR(14)
Same case expression does not change the data type.
I insist that this is a bug of function nvl isn't - it.Documented behavior:
http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/functions119.htm#SQLRF00684If expr1 is character data, then Oracle Database converts expr2 to the data type of expr1 before comparing them and returns VARCHAR2 in the character set of expr1.
-
-Error ORA-00932: inconsistent data types: expected TANK got the NUMBER
Here is my report query...
The column data type RFA_FLAG is NUMBER(*,0)... I'm view RSA and RSA - not the area of selection, but I get the error ORA-00932: inconsistent data types: expected TANK got the NUMBER >select * from DW_RFA_JOBDATA where FINISH_TIME >= :P1_START_DATE and FINISH_TIME < :P1_END_DATE AND RFA_FLAG = (CASE :P1_JOB_CLASSIFICATION WHEN '0' THEN 'LSF' WHEN '1' THEN 'NON-LSF' ELSE RFA_FLAG END)
I have created a static LOV with LST display 0 return
Display NON - RSA 1 return...
Could any body please help me in truble shooting error? How to to convert the data type to number, I have no privileges to make changes to the table...Mark you my previous answer as correct? (MOST POINTS! :))
-
Hi all
I use Oracle 10.2.
I had a table contains one column. data type is BLOB.
When I run the select query I get error like:
SQL > select * from BRIEF_ALL;
SP2-0678: column Type or attribute can not be displayed by SQL * more
SQL > desc BRIEF_ALL;
Name Null? Type
----------------------------------------- -------- ----------------------------
CONTENT BLOB
Thank youSP2-0678: column Type or attribute can not be displayed by SQL * more
Upgrade of SQL * Plus 11.1.0.7:
SQL> create table t (bl) as select to_blob(utl_raw.cast_to_raw('Hello world')) from dual 2 / Table created. SQL> SQL> desc t Name Null? Type ----------------------------------------- -------- ---------------------------- BL BLOB SQL> select * from t 2 / BL -------------------------------------------------------------------------------- 48656C6C6F20776F726C64 SQL>
For older versions, you can try
select utl_raw.cast_to_varchar2(bl) bl from t
-
Table of functions and direct requests for NUMBER data types database
Hello. I call a number of functions table of our Enterprise BI server, and I chose to do this by using direct database requests (I believe you can also call functions table in the physical layer of the repository, but is not what I do). The problem is that whenever I go back any number of the table function which is not a whole number (1.23, for example), BI assigns the INTEGER data type to the field rather than the data type DOUBLE, rounded so my number to the nearest integer. Here is a short 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 THE my_row;
FUNCTION to CREATE or REPLACE my_table_function RETURN my_tab
PIPELINED IS
BEGIN
PIPE ROW (my_row (1.23));
END;
/
Make this your request at your request Direct to database:
SELECT my_num FROM table (my_table_function);
This query returns correctly '1.23' when it is called from the database. In BI, on the other hand, it returns a value of '1' (and the field of labels an INTEGER rather than data type DOUBLE). If at the request of data Direct you change column properties-> data-> decimal from 0 to 2 Format, then it displays is not surprising "1.00". I then tried to change MY_ROW. Data type of MY_NUM by explicitly specifying the precision and no luck. BI still labels this field as an INTEGER. Then I started to try to deceive BI 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 found a solution, but I'm surprised that I have to resort to that:
SELECT * FROM (SELECT / * + NO_MERGE * / table my_num (my_table_function));
Is anyone out there knows a better way to do it? The above is a hack in my opinion. :)
Thanks in advance for any input.
-JimYes, 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 decimal point.
Very delicate!Published by: gerardnico on July 7, 2009 14:55 change number (10.2) in double precision... pffff
Maybe you are looking for
-
Satellite M70 - CLI - cannot install display or SM Bus controller driver
Hello I have a Satellite M70 - cli PSM73C-CL100E and I got a new hard drive and loaded Windows xp. I went on the Toshiba site and downloaded and installed all the drivers. I have no problem with the wifi atheros, the sound, modem or chipset drivers.
-
My Adobe CS 6 applications will work if I go from Cougar to El Capitan?
-
Cannot send the email from the IPHONE
I've always been able to send an e-mail from my account on my Iphone until today Apple when he stopped without changing me anything knowingly. I tried to disable the Wifi in case our network guys had played with something and a test email, I sent a f
-
Greetings, West this pop up message annoyng which continues to appear a little each time, even if after I start my computer. It is said "ntvdm.exe has stopped working and he will be shut down", I close the window and aparently everything works OK. Bu
-
Audio device is in use by another application
As the title suggests, however, I tried to reboot Windows Audio, I have uninstalled and reinstalled my Audio drivers no other programs try to use the speakers on my TV, forcing audio to play through my TV (extinguish all alternative audio devices) ca