oracle10g

Oracle query that will list of the database objects referenced by a view

半城伤御伤魂 提交于 2019-12-17 21:23:26
问题 Is there an Oracle view that will list all of the database objects referenced by the DDL of a given view, procedure, or function? So if a view is defined as: CREATE OR REPLACE VIEW_B AS SELECT * FROM TABLE_A INNER JOIN VIEW_A running a query on this system view: SELECT REF_OBJECT_NAME, REF_OBJECT_TYPE FROM V$XXX WHERE OBJECT_NAME='VIEW_B' would list something like: REF_OBJECT_NAME REF_OBJECT_TYPE TABLE_A TABLE VIEW_A VIEW 回答1: Try: select * from dba_dependencies where owner = 'view owner' and

Determine the size of a SQL result set in KB

ぐ巨炮叔叔 提交于 2019-12-17 20:51:41
问题 I am hoping to find how I can get the kb size of a result set in OracleDB. I am not an sysadmin, but often run queries that return over 100k rows and I would need to find a way to determine what is the total kb size. thank you 回答1: In SQL*Plus: SET AUTOTRACE ON SELECT * FROM emp WHERE rownum <= 100; 27 recursive calls 0 db block gets 19 consistent gets 4 physical reads 0 redo size **11451 bytes sent via SQL*Net to client** 314 bytes received via SQL*Net from client 8 SQL*Net roundtrips to

Mutating Table in Oracle 11 caused by a function

落爺英雄遲暮 提交于 2019-12-17 20:45:34
问题 We've recently upgraded from Oracle 10 to Oracle 11.2. After upgrading, I started seeing a mutating table error caused by a function rather than a trigger (which I've never come across before). It's old code that worked in prior versions of Oracle. Here's a scenario that will cause the error: create table mutate ( x NUMBER, y NUMBER ); insert into mutate (x, y) values (1,2); insert into mutate (x, y) values (3,4); I've created two rows. Now, I'll double my rows by calling this statement:

Underscore is not working in oracle like clause

£可爱£侵袭症+ 提交于 2019-12-17 19:33:15
问题 When development, I used 'test_1%' to find 'test_123' in like. But in production environment its not working. Using 'escape '\'' is working. is there any setting needs to set in oracle? I want to use without escape '\''. 回答1: try this in SQL Developer: SELECT * FROM TABLE1 WHERE NAME LIKE 'test\_1%' escape '\' in sql plus: set escape '\' SELECT * FROM TABLE1 WHERE NAME LIKE 'test\_1%'; 回答2: In Oracle, you can also use ESCAPE like this: SELECT * FROM name_of_table WHERE description LIKE

How to identify invalid (corrupted) values stored in Oracle DATE columns

此生再无相见时 提交于 2019-12-17 19:18:57
问题 Oracle 10.2.0.5 What is the easiest way to identify rows in a table that have "invalid" values in DATE columns. By "invalid" here what I mean is a binary representation that violates Oracle rules for date values. I recently had an issue with an invalid date stored in a column. I was able to use a query predicate to find a particular problematic row: WHERE TO_CHAR(date_expr,'YYYYMMDDHH24MISS') = '00000000000000' In the case I had, the century byte was invalid... select dump(h.bid_close_date)

Fully Understanding PDO ATTR_PERSISTENT

99封情书 提交于 2019-12-17 18:05:31
问题 Question: What are the rules/logic behind persistent connection management when using PDO? Environment: Web Server Windows 7 x64 Dual-core with 16GB RAM Apache 2.2.17 PHP 5.3.5 Connecting through DSN string with IP address, port, service name, etc... No ODBC for DB conn (been trying to create one for 2 hours now, thanks Oracle!) DB Server Oracle 10g on Linux Multi-core with 4GB RAM Username specifically created for my web app (yes, it's fake) user: webuser My understanding/observations: Non

How to execute an oracle stored procedure?

故事扮演 提交于 2019-12-17 17:59:41
问题 I am using oracle 10g express edition. It has a nice ui for db developers. But i am facing some problems executing stored procedures. Procedure: create or replace procedure temp_proc is begin DBMS_OUTPUT.PUT_LINE('Test'); end it is created successfully. But when i execute: execute temp_proc; it shows ORA-00900: invalid SQL statement So help needed here 回答1: Execute is sql*plus syntax .. try wrapping your call in begin .. end like this: begin temp_proc; end; (Although Jeffrey says this doesn't

Why non-greedy quantifier sometimes doesn't work in Oracle regex?

白昼怎懂夜的黑 提交于 2019-12-17 16:37:26
问题 IMO, this query should return A=1,B=2, SELECT regexp_substr('A=1,B=2,C=3,', '.*B=.*?,') as A_and_B FROM dual But it returns whole string A=1,B=2,C=3, instead. Why? UPD: Oracle 10.2+ required to use Perl-style metacharacters in regular expressions. UPD2: More clear form of my question (to avoid questions about Oracle version and availability of Perl-style regex extension): Why ON THE SAME SYSTEM non-greedy quantifier sometimes works as expected and sometimes doesn't? This works correctly:

difference before and after trigger in oracle

旧巷老猫 提交于 2019-12-17 16:07:03
问题 Can somebody explain difference between "before" and "after" trigger in oracle 10g with an example ? 回答1: First, I'll start my answer by defining trigger : a trigger is an stored procedure that is run when a row is added, modified or deleted. Triggers can run BEFORE the action is taken or AFTER the action is taken. BEFORE triggers are usually used when validation needs to take place before accepting the change. They run before any change is made to the database. Let's say you run a database

Split column to multiple rows

a 夏天 提交于 2019-12-17 13:23:45
问题 I have table with a column that contains multiple values separated by comma (,) and would like to split it so I get earch Site on its own row but with the same Number in front. So my select would from this input table Sitetable Number Site 952240 2-78,2-89 952423 2-78,2-83,8-34 Create this output Number Site 952240 2-78 952240 2-89 952423 2-78 952423 2-83 952423 8-34 I found something that I thought would work but nope.. select Number, substr( Site, instr(','||Site,',',1,seq), instr(','||Site