{"Unsupported column datatype"}
I am trying to execute a procedure that returns a stored procedure. My version of Oracle DB is 9.2 and the ODP .NET version is 10.2.0.100
My C# code looks like this.
try
OracleCommand od = new OracleCommand();
od.Connection = oc;
OracleParameter opBranchNo;
OracleParameter opSysRef;
od.CommandType = System.Data.CommandType.StoredProcedure;
od.CommandText = "pkg_fetchleaseinfo.proc_fetchleaseheader";
opBranchNo = new OracleParameter("IBRANCH_ID", OracleDbType.Varchar2, 3, "044");
opBranchNo.Direction = System.Data.ParameterDirection.Input;
od.Parameters.Add(opBranchNo);
opSysRef = new OracleParameter();
opSysRef.ParameterName = "REC_SET";
opSysRef.Direction = System.Data.ParameterDirection.Output;
opSysRef.OracleDbType = OracleDbType.RefCursor;
od.Parameters.Add(opSysRef);
od.Prepare();
od.ExecuteNonQuery();
Oracle.DataAccess.Types.OracleRefCursor sysref = (Oracle.DataAccess.Types.OracleRefCursor)opSysRef.Value;
return sysref.GetDataReader();
//OracleDataReader dr1 = ((Oracle.DataAccess.Types.OracleRefCursor) opSysRef.Value).GetDataReader();
//return dr1;
catch (Exception e)
Console.WriteLine("Error " + e.ToString());
return null;
}My Oracle Procedure code looks like this
PROCEDURE proc_fetchleaseheader(ibranch_id IN VARCHAR2,
rec_set OUT SYS_REFCURSOR) IS
x_rec genericCursor;
BEGIN
OPEN x_rec FOR
SELECT getleaseheaderrows(ibranch_id) FROM dual;
rec_set := x_rec;
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;It appears the the GetDataReader function is not supported. Also the function getleaseheaderrows returns a PIPELINED row and I am not sure if that would cause my code to fail.
Hi,
I don't have 10.2.0.1 handy to test with, but I tested this on 11106.20 and it works for me. I had to change the stored proc slightly, but perhaps you can test the same?
It's based on this blog from my buddy Mark Williams:
http://oradim.blogspot.com/2007/10/odpnet-tip-using-pipelined-functions.html
Hope it helps,
Greg
http://oradim.blogspot.com/2007/10/odpnet-tip-using-pipelined-functions.html
create or replace package pkg_fetchleaseinfo as
procedure proc_fetchleaseheader(v1 in varchar2, v2 out sys_refcursor);
end;
create or replace package body pkg_fetchleaseinfo as
procedure proc_fetchleaseheader(v1 in varchar2, v2 out sys_refcursor) is
BEGIN
OPEN v2 FOR SELECT * from table(pipeline_test.get_rows());
end;
end;
using System;
using System.Data;
using Oracle.DataAccess.Client;
using Oracle.DataAccess.Types;
namespace ConsoleApplication8
class Program
static void Main(string[] args)
OracleConnection con = new OracleConnection("data source=orcl;user id=scott;password=tiger");
con.Open();
OracleCommand od = new OracleCommand();
od.Connection = con;
OracleParameter opBranchNo;
OracleParameter opSysRef;
od.CommandType = System.Data.CommandType.StoredProcedure;
od.CommandText = "pkg_fetchleaseinfo.proc_fetchleaseheader";
opBranchNo = new OracleParameter("IBRANCH_ID", OracleDbType.Varchar2, 3, "044");
opBranchNo.Direction = System.Data.ParameterDirection.Input;
od.Parameters.Add(opBranchNo);
opSysRef = new OracleParameter();
opSysRef.ParameterName = "REC_SET";
opSysRef.Direction = System.Data.ParameterDirection.Output;
opSysRef.OracleDbType = OracleDbType.RefCursor;
od.Parameters.Add(opSysRef);
od.Prepare();
od.ExecuteNonQuery();
Oracle.DataAccess.Types.OracleRefCursor sysref = (Oracle.DataAccess.Types.OracleRefCursor)opSysRef.Value;
OracleDataReader rdr = sysref.GetDataReader();
while (rdr.Read())
Console.WriteLine(rdr[0].ToString());
}OUTPUT
=========
John
Paul
George
Ringo
Press any key to continue . . .
Similar Messages
-
ORA-03115: unsupported network datatype or representation
hi,
i m executing a long delete query from java using bind variables. it is throwing
ORA-03115: unsupported network datatype or representation
the client version is oracle9i and server is oracle10g. i can't upgrade the client version immediately.
i have only number and varchar datatype in the table, not timestamp or something like that
ORA-03115: unsupported network datatype or representation
Re: ORA-03108: oranet: ORACLE does not support this interface version
other tables are not giving similar problemhi
in java query is some thing like
delete from mytable where col1 = ? and col2 is null and col3 = ? and......
and then m binding values to it
but if i execute the query in sqlplus like it's running fine
delete from mytable where col1 = 'somevalue' and col2 is null and col3 = 'someothervalue' and......
jdbc version 2.0
all column types are eithe varchar or number
any idea? -
Hi,
How can i modify a column datatype varchar2(100) into blob in a table.
Regards,
Famecreate table x (y varchar2(100));
insert into x values ('A');
commit;
alter table x rename column y to z;
alter table x add (y clob);
update x set y = z;
commit;
alter table x drop column z;
Table dropped.
Table created.
1 row created.
Commit complete.
Table altered.
Table altered.
1 row updated.
Commit complete.
Table altered.
drop table x purge;
create table x (y varchar2(10));
insert into x values ('A');
commit;
alter table x rename column y to z;
alter table x add (y blob);
update x set y = utl_raw.cast_to_raw (z);
commit;
select * from x;
update x set y = (z);
commit;
select * from x;
alter table x drop column z;
Table dropped.
Table created.
1 row created.
Commit complete.
Table altered.
Table altered.
1 row updated.
Commit complete.
Z Y
A A
1 row selected.
1 row updated.
Commit complete.
Z Y
A
1 row selected.
Table altered. -
OBIEE - changing imported column datatypes
Hi All,
I am trying to join 2 tables in physical layer but the columns on which I am making join condition have different datatypes defined(one is datetime,another is timestamp).Hence, I am getting error incompatible datatypes can't be joined.
I don't want to change the columns datatypes in ohysical layer bcz I am not sure if some other report using this rpd might be using the join conditions based on existing datatypes.Is there any alternative to this?
Please suggest.
Thanks,
NehaPlease try to use this function. it is good if we have sample data for both columns.Please provide if you have issues using following function
Evaluate( 'to_date(%1,%2)',Evaluate( 'TO_CHAR(%1)' as char,20090101) , 'yyyymmdd')
Thanks
NK -
Hi,
I created a table with some 10 columns earlier, now one of the column datatype needs to be changed to varchar2(2), which actually in the database it is number.
The thing the table now contains 10 records. Its not allowing me to modify the column datatype, because it has rows in it. How to change the column datatype with data in the table. Pl reply ASAP.
ThanksSee the following example.
Let's modify deptno column from number to varchar2 :
SCOTT@demo102> desc emp2
Name Null? Type
EMPNO NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2)
SCOTT@demo102> select count(*) from emp2;
COUNT(*)
14
SCOTT@demo102> alter table emp2 modify deptno varchar2(2);
alter table emp2 modify deptno varchar2(2)
ERROR at line 1:
ORA-01439: column to be modified must be empty to change datatype
SCOTT@demo102> alter table emp2[b] add deptno2 varchar2(2);
Table altered.
SCOTT@demo102> update emp2 set deptno2=deptno;
14 rows updated.
SCOTT@demo102> commit;
Commit complete.
SCOTT@demo102> alter table emp2 drop column deptno
SCOTT@demo102> /
Table altered.
SCOTT@demo102> alter table emp2 rename column deptno2 to deptno
SCOTT@demo102> /
Table altered.
SCOTT@demo102> desc emp2
Name Null? Type
EMPNO NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO VARCHAR2(2)
SCOTT@demo102>
Pl reply ASAP.Since this is saturday, and saturday is an unworked day in most of countries, and since this forum is based on volunteers, you cannot ask ASAP...
Nicolas. -
Data of column datatype CLOB is moved to other columns of the same table
Hi all,
I have an issue with the tables having a CLOB datatype field.
When executing a simple query on a table with a column of type CLOB it returns error [POL-2403] value too large for column.
SQL> desc od_stock_nbcst_notes;
Name Null? Type
OD_STOCKID N NUMBER
NBC_SERVICETYPE N VARCHAR(40)
LANGUAGECODE N VARCHAR(8)
AU_USERIDINS Y NUMBER
INSERTDATE Y DATE
AU_USERIDUPD Y NUMBER
MODIFYDATE Y DATE
VERSION Y SMALLINT(4)
DBUSERINS Y VARCHAR(120)
DBUSERUPD Y VARCHAR(120)
TEXT Y CLOB(2000000000)
NBC_PROVIDERCODE N VARCHAR(40)
SQL> select * from od_stock_nbcst_notes;
[POL-2403] value too large for column
Checking deeply, some of the rows have got the data of the CLOB column moved in another column of the table.
When doing select length(nbc_providercode) the length is bigger than the datatype of the field (varchar(40)).
When doing substr(nbc_providercode,1,40) to see the content of the field, a portion of the Clob data is retrieved.
SQL> select max(length(nbc_providercode)) from od_stock_nbcst_notes;
MAX(LENGTH(NBC_PROVIDERCODE))
162
Choosing one random record, this is the stored information.
SQL> select length(nbc_providerCode), text from od_stock_nbcst_notes where length(nbc_providerCode)=52;
LENGTH(NBC_PROVIDERCODE) | TEXT
-------------------------+-----------
52 | poucos me
SQL> select nbc_providerCode from od_stock_nbcst_notes where length(nbc_providerCode)=52;
[POL-2403] value too large for column
SQL> select substr(nbc_providercode,1,40) from od_stock_nbcst_notes where length(nbc_providercode)=52 ;
SUBSTR(NBC_PROVIDERCODE
Aproveite e deixe o seu carro no parque
The content of the field is part of the content of the field text (datatype CLOB, containts an XML)!!!
The right content of the field must be 'MTS' (retrieved from Central DB).
The CLOB is being inserted into the Central DB, not into the Client ODB. Data is synchronized from CDB to ODB and the data is reaching the client in a wrong way.
The issue can be recreated all the time in the same DB, but between different users the "corrupted" records are different.
Any idea?939569 wrote:
Hello,
I am using Oracle 11.2, I would like to use SQL to update one column based on values of other rows at the same table. Here are the details:
create table TB_test (myId number(4), crtTs date, updTs date);
insert into tb_test(1, to_date('20110101', 'yyyymmdd'), null);
insert into tb_test(1, to_date('20110201', 'yyyymmdd'), null);
insert into tb_test(1, to_date('20110301', 'yyyymmdd'), null);
insert into tb_test(2, to_date('20110901', 'yyyymmdd'), null);
insert into tb_test(2, to_date('20110902', 'yyyymmdd'), null);
After running the SQL, I would like have the following result:
1, 20110101, 20110201
1, 20110201, 20110301
1, 20110301, null
2, 20110901, 20110902
2, 20110902, null
Thanks for your suggestion.How do I ask a question on the forums?
SQL and PL/SQL FAQ -
Reg: View column datatype
Hi Team,
While creating the views, column automatically converted into varchar2(81) data type from number datatype.
but stage1 table has legacy_trx_number is number data type and statg2 table has header_num is number data type.
Just i added the highlighted part in the view. So automatiicaly converted number to varchar2 datatype. How to keep data type remain the same as source stage table datatype even though those columns used in the view.
CREATE OR REPLACE VIEW test_view AS
SELECT h1.legacy_trx_number
||'.'
||h2.header_num legacy_trx_number,
h1.legacy_trx_date,
h1.ledger_id,
h1.legal_entity_id,
h1.header_record_identifier,
h2.header_num,
h2.gl_date,
h2.header_value_full,
h2.header_value
FROM stage1 H1,
stage2 H2
WHERE h1.header_record_identifier = h2.header_record_identifier;
Please help give me suggestion on this.
Thanks in advance.You can do it like this!
Example:-
SQL> ed
Wrote file afiedt.buf
1 create view v_num_test
2 as
3* select to_number(5478||'.'||87489) result from dual
SQL> /
View created.
SQL> select * from v_num_test;
RESULT
5478.87489
SQL> desc v_num_test
Name Null? Type
RESULT NUMBER -
Hi
I have one column which is of datatype BLOB.File was there in the blob column. File Contains the XML tags.My Requirement is need to extract the tag value.
EX:in XLM i need to extract <name>Rajesh</name>
Bottom line is Need to extract one tag value from BLOB dataype column which contains the file in which XML tags were there.
Plz Helpuser12057782 wrote:
Hi
I have one column which is of datatype BLOB.File was there in the blob column. File Contains the XML tags.My Requirement is need to extract the tag value.
EX:in XLM i need to extract <name>Rajesh</name> That's not good. BLOB should store binary data. CLOB should store character based data. XML is character based, so you could end up corrupting the XML by storing it in a BLOB.
Oracle also has an XMLTYPE datatype specifically for storing XML data in, so why aren't you using that?
Bottom line is Need to extract one tag value from BLOB dataype column which contains the file in which XML tags were there.Here's a basic example of extracting XML from an XMLTYPE (you can easily convert CLOB to XMLTYPE using it's constructor method)...
SQL> ed
Wrote file afiedt.buf
1 with t as (select XMLTYPE('<cube>
2 <dimension>
3 <sourcename>A1</sourcename>
4 <targetname>X1</targetname>
5 </dimension>
6 <dimension>
7 <sourcename>B1</sourcename>
8 <targetname>Y1</targetname>
9 </dimension>
10 <dimension>
11 <sourcename>C1</sourcename>
12 <targetname>Z1</targetname>
13 </dimension>
14 </cube>
15 ') as xml
16 from dual
17 )
18 -- end of test data
19 select x.*
20 from t
21 ,XMLTABLE('/cube/dimension'
22 PASSING t.xml
23 COLUMNS sourcename VARCHAR2(2) PATH '/dimension/sourcename'
24* ,targetname VARCHAR2(2) PATH '/dimension/targetname') x
SQL> /
SO TA
A1 X1
B1 Y1
C1 Z1
SQL>If that isn't quite what you want, provide more information with your database version, example data and expected output, as detailed in the FAQ: {message:id=9360002}
I'm surprised that as a member who's been here for 3 years+ and asked 32 questions, you still haven't understood how to ask a question so that people can help you. Perhaps that explains why you still have 27 question showing as unanswered. -
Retrieving column datatype n its size.
Hi..,
I have a query regarding ODI.
I have a source table & one target table.
I want to write data from source table to target table...but there are two more columns in target where i like to write the datatype n size of respective rows from source table.
Is it possible thru ODI?
Hope for a reply.Hi..,
I have a query regarding ODI.
I have a source table & one target table.
I want to write data from source table to target table...but there are two more columns in target where i like to write the datatype n size of respective rows from source table.
Is it possible thru ODI?
Hope for a reply. -
Fact columns Datatype is changing from char to int in OBIEE 11g
Hi ,
I am taking measure columns - "product description","tot cost" against a dimension "project name" .
I am generating this report in a planing form and OBIEE .
in planing form :
product description tot cost
project name
P1 A 1500
p2 B 1700
p3 C 1800
in obiee report :
product description
project name
P1 16 1500
p2 17 1700
p3 19 1800
Somehow , measure's datatype are getting changed from char to number , in OBIEE report.
By default , the data type for all fact's is Double .I tried changing that to varchar , but result is same .
Do I need to change anything in physical layer / RPD .
OBIEE version : 11.1.1.6
Essbase version : 11.1.2Hi ,
Thanks for your reply . To confirm , the data type of product description column is "double" in essbase .
I found out ,thers's a RDBMS table , consisting of two columns - ID, text value . where product description's are in text value's with the corresponding ID's(integer values) .
Now , when I am creating a form in planning , its fetching the text values of product description (there's some inbulit setting's available for this in plannng) .
However , in obiee its fetching the ID values of product description .
So ,
1. Is there any similer setting I can do for OBIEE , so that it's fetches only text value's of product description .
2. If not , then I have to join the essbase fact table with this RDBMS table . I am not sure how to do it . -
I am trying to add a new logical column to the BMM layer. But by default the data type is showing as UNKNOWN and is grayed out. How can i change it? I am trying to perform a calculation on the new column added.
Thanks!Hi,
user10797474 is correct. It takes the default datatype depending on your logic. So in the properties of the column, check the "Use existing columns as source" and then click the button with the three dots. Then create your logic in this expression builder. Select the columns and formulas from the list so you do not have to type them. Once you save from the expression builder, the default datatype should be set.
Rajesh -
Changing column datatype value
Can any body forward me the SQL for changing the datatype value from
Varchar2(64) to Varchar2(2)
ArifYou can do that if the column is empty, or its contents size is not bigger than the new size :
SQL> create table test_tab(a varchar2(100));
Table created.
SQL> alter table test_tab modify a varchar2(50);
Table altered.
SQL> insert into test_tab values('AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA');
1 row created.
SQL> alter table test_tab modify a varchar2(40);
Table altered.
SQL> ed
Wrote file afiedt.buf
1* alter table test_tab modify a varchar2(20)
SQL> /
alter table test_tab modify a varchar2(20)
ERROR at line 1:
ORA-01441: cannot decrease column length because some value is too big
SQL> -
Change column datatype from varchar2 to number(10) and keep existing data
Hi,
I need to change the datatype on a column that already has data in it from a varchar2 to number(10). The data that is already there is not necessarily number data, however I must be able to keep the old data to. We are running 10g. Does anyone have any ideas? Thanks. Here's the current data.
Current Values for From_Value
T
U
T2
K
M
A
T
T1
O
E
S
NSTU
4Example of keeping the data in the current column and adding a new numeric column for numeric data:
SQL> drop table t purge;
Table dropped.
SQL> create table t(i int, x varchar2(10));
Table created.
SQL> insert into t values(1, 'T1');
1 row created.
SQL> insert into t values(2, 2);
1 row created.
SQL> --
SQL> alter table t add (xn number);
Table altered.
SQL> --
SQL> begin
2 for c in (select i, x from t)
3 loop
4 begin
5 update t set xn = to_number(c.x) where i = c.i;
6 exception
7 when invalid_number then null;
8 end;
9 end loop;
10 end;
11 /
PL/SQL procedure successfully completed.
SQL> show errors
No errors.
SQL> select * from t;
I X XN
1 T1
2 2 2 -
Query to Find all the Tables and their corresponding columns,dataType in DB
Hi all,
I need a query which can give me all the Tables existing in my DB and their corresponding Columns existed for those tables and Datatype for each column .
Thanks in Advance,
viajyHi,
For your user tables you can use USER_TAB_COLUMNS.
Just give DESC USER_TAB_COLUMNS at your SQL> prompt.
You will know on that object.
Regards,
Sailaja -
GetString() and column datatypes
Hi,
I have a program that reads the row values of a SELECT statement as strings.
std::string value = resultSet->getString(IntCol); // read an integer value as string instead of getInt()
The getString() function returns a std::string for almost all datatypes (like integer, float) correctly, except when it comes to Timestamp. Here getString() returns an empty string.
What surprised me that it worked as well for a column with the DATE datatype (getString() returns a string formatted with the session parameter NLS_DATE_FORMAT).
But this is not true for the Timestamp datatype. Here, I have to create explicitly a Timestamp object:
Timestamp time = resultSet->getTimestamp();
std::string value = time.toText(format, 6);
Is that a bug? Why isn't the session variable NLS_TIMESTAMP_FORMAT used (like DATE)?
Any suggestions appreciated! Thanks.
ChristianUse either a NLS_TIMESTAMP_FORMAT or explicitly convert timestamp to string by using TO_CHAR
Maybe you are looking for
-
Unable To View PDF Files From Google Mail
This is probably a GMail problem, but it's on my iPod Touch so I thought I'd ask. Up until recently, I've been able to view PDF files that have been attached to emails in GMail on my iPod Touch. However lately, I've been getting the following error m
-
HT202157 i pluged in my apple tv but it flikering on my tv screen
i plugged in my apple tv but it flickering on my tv screen
-
Drag and Drop, dropping to a parent component.
I've been searching high and low for a solution to a problem without any success. I'm hoping someone here might have a suggestion. I have an application (written using Java 5.0) which allows dragging and dropping custom components between JPanels. My
-
Can I get an old iMovie app for free
I have iMovie 7.1.4 on my laptop ad do not like it. can I get iMovie 5.0.2 for free for my laptop?
-
CS5 telling me to update, but updates won't install (no error code given)
I have been trying to install the updates my CS5 has been telling me to do but every time I run the update program, it goes through the process and then says there was an error in updating all my programs. I have restarted my computer, I have shut ev