Interval data types ODBC driver support
I have tried both Oracle 10.02.00.03 and Oracle 11.01.00.06 ODBC drivers to get resultset description for interval data type columns with no success. Example,
CREATE TABLE TEST_INTERVAL
"COL1" INTERVAL YEAR (2) TO MONTH,
"COL2" INTERVAL YEAR (1) TO MONTH,
"COL3" INTERVAL DAY (2) TO SECOND (6),
"COL4" INTERVAL DAY (0) TO SECOND (0)
and in an ODBC client like CompareData or WinSQL attempt to retrieve the resultset description for 'select * from test_interval' using SQLColAttribute and SQL_DESC_CONCISE_TYPE, SQL_DESC_LABEL, SQL_DESC_AUTO_UNIQUE_VALUE, etc and get all errors.
Seems Oracle ODBC drivers do not know how to handle interval data types eventhough ODBC api provides the necessary framework for handling interval data [http://msdn.microsoft.com/en-us/library/ms716506(VS.85).aspx]
(For example, Informix ODBC driver, Mimer SQL ODBC driver provide complete support for their DBMS interval data types via ODBC)
Perhaps you ask in the wrong forum? It doesn't seem to be a 'Database - General' question:
ODBC
Werner
Similar Messages
-
Microsoft OLE DB Provider for Oracle: Data type is not supported.
I got the error:
Microsoft OLE DB Provider for Oracle: Data type is not supported.
Shortly after upgrading from Oracle 8 to Oracle 9. I was advised to download more up to date oracle drivers, but I was wondering if there was a way to tell what version of the 'OLE DB Provider for Oracle' is already at. Is there a command I can use via SQL Plus or something?I have found Microsoft ODBC for Oracle to be more stable than the Microsoft OLEDB for Oracle driver. I have also found both Microsoft ODBC and OLEDB drivers to be more stable than the drivers from Oracle.
You could always get the latest MDAC (Microsoft Data Access Components) from Microsoft's MSDN Download site and then get the ODAC (Oracle Data Access Components) from Oracle's OTN Download site. ODAC requires MDAC. And ODAC has the latest drivers.
I suppose it would help to have the latest patches for your Oracle client software too. Maybe Oracle MetaLink would have these?
It may even help to have the latest service pack for Visual Studio 6 (Visual C++ 6 and Visual Basic 6) too. -
Which version of ODBC Driver supports DSN-less Connection in JAVA
hai,
Which version of ODBC Driver supports DSN-less Connection in JAVA.
-rajahai,
Pleae help in this regard.
I am using a DSN-less connection to conect to
Access using JDBC. But it is not working. It is throwing
Data Source Name too long exception.
I think the problem is with ODBC version.
Let me clear about this.
Thanks in Advance.
-raja -
Oracle Version 10.1.0: Data type is not supported
Hi,
I am getting "Data Type is not supported" whenever I try to access tables with lob column in Toad.
Oracle server version is 10.1.0 and using toad version 7.6. Sql net version 9.2.0
Any pointers towards the resolution?
Thanks in advance.
BhaveshYou could take this opportunity to upgrade your Toad to version 10 of sqlplus.
Failing that there are mail lists for those less productive souls struggling with the amphibious software at which can be found at.
http://www.toadsoft.com/maillist.htm -
Hi,
Can anyone help me out please.
I have written one stored Procedure to create a views using Openrowset(openquery) but for tables which contains xml data types throwing error while executing the SP. Error
" Xml data type is not supported in distributed queries. Remote object 'OPENROWSET' has xml column(s)."
Please refer the Stored Procedure & error message below.
USE [Ice]
GO
/****** Object: StoredProcedure [dbo].[Pr_DBAccess] Script Date: 08/14/2014 16:08:20 ******/
SET
ANSI_NULLS ON
GO
SET
QUOTED_IDENTIFIER ON
GO
ALTER
PROCEDURE [dbo].[ Pr_DBAccess](@SERVERTYPE
NVARCHAR(50),@SERVERNAME
NVARCHAR(100),@DATABASENAME
NVARCHAR(100),@SCHEMANAME
NVARCHAR(100),@TABLENAME
NVARCHAR(100),@USERNAME
NVARCHAR(100),@PASSWORD
NVARCHAR(100))
AS
BEGIN
DECLARE @openquery
NVARCHAR(4000),
@ETL_CONFIG_IDN
NVARCHAR(100);
IF @SERVERTYPE='SQL'
BEGIN
SET @openquery=
'CREATE VIEW '+@TABLENAME+
' WITH ENCRYPTION AS SELECT * FROM OPENROWSET(''SQLNCLI'',''SERVER='+@SERVERNAME+';TRUSTED_CONNECTION=YES;'',''SELECT * FROM '+@DATABASENAME+'.'+@SCHEMANAME+'.'+@TABLENAME+''')'
SELECT @openquery
END
EXECUTE
sp_executesql @openquery
END
----While running the SP manually below error occuredHI ,
1. You cannot use a table or view that contains xml or clr type as 4-part name in your query
2. You need to cast the column to either nvarchar(max) or varbinary(max) or other appropriate type to use
3. If you have a table that has xml type for example then you need to create a view that contains all columns other than xml and query it instead. Or you can issue a pass-through query using OPEN QUERY with the appropriate columns only.
Here is a work around:
SELECT
Cast(a.XML_Data as XML) as XML_Data
FROM
OPENQUERY([LINKED SERVER NAME HERE],'
SELECT
Cast(XML_Data as Varchar) as XML_Data
FROM
[DATABASE NAME].[SCHEMA].[TABLE NAME]'
) a
Basically, the data is queried on the remote server, converts the XML data to a varchar, sends the data to the requesting server and then reconverts it back to XML.
You can take help from below link;
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/c6e0f4da-821f-4ba2-9b01-c141744076ef/xml-data-type-not-supported-in-distributed-queries?forum=transactsql
Thanks -
Initializing INTERVAL data type
I have a situation in which I want to keep track of the amount of time it takes to perform a task that it comprised of a number of steps. I need to get the amount of time to perform each task by subtracting the stop and start times; then these need to be added to a running total to track the total time to perform the task. My PL/SQL code looks something like this:DECLARE
start TIMESTAMP;
stop TIMESTAMP;
task_time INTERVAL DAY TO SECOND;
total_time INTERVAL DAY TO SECOND;
BEGIN
total_time := <an initial value (0)>; -- How is this done?
FOR i IN 1 .. <some upper limit> LOOP
start := <some date and time>;
stop := <some other date and time later than start>;
task_time := stop - start; -- Subtracting TIMESTAMPs results in an INTERVAL data type
total_time := total_time + task_time; -- Adding two INTERVALS results in an INTERVAL data type
END LOOP;
END;My question, as noted in the code is how do you initialize an INTERVAL data type?
I have tried "total_time := 0" but I get a compile error because the types are not compatible. I have also tried setting it to "TO_DATE('00:00','hh24:mi')" but this also results in a type compatibility issue.
Should I be approaching the problem in another way completely?Nothing could be simpler:
declare
v_interval interval day to second;
begin
v_interval := interval '0' hour;
dbms_output.put_line(v_interval);
end; -
제품 : SQL*PLUS
작성날짜 : 2004-05-28
ORACLE9I - INTERVAL DATA TYPE
=============================
PURPOSE
Oracle9i 부터 추가된 INTERVAL data type에 대해 알아보자.
Explanation
INTERVAL data type은 datetime 기간을 저장하는 type이다.
아래의 syntax를 확인해 보자.
INTERVAL <interval qualifier>
Examples:
INTERVAL YEAR TO MONTH
INTERVAL DAY (6) TO SECOND (5)
INTERVAL type에는 다음의 두 가지 종류가 있다.
1. Year-month interval (INTERVAL YEAR TO MONTH)
연과 월의 기간을 저장하는 type으로 각각 연수,월수를 나타낸다.
Keyword Meaning
YEAR Years
MONTH Months
2. Day-time interval (INTERVAL DAY TO SECOND)
각 DAY, HOUR, MINUTE, and SECOND 를 저장하는 type으로 일반적으로
사용하는 date format으로 저장한다.
Keyword Meaning
DAY Days
HOUR Hours
MINUTE Minutes
SECOND Seconds and possibly fractions of a second
이 type은 생성할 때 각 day와 second의 자리수를 지정해야 한다.
default 로는 day(2), second (6) 으로 지정된다.
Year-month interval type은 다른 type과 함께 비교할 때 다른 data의 각 year, month
와 비교되며, day-time interval의 경우에도 다른 type의 day-time 값과만 비교된다.
3. INTERVAL item의 valid value.
Keyword Valid values
YEAR Unconstrained except by <interval leading field precision>
MONTH 0..11
DAY Unconstrained except by <interval leading field precision>
HOUR 0..23
MINUTE 0..59
SECOND 0..59.9(N) where "9(N)" indicates the number of digits
specified by <interval fractional seconds
precision> in the <interval qualifier>
4. Interval data type의 sample value.
Data type Literal Example
INTERVAL YEAR TO MONTH INTERVAL '01-02' YEAR TO MONTH
INTERVAL DAY(3) TO SECOND(2) INTERVAL '100 10:20:42.22' DAY(3) TO SECOND(2)
Examples
1. sample table생성후 data입력
create table demo_interval ( a INTERVAL YEAR(2) TO MONTH,
b INTERVAL DAY(2) TO SECOND(6));
insert into demo_interval values(INTERVAL'12-01' YEAR TO MONTH,
INTERVAL'50 10:20:20.123' DAY(2) TO SECOND(3));
commit;
SQL> select * from demo_interval;
A B
+12-01 +50 10:20:20.123000
2. 다른 date type의 data와 이 interval type의 data를 더하거나 계산하여 나타낼 수 있다.
SQL> select sysdate, sysdate+a, sysdate+b from demo_interval;
SYSDATE SYSDATE+A SYSDATE+B
2004-05-12 00:11:46 2016-06-12 00:11:46 2004-07-01 10:32:06
Reference Documents
<Note:149118.1>Nothing could be simpler:
declare
v_interval interval day to second;
begin
v_interval := interval '0' hour;
dbms_output.put_line(v_interval);
end; -
I looked at the AMF 3 document but did not find anything there. Connection to the MSSQL database is through WSDL.
PUSH...
-
Oracle Forms New Features - Your input. Supporting data types
I am interested to know IF we were to support any new database types in Oracle Forms 11g, which types would you like supported and why. I'd also like to know if you are currently working around the absence of a database type.
Please note, this is not any kind of commitment to support new data types in Oracle Forms applications but we are interested to know if there is demand and if so, for what types.
Thanks
Grant Ronald
Oracle Forms Product Management
p.s lets keep the thread focused on the topic so please don't post technical questions or comments about different new features - if you want to, start a new thread - thanksHi Grant,
support for the "new" - well they exists since 9iR1 ... 2001 - data types TIMESTAMP, TIMESTAMP WITH TIME ZONE, TIMESTAMP WITH LOCAL TIME ZONE, INTERVAL YEAR TO MONTH and INTERVAL DAY TO SECOND would be very helpful.
Currently it's not possible to use the Data Block Wizard to create a data block for table/view that contains one of these columns.
(In Forms Builder 10.1.2.3 it fails with a strange error message ... iewbdbc_oracle_to_id ... C:\forms\101220\src\ie\iewbdb.c:724 ...)
So, one has to create the data block and the items manually. The items have to be CHARS.
Then forms is able to fetch and display these columns. The user can edit them as normal.
A WHEN-VALIDATE-ITEM trigger can be used to make sure that the implicit conversion from CHAR to the "new" datatype works.
For example, an INTERVAL YEAR TO MONTH column (b):
declare
l_invalid_interval exception;
pragma exception_init(l_invalid_interval, -1867);
l_invalid_month exception;
pragma exception_init(l_invalid_month, -1843);
l_dummy interval year(9) to month;
begin
l_dummy := to_yminterval(:block2.b);
exception
when l_invalid_interval
then
message('invalid interval');
raise form_trigger_failure;
when l_invalid_month
then
message('invalid month');
raise form_trigger_failure;
when others
then
message(error_text);
raise form_trigger_failure;
end;This nasty trick works for most of the "new" datatypes except with TIMESTAMP WITH TIME ZONE.
In Forms 10.1.2.3 the following WHEN-VALIDATE-ITEM trigger can (incorrectly!) fail:
declare
l_dummy timestamp with time zone;
begin
l_dummy := to_timestamp_tz(:block2.a);
end;It fails with "ORA-01804: failure to initialize timezone information", if the time zone is not like "-11:00", but like "EUROPE/PARIS". Don't know why...
If we recode our trigger to make a round-trip to the database, it works:
declare
l_dummy timestamp with time zone;
begin
select to_timestamp_tz(:block2.a)
into l_dummy
from dual;
end;We could avoid these tricks, if Forms (and Reports) would support these type natively.
Thanks, Michael
PS: The TIMESTAMP and INTERVAL data types should of course be supported as items, parameters, globals and record groups columns.
Edited by: michael76 on 25.10.2010 01:14 -
Problem when summery the data type of interval day to second
hi
i write a program calculate periods of time and summary it then i used interval day to second data type
oracle support basic 4 math operation (+,-,*,/) on interval
but although oracle does not support summary function like sum() ,avg(),count()!! this is a problem here
the walkaround it by use oracle data cartdrage advanced future like follows steps :
*1- i create type and i call it for ex: DAY_TO_SECOND_SUM_TYPE*
CREATE OR REPLACE DAY_TO_SECOND_SUM_TYPE /*TYPE as object
+(TOTAL INTERVAL day to SECOND , /* type header*/+
STATIC FUNCTION ODCIAggregateInitialize(SCTX IN OUT DAY_TO_SECOND_SUM_TYPE) return number,
member function ODCIAggregateIterate( self in out DAY_TO_SECOND_SUM_TYPE,value in interval day to second) return number,
member function ODCIAggregateTerminate(self in DAY_TO_SECOND_SUM_TYPE,returnvalue out interval day to second , flags in number) return number,
member function ODCIAggregateMerge(self in out DAY_TO_SECOND_SUM_TYPE,ctx2 in DAY_TO_SECOND_SUM_TYPE) return number
+)+
+/+
CREATE OR REPLACE TYPE "DAY_TO_SECOND_SUM_TYPE" as object
+(TOTAL INTERVAL day to SECOND ,+
STATIC FUNCTION ODCIAggregateInitialize(SCTX IN OUT DAY_TO_SECOND_SUM_TYPE) return number,
member function ODCIAggregateIterate( self in out DAY_TO_SECOND_SUM_TYPE,value in interval day to second) return number,
member function ODCIAggregateTerminate(self in DAY_TO_SECOND_SUM_TYPE,returnvalue out interval day to second , flags in number) return number,
member function ODCIAggregateMerge(self in out DAY_TO_SECOND_SUM_TYPE,ctx2 in DAY_TO_SECOND_SUM_TYPE) return number
+)+
create or replace type body DAY_TO_SECOND_SUM_TYPE as /* type body*/
static function ODCIAggregateInitialize(sctx in out DAY_TO_SECOND_SUM_TYPE) return number is
begin
sctx := DAY_TO_SECOND_SUM_TYPE(numtodsinterval(0,'second'));
return odciconst.Success;
end;
member function ODCIAggregateIterate( self in out DAY_TO_SECOND_SUM_TYPE,value in interval day to second) return number is
begin
self.total := self.total value;+
return odciconst.Success;
end ;
member function ODCIAggregateTerminate(self in DAY_TO_SECOND_SUM_TYPE,returnvalue out interval day to second , flags in number) return number is
begin
returnvalue := self.total;
return odciconst.Success;
end;
member function ODCIAggregateMerge(self in out DAY_TO_SECOND_SUM_TYPE,ctx2 in DAY_TO_SECOND_SUM_TYPE) return number is
begin
self.total := self.total ctx2.total;+
return odciconst.Success;
end;
end;
+/+
*2- i create artificial function to summary using that type let as called for ex: ds_sum as follows :*
create or replace function ds_sum( input interval day to second ) return interval day to second
parallel_enable aggregate
using DAY_TO_SECOND_SUM_TYPE
+/+
at last i used the function to summary intervals and its work so good but when the result of calculated summary value exceed the default precision of interval : INTERVAL DAY(2) TO SECOND(6)
i get an error :
ORA-01873 the leading precision of the interval is too small
Cause: The leading precision of the interval is too small to store the specified
interval .
Action: Increase the leading precision of the interval or specify an interval with
a smaller leading precision
although i can determine the precision of interval the declaration of the new type to maximum like :
+...........+
CREATE OR REPLACE TYPE "DAY_TO_SECOND_SUM_TYPE" as object
+(TOTAL INTERVAL day(9) to SECOND(6) ...........+
+.......................+
but the problem remain (in fact the error move from one functions of type to another function )
due i can't determine the precision of data type when i define function in PL/SQL it is illegal*
HOW CAN I SOLVE THIS PROBLEM AND BE ABLE TO SUMMARY INTERVAL DATA TYPE WHAT EVER THE RESULT OF SUMMARY IS HUGE
Edited by: user1193723 on Jun 18, 2009 4:35 AM
Edited by: user1193723 on Jun 18, 2009 4:36 AM
Edited by: user1193723 on Jun 18, 2009 4:37 AM
Edited by: user1193723 on Jun 18, 2009 4:38 AM
Edited by: user1193723 on Jun 18, 2009 4:38 AM
Edited by: user1193723 on Jun 18, 2009 4:40 AMhi,
Instead of 'interval day to second' in method declaration use internal datatype 'DSINTERVAL_UNCONSTRAINED'.
There are more unconstrained types in oracle.
Bartek -
Data types in Sql Server 2012 not supported by replication
Hi All,
I am planning to configure replication on SQL server 2012.I need to know what data types are not supported in replication and if there are any other boundations. kindly suggest.
Regards
RahulWhat type of replication are you looking to implement?
Have you had a look at this thread:
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/bbec1a86-14cd-4d90-8b62-c875de4cf9a0/data-type-not-supported-in-sql-server-2008-merge-replication?forum=sqlreplication -
What is native Sql data types and does oracle support this?
what is native Sql data types
Does oracle support this?http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#g31099
-
Import from Designer crashes with IMAGE data type
Hello,
I'd like to report an issue with Data Modeler while importing from Oracle Designer. If you consider this a bug, please let me know if I need to do anything else to request a fix for it.
I've used the import > Oracle Designer Model tool to import an application model. The import runs fine for a while, then crashes with a message "There are errors in import - check log file".
The application to be imported has 509 domains, 963 entities to import.
The summary info displayed after the import (when I close the error message pop up) is:
All statements: 1472
Imported statements: 538
Failed statements: 0
Not recognized statements: 934
The log file has the lines below:
2011-04-28 10:55:46,505 [Thread-8] ERROR XMLTransformationManager - Unable to load object from XML: C:\Users\Beatriz\Documents\ODTUG\2011\SDDM designs\GAME\GAME\rel\0EEBE15E-D9EFB22E4D6B\subviews\02A206F8-0C6C-0DF9-E643-5919DBCB895A.xml
java.io.FileNotFoundException: C:\Users\Beatriz\Documents\ODTUG\2011\SDDM designs\GAME\GAME\rel\0EEBE15E-D9EFB22E4D6B\subviews\02A206F8-0C6C-0DF9-E643-5919DBCB895A.xml (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at oracle.dbtools.crest.model.metadata.XMLToObjectTransformer.transformToObject(Unknown Source)
at oracle.dbtools.crest.model.metadata.XMLTransformationManager.transformFromXMLToObject(Unknown Source)
at oracle.dbtools.crest.model.metadata.XMLTransformationManager.openDesignPart(Unknown Source)
at oracle.dbtools.crest.model.design.Design.openDesign(Unknown Source)
at oracle.dbtools.crest.swingui.ControllerApplication$Recent$1.run(Unknown Source)
2011-04-28 11:03:44,114 [Thread-12] WARN ODODomain - ODOType.initStructuredTypeAttributes() - Unable to find Logical DataType for: IMAGE
2011-04-28 11:03:46,532 [Thread-12] ERROR ODExtractionHandler - Error during import from Designer Repository
java.sql.SQLException: Numeric Overflow
at oracle.jdbc.driver.NumberCommonAccessor.throwOverflow(NumberCommonAccessor.java:4380)
at oracle.jdbc.driver.NumberCommonAccessor.getInt(NumberCommonAccessor.java:111)
at oracle.jdbc.driver.OracleResultSetImpl.getInt(OracleResultSetImpl.java:928)
at oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:434)
at oracle.dbtools.crest.imports.oracledesigner.logical.ODOEntity.generate(Unknown Source)
at oracle.dbtools.crest.imports.oracledesigner.ODExtractionHandler.generateDesign(Unknown Source)
at oracle.dbtools.crest.imports.oracledesigner.ODExtractionController$Runner.run(Unknown Source)
at java.lang.Thread.run(Thread.java:619)
I see the issue with the IMAGE data type in the log. The model to be imported does have domains and entities using this data type. The domain actually did get imported, but it shows as "Unknown" logical type, even though there is an Image type available in the Data Modeler type list. None of the entities using IMAGE got imported.
Please let me know if you can provide a fix or workaround for this (other than changing the format in Designer).
Thank you,
Beatriz.Hello Beatriz,
definitely this is a bug. The problem with entities is not IMAGE data type it's supported there (it's overlooked for domains). The problem is volume information - Initial, Maximum, Average, Growth rate. No workaround for that.
Domain can be changed manually if it's just one affected.
Philip -
Can CR 2008 with XML ODBC driver using SQL CASE statement?
Hi:
when i use SQL Command to provide data to the report from XML file connection. I can not use CASE statement , CR always has error message about "CASE" word.
I test the same Statement in SQL client connected to Oracle, it runs fine.
So.. Is it driver's limitation that XML datasource can not use CASE statement inside SQL command window?
Thanks anyone's reply in advance.
JohnnychiHi Johnny,
CR supports what every the ODBC driver supports. The error you are getting is from the XML driver, CR is just passing it through.
Try using an ODBC to XML driver and then a stand-alone ODBC test tool to see if your SQL works.
If not you'll have to find another way to use the CASE statement.
Thank you
Don -
What is the data type for time and what to insert
Hi there
i had two attributes in a table called start_time and end_time and i want to insert time into these attrbutes e.g 10:00 and 11:00
How do i do that
what is oracle's built-in type for time???
adn how do i insert values in the table(i.e the format)
thanksThere is not Oracle type that has just a time. The DATE and TIMESTAMP data types include both the date and the time (TIMESTAMP has millisecond resolution and has optional timezone support). If what you're really interested is a time interval (i.e. 1 hour), there are some INTERVAL data types.
You have a lot of options for how to specify dates and timestamps along with format masks.
Justin
Distributed Database Consulting, Inc.
http://www.ddbcinc.com/askDDBC
Maybe you are looking for
-
Archive and delete sap event management objects
Team, I need to configure the archiving objects and residence time to Archive and delete EM objects. there are three steps of configuration, and I have never done this before. Can any one of you help me in setting up this config and the programs that
-
Delay program until end TranslateTransition JavaFX
Hey everyone, My name is Thomas and I am currently working on a final High School programming project. For this project we are programming a game with JavaFX, in which we feature several mini-games to improve children's mathematical skills. One of ab
-
Some words containing 'ti' are not copied correctly from PDF.
After exporting my Pages doc to PDF, if I try to copy text and paste it into a browser window it replaces any ti in the word with the wrong characters (such as P, (), or A). This doesn't happen in the main body of the text but does happen with words
-
Screen Changes With Full Screen Playback Over HDMI
Any one know if this is the best way to report a flash issue to the development team? Home Theater PC connected to a Sony Bravia Television via HDMI Issue is that when the Flash content is played back on full screen, the Television flickers and disp
-
I have the following web server and want to access it from a client but am not sure how. I was just wondeing if anyone could help. I know I have to type into IE on the client the following: http://localhost."port number"/"file name" I am unsure as ho