oracle11g

ORA-12571: TNS:packet writer failure with ASP.NET

旧城冷巷雨未停 提交于 2019-12-04 03:29:59
My development team is experiencing numerous ORA-12571: TNS:packet writer failure errors using ASP.NET 3.5 and 4.0 against Oracle 11g. These errors are inconsistent as to when they occur, and are generated by numerous applications. This exception happens while calling random stored procedures, packets, and inline SQL statements. The Oracle 11 client is installed on the web server. Some applications use Microsoft System.Data.OracleClient to connect to Oracle, and some use the .NET components provided by oracle (ODP.NET). Both data access objects come up with the same error. There are other non

BigDecimal precision not persisted with JPA annotations

限于喜欢 提交于 2019-12-04 03:25:05
I am using the javax.persistence API and Hibernate to create annotations and persist entities and their attributes in an Oracle 11g Express database. I have the following attribute in an entity: @Column(precision = 12, scale = 9) private BigDecimal weightedScore; The goal is to persist a decimal value with a maximum of 12 digits and a maximum of 9 of those digits to the right of the decimal place. After calculating weightedScore , the result is 0.1234, but once I commit the entity with the Oracle database, the value displays as 0.12. I can see this by either using an EntityManager object to

ORA-00955 “name is already used by an existing object”

谁说我不能喝 提交于 2019-12-04 02:41:39
I need to modify an existing PK. Therefore I drop an recreate it. ALTER TABLE B DROP CONSTRAINT PK_B; ALTER TABLE B ADD CONSTRAINT PK_B PRIMARY KEY ("TYP", "NR", "HH", "QUART"); Unfortunately the last Statement will give me an error ORA-00955 If I create the PK constraint like it was defined originally with: ALTER TABLE B ADD CONSTRAINT PK_B PRIMARY KEY ("TYP", "NR", "HH"); everything works fine. Perhaps there is an INDEX associated with the PRIMARY KEY CONSTRAINT , and it is also named as PK_B . You can check it as : SELECT * FROM USER_INDEXES WHERE TABLE_NAME='<table_name>'; If that's true,

Oracle Autoincrement Functionality: Triggers or Oracle JDBC CallableStatement in 11.2?

本小妞迷上赌 提交于 2019-12-04 01:55:04
问题 Which is the best way (in terms of insert performance) to implement autoincrement functionality in Oracle (11.2) when you need to retrieved the newly generated key using JDBC? I know there are identity columns in Oracle 12, but I'm stuck with 11.2 right now. Like many others, I have had no luck in getting the JDBC getGeneratedKeys() to work with Oracle. I ended up having trigger in my Oracle (11.2) database that acts like a MySQL autoincrement function and inserts the NextVal from a table

ODP.NET error Unable to find the Requested .Net Framework Data Provider

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 01:32:59
I am trying to develop an ASP.NET MVC 4.0 application using Oracle 11g Express and the .NET 4.0 framework. I can connect to the DB using the ODP.NET provider and can also generate my EDMX against the database. What I can't do is query the underlying DB using entity framework. When instantiating my DbContext using the connectionString Visual Studio generated, I get the following error: Unable to find the requested .Net Framework Data Provider. It may not be installed However, it is installed because I can see the dll in the GAC. It is mentioned in machine.config. It is referenced by my project.

Function returning boolean fails on “expression is of wrong type”

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 00:14:48
问题 I am using oracle 11g and I just cant under stand where my problem is. I have made much more difficult stuff but I fail in this simple thing for the last 5 hr : This is the function body FUNCTION legal_user( level_existance number ,types_with_impel number) RETURN BOOLEAN IS v_ret_val BOOLEAN; BEGIN v_ret_val := FALSE; IF (level_existance*types_with_impel>0) then v_ret_val := TRUE; DBMS_OUTPUT.PUT_LINE('true'); else DBMS_OUTPUT.PUT_LINE('false'); END IF; return v_ret_val; END legal_user; This

How to add a not null constraint on column containing null values

痴心易碎 提交于 2019-12-03 22:25:05
I have a table with a column that contains a few null values. I want to add a NOT NULL constraint on that column without updating the existing nulls to a non-null value. I want to keep the existing null values and check for future rows that they contain a not null value for this column. Is this possible? How? You can add an unvalidated constraint - it will not look at existing rows, but it will be checked for any new or updated rows. ALTER TABLE mytable MODIFY mycolumn NOT NULL NOVALIDATE; Just be aware that you won't be able to update an existing row unless it satisfies the constraint. Also,

Getting error while trying to alter table in an sql block

最后都变了- 提交于 2019-12-03 22:12:50
I create a test.sql file and inside I put: begin alter table table1 enable row movement; alter table table1 shrink space; end; / Is this not allowed? Because I get error: Encountered the symbol "ALTER" when expecting one of the following: begin case declare exit for goto if loop mod null pragma raise return select update while with <an identifier> <a double-quoted delimited-identifier> <a bind variable> << close current delete fetch lock insert open rollback savepoint set sql execute commit forall merge pipe You cannot issue DDL as static SQL in a PL/SQL block. If you want to put those

SQL to add column and comment in table in single command

我的未来我决定 提交于 2019-12-03 22:02:47
I am using Oracle 11g for my web application. I want to add a column and a comment to an existing table. I can do that easily with the below commands ALTER TABLE product ADD product_description VARCHAR2(20) and COMMENT ON COLUMN product.product_description IS 'This is comment for the column'; But I want to do above task in single command. I searched on internet for a command to add a column and comment in a single command but I couldn't find. I wonder if this is possible. Any suggestions would be highly appreciated. No, you can't. There's no reason why you would need to. This is a one-time

How to spread the average between two intervals in oracle

*爱你&永不变心* 提交于 2019-12-03 21:48:06
If given the Average for 24 hours for each date in a year. I want to spread this hourly average to average at each minute. e.g. given Date Time Average 01-Jan-15 23:00 20 02-Jan-15 00:00 50 02-Jan-15 01:00 30 I want the output to be calculated something as below .... DateTime AVG_VALUE 01/01/2015 23:00:00 20 01/01/2015 23:01:00 20.5 01/01/2015 23:02:00 21 01/01/2015 23:03:00 21.5 01/01/2015 23:04:00 22 01/01/2015 23:05:00 22.5 01/01/2015 23:06:00 23 01/01/2015 23:07:00 23.5 01/01/2015 23:08:00 24 01/01/2015 23:09:00 24.5 01/01/2015 23:10:00 25 01/01/2015 23:11:00 25.5 01/01/2015 23:12:00 26 01