oracle10g

NOT IN or NOT EXISTS which is faster in Oracle10g?

ぃ、小莉子 提交于 2019-12-08 04:52:41
问题 Can someone explain the difference between IN and EXISTS and NOT IN and NOT EXISTS . Because I have read that EXISTS will work better than IN and NOT EXISTS will work better than NOT IN . The query i created is follows.. delete from tt_left t where t.val = 0 and t.text in (select t1.text from tt_left t1 where t.text = t1.text and t.resulttext = t1.resulttext and t.val = 0 and t1.val = 1); How to convert this to EXISTS ? Is there any other better method? 回答1: The optimiser will treat IN and

Union causing an ORA-01790: expression must have same datatype as corresponding expression

ⅰ亾dé卋堺 提交于 2019-12-08 04:42:30
With the following query as an example: select p.product_id, p.product_name, product_type as product_type, from products group by p.product_id, p.product_name union select p.product_id, p.product_name, cast(collect(coalesce(product_type, decode(product_description,null,'DESCR' || '-' product_description) as my_type) as product_type, from products group by p.product_id, p.product_name The select statement in the first query returns product_type as a varchar and on the second query product_type is of type my_type. This is causing and ORA-01790: expression must have same datatype as corresponding

Oracle 10g PL/SQL- Select results as update column values

。_饼干妹妹 提交于 2019-12-08 04:40:28
Is there a way to easily/elegantly update multiple columns in a table with record values from a query in Oracle 10g? I have a table (call it Source) which has for simplicities sake, 2 columns, ID and KEY . ID Key ---- ---- 1 1000 2 1000 3 5000 4 1000 .. 101 8000 102 9000 103 7000 104 9000 ... 201 5 202 5 ... I have another table (call it KeyMap ) that takes trunc(ID/100) and uses it as a batchID with the columns being a key map for the IDs within the batch: trunc(ID/100) key1 key2 key3 key4 ..... key99 ------------- ---- ---- ---- ---- 0 1000 1000 5000 1000 1 8000 9000 7000 9000 2 5 5 The ID's

Apache Drill 1.2 and Oracle JDBC

混江龙づ霸主 提交于 2019-12-08 03:44:25
Using Apache Drill v1.2 and Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit in embedded mode. I'm curious if anyone has had any success connecting Apache Drill to an Oracle DB. I've updated the drill-override.conf with the following configurations (per documents): drill.exec: { cluster-id: "drillbits1", zk.connect: "localhost:2181", drill.exec.sys.store.provider.local.path = "/mypath" } and placed the ojdbc6.jar in \apache-drill-1.2.0\jars\3rdparty . I can successfully create the storage plug-in: { "type": "jdbc", "driver": "oracle.jdbc.driver.OracleDriver", "url": "jdbc

Oracle 10g PL/SQL- Select results as update column values

匆匆过客 提交于 2019-12-08 03:40:13
问题 Is there a way to easily/elegantly update multiple columns in a table with record values from a query in Oracle 10g? I have a table (call it Source) which has for simplicities sake, 2 columns, ID and KEY . ID Key ---- ---- 1 1000 2 1000 3 5000 4 1000 .. 101 8000 102 9000 103 7000 104 9000 ... 201 5 202 5 ... I have another table (call it KeyMap ) that takes trunc(ID/100) and uses it as a batchID with the columns being a key map for the IDs within the batch: trunc(ID/100) key1 key2 key3 key4 .

exporting db objects for version control

久未见 提交于 2019-12-08 03:40:09
问题 We are implementing version control for our project. As part of this we need to check in all DB objects. We have tables, procedures, functions, packages, view and materialized view. Problem is there are many objects and we need to put source code file wise. e.g. There are tables T1, T2, T3 and we need files Table_T1.txt which will have T1 definition ( columns definition, indexes for the table and grants) and so on for all objects. I m aware of metadata tables such as DBA_VIEWS , dba_source

can we call procedure inside a function in PL/SQL?

可紊 提交于 2019-12-08 03:00:25
问题 we can call the function inside the procedure , but is it possible to call procedure inside the function ? I tried but I can't call procedure inside the function. could you tell me why we can not call the procedure inside the function? 回答1: " I tried but I can't call procedure inside the function." How did you try? What did you try? In what way did you fail? Because it is permitted to call procedure inside the function. So if it isn't working for you, then the cause is something wrong in your

increasing the page width in oracle reports builder

老子叫甜甜 提交于 2019-12-08 01:14:40
问题 I am designing a new report using oracle reports builder that comes with 10g. I have many columns to be inserted horizontally. But I couldn't increase the page width of the body section beyond 8.5 inches. But I can see the page width of some existing reports to be more than 16 inches. How do I increase the page width?. I have been googling for an hour but couldn't find anything useful. I have tried tinkering with the settings at, File->Page Size Tools->Options->Margin Edit->Preferences but no

Any Quicker Option Than Oracle Database Union

眉间皱痕 提交于 2019-12-08 00:25:40
问题 I have a table that has multiple columns which store a text value. For example: ID FATHER_NAME MOTHER_NAME -------------------------------- 1 Henry Sarah 2 Martin Rebecca 3 Martin Nancy I want to get all of the names in the table. I know I can do a union to do this: (SELECT FATHER_NAME FROM MY_TABLE) UNION (SELECT MOTHER_NAME FROM MY_TABLE) However, in my real table there are 15 columns I need to union and the query is obviously taking awhile (approximately 12 seconds). And I still need to do

How Do You Insert Large Blobs Into Oracle 10G Using System.Data.OracleClient?

馋奶兔 提交于 2019-12-08 00:08:29
问题 Trying to insert 315K Gif files into an Oracle 10g database. Everytime I get this error "ora-01460: unimplemented or unreasonable conversion requested" whe I run the stored procedure. It appears that there is a 32K limit if I use a stored procedure. I read online that this does not apply if you are doing a direct insert, but I do not know how to create the insert string for a Byte Array. This is a thick client running on the server so not worried about SQL Injection attacks. Any help would be