oracle11g

Oracle Error “inconsistent datatypes: expected CHAR got LONG”

感情迁移 提交于 2019-12-23 15:23:10
问题 I'm trying to run the following query to find views containing a given keyword: select * from ALL_VIEWS where OWNER = 'SALESDBA' and TEXT like '%rownum%'; I'm getting the following error message: ORA-00932: inconsistent datatypes: expected CHAR got LONG 00932. 00000 - "inconsistent datatypes: expected %s got %s" *Cause: *Action: Error at Line: 4 Column: 13 if I just select from ALL_VIEWS than I see the query (TEXT) in the TEXT field. What am I doing wrong here? 回答1: Your problem is that TEXT

Race condition between select and update

一曲冷凌霜 提交于 2019-12-23 13:05:24
问题 I need to update a row in an Oracle database in a way that I don't silently clobber the changes from another client in my web based application. In my current system I perform the following: SELECT * FROM table WHERE id=:ID AND lastmodified=:LASTMOD if the row still exists with the same last modified date when we started we know nobody has changed it so we can update using the last modified time. However when doing this manually using two sessions I noticed if two clients select at roughly

Good Oracle database development and management tool on Windows [closed]

匆匆过客 提交于 2019-12-23 13:01:11
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm looking for an Oracle database management tool like sql server management studio. I've searched the internet and found a lot of tools on the following link: http://www.freedownloadscenter.com/Search/oracle.html. But I don't know which one is better. I need a stable and easy-to-use GUI tool for working on

shrink permanent tablespace in oracle 11g

送分小仙女□ 提交于 2019-12-23 12:23:43
问题 I need to shrink a tablespace in oracle 11g. It is not a temporary table-space, I cant lose the data in that tablespace. One of my other tablespaces is out of space so I have to reallocate the remaining size of this tablespace. shrink does not work on a permanent tablespace. The current size of the datafile is 1150MB and I want it to be 256MB 回答1: You can resize the file, thus:- ALTER DATABASE DATAFILE '/your/path/your_file01.dbf' RESIZE 256M; of course if you already used some space above

Getting values relating to the max and min rows in Oracle

我们两清 提交于 2019-12-23 12:08:47
问题 In Oracle 11g we need to be able to query a table to pull out information from rows with the highest and lowest values in a certain group. For example using the EMP table we'd like to find the name of person with the highest salary and the name of the person with the lowest salary in each department DEPTNO MAX_SAL MAX_EARNER MIN_SAL MIN_EARNER ------------------------------------------------------- 10 5000 KING 1300 MILLER 20 3000 FORD 2975 JONES etc (if there are two or more staff with the

Oracle procedure works only when set serveroutput on;

痴心易碎 提交于 2019-12-23 12:08:09
问题 Strange behavior trying to insert a record with a stored procedure. Only works with set serveroutput on : Thanks. SQL*Plus: Release 11.2.0.1.0 Production on Tue May 31 22:48:25 2016 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> exec abc_utils.abc_init(p

MyBatis - jdbcTypeForNull Oracle

好久不见. 提交于 2019-12-23 11:54:55
问题 I am using MyBatis with an Oracle 11g R2 database. I am using MyBatis 3.3 with ojdbc6 12.1.0.2. My issue is whenever I tried to insert an object that is null I get the following. org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #8 with JdbcType OTHER . Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: java.sql.SQLException: Invalid column type: 1111 My understanding is in the latest version of

NO_DATA_FOUND exception not thrown when used in SELECT INTO

自古美人都是妖i 提交于 2019-12-23 10:06:45
问题 I noticed strange behaviour of NO_DATA_FOUND exception when thrown from function used in PLSQL. Long story short - it does propagate from function when using assignment, and does not propagate (or is handled silently somewhere in between) when used in SELECT INTO . So, given function test_me throwing NO_DATA_FOUND exception, when invoked as: v_x := test_me(p_pk); It throws an exception, while when invoked as: SELECT test_me(p_pk) INTO v_x FROM dual; it does not throw exception. This does not

Use function as default value for column in Oracle11g

梦想的初衷 提交于 2019-12-23 09:47:41
问题 We are testing out Oracle at my work and im in charge of building all of the database objects (tables, procs, trigger, etc) on Oracle, and we currently use Microsoft SQL Server 2008 R2. We use uniqueidentifier's for almost all of our ID column's. I used this function to create GUID's: CREATE OR REPLACE FUNCTION NEWID RETURN CHAR IS guid CHAR(36) ; BEGIN SELECT SYS_GUID() INTO guid FROM DUAL; guid := SUBSTR(guid, 1, 8) || '-' || SUBSTR(guid, 9, 4) || '-' || SUBSTR(guid, 13, 4) || '-' || SUBSTR

Oracle 11g CREATE VIEW using CONNECT BY and multiple tables

最后都变了- 提交于 2019-12-23 09:41:35
问题 Using Oracle 11G (not R2) database, we need to create reports that show which Leadership Committe an individual's reporting structure belongs to. At a high level, we determine an individual's presence on the board by locating the employee ID in table board_members. The board_members table has a position ID that can be used to access board_positions, and from there we can determine if the position is on the leadership committee. (Samples below.) For any employee who is on the leadership