oracle

Oracle stored procedure DB Link question

I have a stored procedure FOO belonging to user A. User B has EXECUTE permission on FOO. One of the procedures in FOO uses a DB Link to retrieve data from BARTABLE@REMOTEDB. A has a DB Link to REMOTEDB connecting as user AREMOTE while B has a DBLink with the same name connecting to REMOTEDB but as user BREMOTE. When B executes FOO, w...

how to use bulk collect instead of a loop in Oracle

I have a sample query like below in my procedure: result_rec mypkg.mytype; OPEN CUR1 FOR select col1, col2, col3 from table1 where something = 'a'; --rows will always be 50 LOOP FETCH CUR1 INTO myrectype; EXIT WHEN CUR1%NOTFOUND; result_rec.col1 := myrectype.col1; resu...

VS.NET 2008 Dataset TableAdapter wizard connecting to Oracle -- any way to control the DataType for columns it creates?

Quick summary: When using the TableAdapter Configuration Wizard for typed datasets, the wizard does some implicit mapping from Oracle datatypes to .NET datatypes. Does anyone know how I can access & modify that mapping logic? In more detail: I often create strongly-typed datasets against an Oracle database (using either the "Oracle Dat...

Will CLOB data be truncated when displayed in a SELECT query? If so, how can it be displayed?

Hi folks, I've got a Varchar2 field in my table which I want to convert to a CLOB. I am unsure whether the data would get truncated when selected. If so, what is the limit and does it depend on the database settings? In my TOAD or SQLPLUS window it gets truncated but this may just be the environment settings. I'm not sure whether it wo...

how to read data blocks and store them in database?

Hi there I have problem in reading a data block in oracle form builder. I have one data block that some of their fields are come from database but there is 2 (columns)field that i need to read them manually and store them on the database(we have several row!),please help me how I can read each line and insert them on database. I use ora...

Oracle explain plan estimates incorrect cardinality for an index range scan

I have an Oracle 10.2.0.3 database, and a query like this: select count(a.id) from LARGE_PARTITIONED_TABLE a join SMALL_NONPARTITIONED_TABLE b on a.key1 = b.key1 and a.key2 = b.key2 where b.id = 1000 Table LARGE_PARTITIONED_TABLE (a) has about 5 million rows, and is partitioned by a column not present in the query. Table SMALL_NONPAR...

Why do we have to make a SELECT after an 'INSERT ALL'?

As I seen on many sites, if I want to make an INSERT ALL, I have to finish it with a SELECT (Like SELECT * FROM dual;) Why? ...

Choose which oci.dll use with qsqloci plugin

I'd like to be able to choose which oci.dll the Qt plugin is using, the Qt documentation states: When you run your application you will also need to add the oci.dll path to your PATH environment variable: set PATH=%PATH%;c:\oracle\bin Is there another way than changing the PATH? ...

Unicode sql query in cx_Oracle

i have the following: ora_wet = oracle_connection() cursor = ora_wet.cursor() sqlQuery = u"SELECT * FROM web_cities WHERE cty_name = 'София'" cursor.execute(sqlQuery) sqlResult = cursor.fetchone() When I do this I get a TypeError: expecting None or a string on line 18 which is the cursor.execute(sqlQuery) If I make the query non-uni...

SQL: not exist with openquery not working as expected

Hi, I do have an oracle 8 database from which I want to fetch data to SQL Server 2005. The following statement works fine, if the table on SQL Server 2005 is empty. If I run with let's say one entry missing, it does not work. Please let me know, if any additional information would be usefull! SELECT wdmsoracle.NO FROM (Select * from OP...

Oracle schema table name restrictions

Hi I am looking into using JBoss 5.1.0GA on Oracle, and have seen this, warning that I should explicitly state the name of the schema into which the TIMERS table should be created, as Oracle doesn't permit the same table name to be used twice, even across schemas. After reading this, I saw this question on StackOverflow, and would like...

Execution Cost vs execution time in Oracle

I have a report query that joins 19 tables in DW. I know our DW schema design is not good. This query is running every night and gathering yesterday's activity. Our system went live in 06/2008, so the data volume for 1 day is a small portion compared to the entire data volume. The query execution time was generally 5~10 minutes and the ...

How do I create an instance of Oracle.DataAccess.Client.OracleException to use with NMock

I'm using the Oracle.DataAccess.Client data provider client. I am having trouble constructing a new instance of an OracleException object, but it keeps telling me that there are no public constructors. I saw other having the same problem and tried their solutions, but they don't seem to work. Here's my test code: object[] args = { 1, "T...

Oracle vs SQL Server for a .NET project

I know that Oracle is a generally good database engine but I think it is too difficult in deployment for a .NET projects comparing with native Microsoft SQL server solutions. (I needed to install both x32- and x64-bit client components and configure TNS names for both of them, plus install Distributed Transactions support for Oracle. No...

Apache not loading PHP oracle dll

on win 64, I installed apache, php etc. Everything works fine, except the oracle part. I can connect to oracle from sql developer which means my tnsnames.ora file is correct. When apache starts, there are no errors in the logs. But when I try to connect to oracle from my database, oracle module php_oci8.dll is not loaded. What am I ...

Regarding sql query

I have the below sql query to insert the records from a table. The problem is when there is no records for select query i still want an record with the sequence number,null,'3' value inserted. Nothing get's inserted when there is no record found for select query. how can i do it? insert into test_details(seqnbr,trepid,type) select '&se...

Regarding sql substitution

Hi, When i ran the below queries it's failing in the second query becuase prev_test_ref1 variable is not defined. If i remove the insert statement in the first query ,run again then it's working and using the prev_test_ref1 value from the first sql query in second query. Is it because of variable scope? How can i resolve this with...

Resource DATASOURCE rolled back in cleanup of LocalTransactionContainment

Im working in a WebSphere Application Server 7, JDK 1.6 and Oracle 11g. Im always receiving this error when using an ejb. [7/1/10 17:12:28:770 BOT] 00000013 LocalTranCoor W WLTC0033W: Resource jdbc/oraDS11 rolled back in cleanup of LocalTransactionContainment. [7/1/10 17:12:28:773 BOT] 00000013 LocalTranCoor W WLTC0...

REgarding ETL TOOL Enquiry

I am completed MCA in 2009.I need to get a job in 2 to 3 months,Which ETL is good to me. Where i have to learn That ETL TOOl ...

How do update a date column by changing only the year and not the day or month using PLSQL?

I have a database table containing credit card records. One of the fields is a Date field. I would like to update this field by changing the year portion of the date to 2011 if the year is less than 2010. From what i have found, PLSQL has functions for time and months but nothing to do with years (to my knowledge). ...