oracle11g

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

穿精又带淫゛_ 提交于 2019-12-05 22:00:18
问题 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

Oracle SQL unsigned integer

只谈情不闲聊 提交于 2019-12-05 21:48:55
In Oracle, what is the equivalent to MySQL's UNSIGNED? I have the following query, only it doesn't work: CREATE TABLE foo ( id INT UNSIGNED NOT NULL PRIMARY KEY ); Edit: My purpose is to save space, because for some fields I won't be using negative values. Alternatively, it would answer my question of someone confirms that what I'm asking for is impossible in Oracle 11g, or if it's possible, but not straightforward to do (more than 3 lines of code per unsigned int). Also, It's not necessarily about int . I also use smallint and tinyint. If you want to match the restrictions shown here , you

UPDATE statement: re-evaluate subquery after each SET

白昼怎懂夜的黑 提交于 2019-12-05 19:49:59
CREATE TABLE test (id NUMBER(3)); INSERT INTO test VALUES (1); INSERT INTO test VALUES (2); INSERT INTO test VALUES (2); INSERT INTO test VALUES (3); INSERT INTO test VALUES (4); INSERT INTO test VALUES (4); INSERT INTO test VALUES (5); I want to make the numbers in test unique (like {1,2,3,4,5,6,7} - i.e. remove doubles) using this query: UPDATE test u SET u.id = (SELECT max(nn.id) FROM test nn) + 1 WHERE 1 < ( SELECT tt.rown FROM (SELECT rowid, row_number() over ( partition by t.id order by t.id) AS rown FROM test t) tt WHERE tt.rowid = u.rowid ); The above query updates the table to {1,2,3

Using a case statement in a check constraint

血红的双手。 提交于 2019-12-05 18:56:18
i'v been learning SQL for the last week but I am unsure how to correctly add a case statement within a check constraint. Can anybody give me any pointers? I have the following grade table: CREATE TABLE Grade ( salary_grade char(1) NOT NULL CHECK (salary_grade = UPPER(salary_grade)), CONSTRAINT ck_grade_scale CHECK( CASE WHEN salary_grade = '[A-D]' THEN salary_scale = 'S1' WHEN salary_grade = '[D-G]' THEN salary_scale = 'S2' END) salary_scale char(2) DEFAULT 'S1' NOT NULL, CONSTRAINT pk_grade PRIMARY KEY (salary_grade), CONSTRAINT ck_salary_grade CHECK (REGEXP_LIKE(salary_grade, '[A-G]', 'c')),

Finding the datatype of a cursor or table column in a block

夙愿已清 提交于 2019-12-05 18:42:59
Is is possible to find out the datatype of a column of a cursor or variable within block without using system tables? While I understand that I can use the system tables to find out this information it would be a lot slower. Something like, declare my_column_data_type varchar2(30); begin my_column_data_type := all_tables.table_name%type; dbms_output.put_line(my_column_data_type); end; I can't find any way of doing it without resorting to dbms_sql , which would be overkill for my eventual purpose. But, Oracle already has all the information to hand. If I were to try to assign a varchar2 to a

Convert `Java.lang.String` TO `oracle.sql.TIMESTAMPTZ`

谁都会走 提交于 2019-12-05 18:30:21
问题 I have these following Java.lang.String values that represents String value of TIMESTAMPTZ . I need to convert these Java.lang.String TO oracle.sql.TIMESTAMPTZ . "2016-04-19 17:34:43.781 Asia/Calcutta", "2016-04-30 20:05:02.002 8:00", "2003-11-11 00:22:15.0 -7:00", "2003-01-01 02:00:00.0 -7:00", "2007-06-08 15:01:12.288 Asia/Bahrain", "2016-03-08 17:17:35.301 Asia/Calcutta", "1994-11-24 11:57:17.303" I tried it by many ways. Sample 1: Tried it by using SimpleDateFormat String[] timeZoneValues

Entity Framework code first for Oracle

人走茶凉 提交于 2019-12-05 18:20:09
问题 Is there any possibility of using EF Code First for Oracle DB. Even though the DB generation is absent is there a way to the use the EF fluent API with Oracle DB. 回答1: Yes, actually we are using right now in a new project, but we had a lot of problems, some of them are not fixed yet. Take a look at this: Oracle ODP.Net and EF CodeFirst - edm.decimal error and this: Oracle ODP.Net and EF CodeFirst - SaveChanges Error 来源: https://stackoverflow.com/questions/9871879/entity-framework-code-first

SQL date conversion results to “invalid number format model parameter.”

穿精又带淫゛_ 提交于 2019-12-05 18:11:55
I have to select some data from Oracle 11g database, but I can't seem to figure out why following select query is failing: SELECT INFO_ID, INFO_DETAIL, IMPORTANT_FLG, DELETE_FLG, CREATE_TIME, DISPLAY_ORDER FROM TABLE_NAME WHERE TO_DATE(TO_CHAR(CREATE_TIME, 'YYYY/MM/DD'), 'YYYY/MM/DD') BETWEEN TO_DATE(TO_CHAR(:fromDate, 'YYYY/MM/DD'), 'YYYY/MM/DD') AND TO_DATE(TO_CHAR(:toDate, 'YYYY/MM/DD'), 'YYYY/MM/DD') ORDER BY IMPORTANT_FLG DESC NULLS LAST , DISPLAY_ORDER ASC NULLS LAST, CREATE_TIME DESC, INFO_ID ASC The query is failing with following error message: ORA-01481: invalid number format model

Passing dynamic input parameters to 'execute Immediate'

不羁的心 提交于 2019-12-05 17:56:38
I have a table where I am storing certain conditions along with input parameters as shown below: CONDITION | INPUT_PARAMS --------------------------------------------------------- :p_end_date < :p_start_date | v_end_date, IN v_start_date :p_joining_day = 'MONDAY' | v_joining_day I want to use execute immediate to evaluate the conditions. select condition, input_param into v_execute_condition, v_input_param From table; v_execute_statement := 'IF '||v_execute_condition ||' '|| 'THEN :o_flag := ''Y'';' ||' '|| 'ELSE :o_flag := ''N'';' ||' '|| 'END IF;'; v_execute_statement := 'BEGIN '||v_execute

log4net:添加自定义字段并将日志存储到Oracle11g数据库中

为君一笑 提交于 2019-12-05 17:50:48
我的操作系统为Win7旗舰版,.NET版本为4.5,log4net版本为1.2.15,Oracle版本为11g。 使用log4net建立一个最简单的DEMO,可以参考我的上一篇博客: http://my.oschina.net/Tsybius2014/blog/687750 log4net支持将日志打印到数据库中,将日志中指定的内容打印到数据库中特定字段的方法有多种,本文选取一种较为灵活的方式,即继承ILog接口建立子接口。 首先在Oracle数据库中建立一张表,建表SQL如下: CREATE TABLE PROGRAM_LOG ( DATETIME TIMESTAMP(3), THREAD VARCHAR2(255), LOG_LEVEL VARCHAR2(255), LOGGER VARCHAR2(255), SYS_CODE VARCHAR2(10), MESSAGE VARCHAR2(4000) ); 我建立的工程结构如下: 其中,log4net.config中保存了Appender相关配置 <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="log4net" type="System.Configuration