oracle11g

SQL REGEXP_SUBSTR returns null String when splitting

邮差的信 提交于 2019-12-24 17:27:32
问题 I followed the instructions outlined in this post to split a delimited string into rows of a table: Splitting string into multiple rows in Oracle The answer that worked for that particular delimited string is represented in this fiddle: Demo1 with temp as ( select 108 Name, 'test' Project, 'Err1, Err2, Err3' Error from dual union all select 109, 'test2', 'Err1' from dual ) select distinct t.name, t.project, trim(regexp_substr(t.error, '[^,]+', 1, levels.column_value)) as error from temp t,

Hibernate Oracle INTERVAL EXPRESSION and Oracle 11g Dialect

随声附和 提交于 2019-12-24 17:24:49
问题 I need to use a INTERVAL EXPRESSION for a calculated field. like below: @Formula(" SYSDATE - INTERVAL '1' HOUR * SHOW_LIMIT_HOURS ") private Date showLimitDate; However, hibernate produces the following SQL fragment considering this expression like a column. and product0_.sold_at > ( SYSDATE - settings0_.INTERVAL '1' settings0_.HOUR * setting0_.SHOW_LIMIT_HOURS ) Anybody could help me ? 回答1: After 2 days suffering, analysing AST processing of hibernate source code i finally gave up !! =P ..

Convert multiple date varchar2 to date format in Oracle 11g

天涯浪子 提交于 2019-12-24 16:47:59
问题 I am having an issue trying to convert multiple dates to one defined format. We are receiving the multiple dates from another DB source so I do not have control of the formatting until it reaches ours. Here are all the formats: YYYYMMDD YYYY-MM-DD HH:MM:SS MM/DD/YYYY MM-DD-YYYY Abrieviated Day Month DD HH:MM:SS TimeZone YYYY ('Thu Feb 02 20:49:59 MSK 2012') Fully written Day, Month DD, YYYY HH:MM:SS AM/PM My requirement is to set them all to the standard MM/DD/YYYY format or null. Any ideas?

Oracle 11g: INSERT SELECT with WITH statement

怎甘沉沦 提交于 2019-12-24 16:00:07
问题 I've written this simple example DML with WITH statement: WITH seq AS (SELECT to_char(LEVEL - 1) p FROM dual CONNECT BY LEVEL <= 10) SELECT old_value, new_value FROM (SELECT to_char(t1.p) old_value, to_char(t2.p) new_value FROM (SELECT row_number() over(ORDER BY p) rn, p FROM seq) t1, (SELECT row_number() over(ORDER BY dbms_random.random) rn, p FROM seq) t2 WHERE t1.rn = t2.rn); Is there any way to use WITH statement in INSERT statement? FIDDLE 回答1: as mentioned here : https://forums.oracle

Element repeated at least 3 times

不羁的心 提交于 2019-12-24 15:27:50
问题 Is there a way to tell if an element is at least 3 times in a column without using Count and Group By? EDIT: The answer is expected in SQL (mysql or oracle11g) in which only SELECT, FROM, WHERE and JOINS are used . And of course, all the logical operators and quantifiers as RELATIONAL CALCULUS WITH TUPLES has NO tools at all. Example of tuples: { t : {name} | ∃ s : {name, wage} ( Employee(s) ∧ s.wage = 50.000 ∧ t.name = s.name ) } here, the limitations of Relational Calculus with tuples are

Oracle 11g Reports and Forms Properties Mass updates

纵饮孤独 提交于 2019-12-24 14:53:13
问题 Brand new to dealing with Oracle Reports and Forms so forgive any terminology/syntax issues. Given new assignment to help another developer put new systems into place. New Systems are essentially COPIES of existing systems. The process that I've seen involves a LOT of by hand updates of FORM properties (Names and Report Group Sources) and Same is true for REPORTS. FRM and RDF files. This is all done "by hand", open/change/save/next. (Don't ask, it's one of those "we've always done this" and

Pivot in Oracle 11g

我怕爱的太早我们不能终老 提交于 2019-12-24 14:28:09
问题 I have searched Stackoverflow about pivot in Oracle 11g but could not find the syntax that works for my situation. Below is my query (runs in Oracle 11g). select age, gender, sum(hours) as hours from table1 group by age, gender Here is the O/P result age gender hours 25 Male 10 55 Female 5 45 Female 12 ...And here is my desired O/P result Age Male Female 25 10 0 45 0 12 55 0 5 ...And here is my query select * from ( select age, gender, sum(hours) as hours from table1 ) pivot ( sum (hours) for

ora:12505:TNS: listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach)

浪尽此生 提交于 2019-12-24 13:33:26
问题 Agent Connection to Instance Status Failed Details ORA-12505: TNS:listener does not currently know of SID given in connect descriptor (DBD ERROR: OCIServerAttach) Listener file listener.ora Network Configuration File: E:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = 169.254.52.209)(PORT = 1521)) ) ) ADR