oracle11g

Reference parent query column in subquery (Oracle)

て烟熏妆下的殇ゞ 提交于 2019-12-10 13:18:46
问题 How can I reference a column outside of a subquery using Oracle? I specifically need to use it in the WHERE statement of the subquery. Basically I have this: SELECT Item.ItemNo, Item.Group FROM Item LEFT OUTER JOIN (SELECT Attribute.Group, COUNT(1) CT FROM Attribute WHERE Attribute.ItemNo=12345) A ON A.Group = Item.Group WHERE Item.ItemNo=12345 I'd like to change WHERE Attribute.ItemNo=12345 to WHERE Attribute.ItemNo=Item.ItemNo in the subquery, but I can't figure out if this is possible. I

How can I add leading zeros to dates in Oracle?

二次信任 提交于 2019-12-10 12:42:16
问题 I need to add leading zeros to a number if it is less than two digits and combine two such numbers into single one without space between them. My Attempt: select ( extract (year from t.Dt) || to_char(extract (month from t.Dt),'09') || to_char(extract (day from t.Dt),'09') ) as dayid from ATM_FACTS t; Result: So, my problem is how can I remove the space in between month-year and month-day. I used select ( extract (year from t.Dt) || to_number(to_char(extract (month from t.Dt),'09')) || to

Oracle using REGEXP to validate a date field

浪尽此生 提交于 2019-12-10 12:25:33
问题 I am using Oracle 11G and I have a date column (Var char 2) where dates are manually entered into the database and unfortunately many times have invalid dates entered. I would like to only select date field that are valid using some sort of REGEXP LIKE statement. Here are the possible valid formats that I would like to select. DATE JULY 31, 2009 7/31/2009 31-JUL-09 Anything that's not in these 3 possible formats I do not want to select. Could someone please help me come up with a REGEXP or

Is it possible to disable jpa hints per particular query?

倖福魔咒の 提交于 2019-12-10 12:21:47
问题 JPA, and in my particular case eclipselink, generates /*+ FIRST_ROWS */ in case of using query.setFirstResult()/query.setMaxResults() : SELECT * FROM ( SELECT /*+ FIRST_ROWS */ a.*, ROWNUM rnum FROM ( SELECT * FROM TABLES INCLUDING JOINS, ORDERING, etc.) a WHERE ROWNUM <= 10 ) WHERE rnum > 0; That forces Oracle to use nested loops instead of hash-joins. In general is has seance, but in my particular case it dramatically decrease performance. Is it possible to disable hint usage/generation for

Build an XML with XMLELEMENT - ORACLE SQL 11g query

白昼怎懂夜的黑 提交于 2019-12-10 12:18:01
问题 I'm trying to create the following XML using a SQL query (Oracle): <Changes> <Description>Some static test</Description> <Notes>Some static test</Notes> <UserChange> <Operation>Static Text</Operation> <User>VALUE from Table - record #1</User> <BusinessSource>VALUE from Table #1</BusinessSource> <ApplicationRole>VALUE from Table #1</ApplicationRole> </UserChange> <UserChange> <Operation>Static Text</Operation> <User>VALUE from Table - record #2</User> <BusinessSource>VALUE from Table #2<

Oracle performance Tuning

半世苍凉 提交于 2019-12-10 12:15:55
问题 I have below oracle query. It is taking very long time to run. Can you please suggest some performance tuning for this query. select ss.registration_id as REGISTRATION_ID, ss.batch_id as BATCH_ID from submtd_srvc PARTITION(SUBMTD_SRVC_821370) ss, (select a.exceptn_criteria_val, a.exceptn_criteria_rtrn_val from EXCEPTN_CRITERIA a, EXCEPTN_EXPRESSION b where a.EXCEPTN_EXPRESSION_ID = b.EXCEPTN_EXPRESSION_ID and b.EXCEPTN_EXPRESSION_NAME = 'NC_CUSTOM_REV_CAT' and b.IS_CURRENT_INDCTR = 1 and a.IS

Display record even if it doesn't exist

时光毁灭记忆、已成空白 提交于 2019-12-10 12:15:49
问题 So I have this table Col1 Col2 Col3 A 34 X B 43 L A 36 L Now if I query select * from Table1 where col1 in ('A','B','C') I am expecting something like Col1 Col2 Col3 A 34 X B 43 L A 36 L C - - Is it possible ? P.S: the - in row C are just to show that the column is empty. 回答1: You could create a nested table schema object type: create type T_List1 as table of varchar2(100); And then construct your query as follows: select s.column_value as col1 , nvl(to_char(t.col2), '-') as col2 , nvl(col3,

STRAGG in Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

前提是你 提交于 2019-12-10 12:14:23
问题 I want to use STRAGG function in this env.: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production, PL/SQL Release 11.2.0.4.0 - Production, CORE 11.2.0.4.0 Production, TNS for Linux: Version 11.2.0.4.0 - Production, NLSRTL Version 11.2.0.4.0 - Production: I have a view called V_USER_ROLE_DESC LOGIN DESC joanet BS in ANDROID.C.3 joanet DOB in ANDROID.C.3 joanet DO in ANDROID.C.3 joanet BS in ANDROID.C.4 joanet UA in ANDROID.C.4 joanet OV in ANDROID.C.4 joanet OI in

SQL Developer 4.0.2 install on Windows 7 64 bit

一笑奈何 提交于 2019-12-10 12:09:14
问题 I made a few of them on the computer I got the same error. could not figure out this question. sql developer normally opens but then the image begins to fade. not clicked on anything. system is unwieldy. buttons as the picture opens. The two buttons at the same time seems to be open 回答1: thanks you very much... SQL Developer 4.0.2 install on Windows 7 64 bit screen solution 来源: https://stackoverflow.com/questions/24553391/sql-developer-4-0-2-install-on-windows-7-64-bit

how to send SMS via oracle 11g? client is toad and in India I have to send sms [closed]

天大地大妈咪最大 提交于 2019-12-10 12:05:49
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . I want to create procedure to send SMS to the Indian mobile user via oracle11g database. I have searched alot but can't find a neat procedure 回答1: Sending e-mails from Oracle database is one thing but sending SMS from the database is a whole lot of other things. You will need the