oracle10g

How to resolve ORA 00936 Missing Expression Error?

做~自己de王妃 提交于 2019-12-04 00:59:07
Select /*+USE_HASH( a b ) */ to_char(date, 'MM/DD/YYYY HH24:MI:SS') as LABEL, ltrim(rtrim(substr(oled, 9, 16))) as VALUE, from rrfh a, rrf b, where ltrim(rtrim(substr(oled, 1, 9))) = 'stata kish' and a.xyz = b.xyz The "from " (3rd line) part of the above query is giving me ORA-00936 Missing EXPRESSION error . Please Help me NOTE :: rrfh table contains no data. Remove the comma? select /*+USE_HASH( a b ) */ to_char(date, 'MM/DD/YYYY HH24:MI:SS') as LABEL, ltrim(rtrim(substr(oled, 9, 16))) as VALUE from rrfh a, rrf b where ltrim(rtrim(substr(oled, 1, 9))) = 'stata kish' and a.xyz = b.xyz Have a

Why do I have ORA-00904 even when the column is present?

青春壹個敷衍的年華 提交于 2019-12-03 23:33:32
I see an error while executing hibernate sql query. java.sql.SQLException: ORA-00904: "table_name"."column_name": invalid identifier When I open up the table in sqldeveloper, the column is present. The error is only happening in PROD, not in DEV. What should I check? It could be a case-sensitivity issue. Normally tables and columns are not case sensitive, but they will be if you use quotation marks. For example: create table bad_design("goodLuckSelectingThisColumn" number); Oracle will throw ORA-00904 if executing user does not have proper permissions on objects involved in the query. This

How to increase dbms_output buffer?

给你一囗甜甜゛ 提交于 2019-12-03 22:56:43
I tried to debug my dynamic query via dbms_output but seems like the query string is too long for dbms_output buffer. I got : ORA-06502: PL/SQL: numeric or value error: character string buffer too small ORA-06512: at "SYS.DBMS_OUTPUT", line 148 ORA-06512: at line 1 Any idea how to increase the buffer size ? You can Enable DBMS_OUTPUT and set the buffer size. The buffer size can be between 1 and 1,000,000. dbms_output.enable(buffer_size IN INTEGER DEFAULT 20000); exec dbms_output.enable(1000000); Check this EDIT As per the comment posted by Frank and Mat, you can also enable it with Null exec

How To find Exact string match within a String in Oracle

好久不见. 提交于 2019-12-03 21:40:49
I have an oracle table that has a column called system_access that has the following data: Read Only, Write, read only, Admin Read, Write, read only, Admin Admin, Read Only (no), read only(see mgr), Admin Based on the above sample data, I am unsure of my query to only retrieve records that match the exact words of "Read Only" and/or "read only" I do not need the records that have the "Read Only (no)" with space then bracket after it or before it or "read only(see mgr)" with no space and bracket after it or before it. So based on above sample data, I would only get back two rows only, i.e.:

Degraded performance of a query after adding Index

回眸只為那壹抹淺笑 提交于 2019-12-03 20:27:21
问题 I have a query which part of a SP which is executed fairly regularly, and the query took a while to execute, so I decided to have a look at it. I did an autotrace on the query, and this was the execution plan returned [ pasted in pastebin due to excessive size ] I added indexes on the tables which was undergoing full table access, and ran the query. The query performance was worse then before, despite the cost being significantly lower. Why is this so, can anyone shed a light on the same ?

Redhat 6.4 安装 Oracle10g 血泪史

久未见 提交于 2019-12-03 19:40:57
1.系统和软件,附下载地址 VMware Workstation 10 .7z [红帽企业Linux.6.4.服务器版].rhel-server-6.4-x86_64-dvd[ED2000.COM].iso 10201_database_linux_x86_64.cpio.gz 2.从0开始安装 安装虚拟机,在虚拟机里安装Redhat6.4,然后把oracle10g安装包复制到/tmp/oracle 切换到root用户,解压oracle安装包 gunzip 10201_database_linux_x86_64.cpio.gz cpio -idmv < 10201_database_linux_x86_64.cpio 出现database目录,该目录下有个runInstaller文件,这个就是安装文件,但是我们可不能像在windows中现在就双击执行它,我们还有很多前期工作要做... Redhat 6.4 安装 Oracle10g 有很多lib包要安装,之前就是卡在了这里,出现了各种问题,这个解决了,又出现了下一个,好不容易可以粗线oracle的安装界面了,安装过程中又出现了问题,安装好后,执行netca命令又出现了问题,啊哟,我的小心脏可受不了啊,打击死我了,连次饭的欲望都木有( ,请允悲,请让我吐槽下) 好了,回到正题 那么这些lib包我们从哪里下载和安装呢

Aggregate function over a given time interval

谁说我不能喝 提交于 2019-12-03 19:15:01
问题 My SQL is a bit rusty and I'm having quite a bit of difficulty with this problem. Suppose I have a table with a Timestamp column and a Number column. The goal is to return a result set containing the average value for some arbitrarily chosen regular interval. So, for example, if I had the following initial data, the resulting output with a 5 minute interval would be as follows: time value ------------------------------- ----- 06-JUN-12 12.40.00.000000000 PM 2 06-JUN-12 12.41.35.000000000 PM 3

SQL combine multiple identifiers to create a group id for duplicate records

放肆的年华 提交于 2019-12-03 17:33:47
I'm working on a problem in Oracle that I'm struggling to solve 'elegantly'. I have a data extract with three different identifiers: A, B, C Each identifier may appear in more than one row, and each row may have one or more of these three identifiers (i.e the column is populated or null). I want to be able to group all records that have any combination of either A, B or C in common and assign them the same group id. Extract table showing what the eventual groups should be: Rownum | A | B | C | End group 1 p NULL NULL 1 2 p r NULL 1 3 q NULL NULL 2 4 NULL r NULL 1 5 NULL NULL s 2 6 q NULL s 2

Types of Index in oracle?

好久不见. 提交于 2019-12-03 17:30:48
问题 What are the type of indexes in oracle? How to identify the index need to create? 回答1: Oracle Database provides several indexing schemes that provide complementary performance functionality. These are: B-tree indexes: the default and the most common B-tree cluster indexes: defined specifically for cluster Hash cluster indexes: defined specifically for a hash cluster Global and local indexes: relate to partitioned tables and indexes Reverse key indexes: most useful for Oracle Real Application

Deleting Duplicate Records in Oracle based on Maximum Date/Time

a 夏天 提交于 2019-12-03 17:27:01
i have the following sample data with duplicate information: ID Date Emp_ID Name Keep --------------------------------------------------------- 1 17/11/2010 13:45:22 101 AB * 2 17/11/2010 13:44:10 101 AB 3 17/11/2010 12:45:22 102 SF * 4 17/11/2010 12:44:10 102 SF 5 17/11/2010 11:45:22 103 RD * 6 17/11/2010 11:44:10 103 RD Based on the above data set, how can I remove the duplicate Emp IDs and only keep the Emp IDs that have the maximum date/time specified? So based on the above, I would only see IDs: 1, 3 and 5. Thanks. Something like: DELETE FROM the_table_with_no_name WHERE date_column !=