oracle10g

sql conditional join

故事扮演 提交于 2019-12-11 13:57:22
问题 I have 3 tables: table1:table1_col1, table1_col2,table1_col3 table2 : table1_col1, table2_col2,table2_col3 table3 : table1_col1, table3_col2,table3_col3 As I tried to explain by the naming, table1:table1_col1 is a unique key that can reference either table2 : table1_col1 or table3 : table1_col1 but never both. I need to make a join between table1, table2,table3 such that: join table1 with table2 if table1:table1_col1 = table2 : table1_col1 join table1 with table3 if table1:table1_col1 =

Error when I run my C# program that work's with Oracle

痞子三分冷 提交于 2019-12-11 13:45:06
问题 I Made Setup from my C# program (that work's with Oracle 10g) when I try to run this program - in different Computer, i got this error message: unable to load dll 'OraOps10.dll' what it can be ? thank's in advance 回答1: If you're using the Oracle ODP ( Oracle.DataAccess.Client ) and not the default Microsoft ODP ( System.Data.OracleClient ) then you have to download install the Oracle Data Access Compontents before you can use it. So installing the ODAC must be the part of your deployment

How can I make a copy of a table with a PK?

百般思念 提交于 2019-12-11 13:37:28
问题 In an Oracle 10g database, I would like to make a copy of an existing table. I would like it to have the same data and rows as the original table. The original table uses a PK though, so I'm not sure how to copy it and keep them unique. 回答1: You can make the copy using CREATE TABLE dummy_copy as SELECT * FROM dummy//Structure and data Also you could use dbms_metadata.get_ddl to get the associated constraints of the table and create it with all the checks SELECT dbms_metadata.get_ddl( 'TABLE',

Nested cursor in a cursor

故事扮演 提交于 2019-12-11 12:43:53
问题 I have a cursor which is CURSOR B_CUR IS select DISTINCT big_id from TEMP_TABLE; This would return multiple values. Earlier it was being used as FOR b_id IN B_CUR LOOP select s.col1, s.col2 INTO var1, var2 from sometable s where s.col3 = b_id.col1; END LOOP; Earlier it was certain that the inner select query would always return 1 row. Now this query can return multiple rows. How can I change this logic? I was thinking to create a nested cursor which will fetch into an array of record type

Full Join on Group

我怕爱的太早我们不能终老 提交于 2019-12-11 12:17:47
问题 I'm facing a logic issue with my Query. I have two tables Table1 and Table2 , where Table1 consists of: value to be summed Id to be grouped by Code holds foreign-key to Table2 And Table2 consists of Code Des the text description of code What I'm trying to do is, group by Table1.Id , full join on Table2.Code , but, for each resulting group, I want to show all the rows from Table2 for each group generated by the query. Sample code: SELECT Table2.Code, Table1.Id, Table2.DES, SUM(Table1.Value) AS

How to solve ORA-04063: view “SYS.ALL_QUEUE_TABLES” has errors?

冷暖自知 提交于 2019-12-11 12:14:48
问题 Jdev version 11.1.1.7.1 I am using Oracle Database 10g XE & I am able to connect to the DB and retrieve all tables in HR schema. But when I am trying to create "Business components from Table" I am getting the above mentioned error. I have uninstalled Jdeveloper and once again reinstalled it. Still I am getting the same error. Here is the description of the error :- The following SQL statement failed : SELECT /*OracleDictionaryQueries.ALL_ORACLE_OBJECT_QUERY(3)*/ O.OBJECT_NAME, O.OBJECT_TYPE,

Public Synonyms vs. schema.object pattern

回眸只為那壹抹淺笑 提交于 2019-12-11 11:36:59
问题 In my application there are going to be lots of users, over 500. They only deal with one schema objects. I've granted the necessary privileges. When I say: SELECT * FROM EMP; I get the "table or view does not exists" error, so it means: I either need to specify the owner name before the objects. like SCOTT.EMP , or I can create public synonyms for all the objects that I'll be refering to. My concern is, if public synonyms can have impact on the performance with this many users with an

can oci driver for 11g (odbc5.jar) work with 10g client?

我的未来我决定 提交于 2019-12-11 11:36:49
问题 I need to connect to Oracle9,10 and 11 in my java application.The client will always be present where the app will be run and I want the app to just work with username,password and instance (specified in tnsnames.ora).Hence I would like oci drivers with a connection string of type : jdbc:oracle:oci:@testora .Im using the driver: oracle.jdbc.driver.OracleDriver. I have a 10g client and am using jdk1.5. When I use the ojdbc14 jar from client lib path the app runs. But if I use the ojdbc5 driver

Oracle Stored Procedure

℡╲_俬逩灬. 提交于 2019-12-11 11:34:56
问题 I want to run the stored procedure script, but I am facing the problem that, when I run multiple stored procedures at one time, all procedures gets compiled but it does not create all those procedures separately, it compile it as a single procedure. Can anyone help me out to solve this prolem. 回答1: A script to create multiple procedures should look like this: create or replace procedure proc1 (param1 varchar2) is begin null; end; / create or replace procedure proc2 (param1 varchar2) is begin

How to get details for rows that do not exists in the table ? Caught up with an strange situation

China☆狼群 提交于 2019-12-11 11:06:51
问题 I was caught up with an strange situation. Here it is, We have table with 2 million records where MSISDN is of type string ,unique and not null. I was requested to get details of 300 known MSISDN's and so the query used is, select * from table_name where msisdn in ('msisdn1','msisdn2',......'msisdn300') but unfortunately the above query returns only 200 count. How to find out those 100 that do no exists from 300 given in the query? I can use only select query due to limited privileges. Please