oracle11g

Hibernate with NVARCHAR2

两盒软妹~` 提交于 2019-12-24 03:55:11
问题 I have table with a column as NVARCHAR2 , and I have build my object with hibernate annotations, When i want to insert into DB or fetch from DB the result is something like that "???????", I have implemented a custom Dialect as follows but it did not work. public class CustomOracleDialect extends Oracle10gDialect{ public CMSCustomOracleDialect() { registerHibernateType( Types.NVARCHAR, Hibernate.STRING.getName() ); registerColumnType( Types.VARCHAR, "nvarchar2($1)" ); registerColumnType(

ORA-00979: not a GROUP BY expression issue [duplicate]

两盒软妹~` 提交于 2019-12-24 03:46:11
问题 This question already has answers here : ORA-00979 not a group by expression (8 answers) Closed 5 years ago . I am performing the following request and I get a "ORA-00979: not a GROUP BY expression" error. select distinct field1, field2, field3, count(*) as field4, field5, field6, case when smt1>0 then 'Deleted' when smt2>0 then 'Impacted' when smt3>0 then 'Unknown' else 'Clean' end as field7, field8, field9, field10, field11, field12, field13 from (<here a big sub query>) A group by field1,

Where to change the NLS_DATE_FORMAT in oracle 11g?

我们两清 提交于 2019-12-24 03:34:31
问题 i need to change the NLS_DATE_FORMAT in my Stored procedure.seems like its a session variable and where should i alter the variable mask. should it be done in global declaration or elsewhere(i mean from frontend). 回答1: If you want to change a NLS parameter in a procedure then you can use DBMS_SESSION.SET_NLS. Given an environment that looks like this: SQL> select value 2 from nls_session_parameters 3 where parameter = 'NLS_DATE_FORMAT'; VALUE ------------------------------------------ DD-MON

When I enter a dateadd or datediff code i get this error all the time “ORA-00904 ”DATEADD“ INVALID IDENTIFIER.”

落花浮王杯 提交于 2019-12-24 03:24:15
问题 I have a university project and I have a patient table with admission and discharge date attributes. I need to delete records that are older than 7 years, I used the following code : delete from patient where dis_date >= datedadd(yy,-7,getdate()); I get the error "ORA-00904: "DATEADD" invalid identifier" . It's the same with the DATEDIFF function. Any alternatives please? 回答1: The typical way of doing this in Oracle would be: DELETE FROM patient WHERE dis_date < TRUNC(ADD_MONTHS(SYSDATE, -7

ORA-01400: Cannot insert null into (TABLE.COLUMN) (Hibernate)

谁说我不能喝 提交于 2019-12-24 02:16:35
问题 I'm using hibernate 4.3, oracle 11: When I want to insert an employee, (it have a relationship one to many with category (one category have many employees)), first I Insert a category to db, then I try to insert an employee to the db and get an exception, the code of the entities was generated by hibernate, so I don't know what's wrong, The problem seems to be that Hibernate is not inserting ID_CAT when I'm inserting an employee, what im doing wrong? I also tried to generate tables from

ORA 03134 error connecting ODP.NET 12 (VS2012) to Oracle database 11

自闭症网瘾萝莉.ら 提交于 2019-12-24 01:44:47
问题 When trying to connect to Oracle 9.2 from VS2012 using ODP.NET 12, I have got this message: ORA-03134: Connections to this server version are no longer supported I have installed ODP.NET 11 and I got the same error, although connecting with Toad is working. Any ideas? 回答1: I solved the issue, uninstalling version 12 of ODP.NET, as version 12 is not supporting Oracle 9.2 databases. ODP.NET version 11 works with version 9.2 and above. 来源: https://stackoverflow.com/questions/19688485/ora-03134

UpdateException: Operation is not valid due to the current state of the object when using Entity Framework and Oracle

回眸只為那壹抹淺笑 提交于 2019-12-24 01:19:26
问题 I'm attempting to add a new Entity object for persistence, however I'm getting an UpdateException who's inner exception is an InvalidOperationException with the message: Operation is not valid due to the current state of the object. Object being created: var something = new SITE { EntityKey = new EntityKey("DataModelContainer.SITE", "SITE_ID", "ID"), SITE_COMMON_REFERENCE = "hello", SITE_ID = "hello" }; which is then passed to: public void ExportSiteData (SITE exportSiteData) { _context.SITE

Overcoming the restriction on bulk inserts over a database link

房东的猫 提交于 2019-12-24 00:53:38
问题 It appears as though there's an implementation restriction that forbids the use of forall .. insert on Oracle, when used over a database link. This is a simple example to demonstrate: connect schema/password@db1 create table tmp_ben_test ( a number , b number , c date , constraint pk_tmp_ben_test primary key (a, b) ); Table created. connect schema/password@db2 Connected. declare type r_test is record ( a number, b number, c date); type t__test is table of r_test index by binary_integer; t

How can I eliminate duplicate data in column

痞子三分冷 提交于 2019-12-24 00:39:11
问题 I would like to eliminate duplicates and show one time for example SELECT 'apple, apple, orange' FROM dual; I would like to show apple, orange as another example. SELECT 'apple, apple, apple, apple,' FROM dual; I just want to show apple This code shows with data as ( select 'apple, apple, apple, apple' col from dual ) select listagg(col, ',') within group(order by 1) col from ( select distinct regexp_substr(col, '[^,]+', 1, level) col from data connect by level <= regexp_count(col, ',') ) 回答1

Classic ASP/OraOLEDB - how to define OUT param containing TABLE?

和自甴很熟 提交于 2019-12-24 00:32:06
问题 A classic ASP script migrated from msdaora to OraOLEDB will no long execute an Oracle SP it used to. The SP looks like this : TYPE tbl_CONSOLIDATED_ID IS TABLE OF VARCHAR2(32) INDEX BY BINARY_INTEGER; TYPE tblSAM_DD_TEXT IS TABLE OF VARCHAR2(50) INDEX BY BINARY_INTEGER; TYPE tblSAM_TYPE IS TABLE OF NUMBER INDEX BY BINARY_INTEGER; -- PROCEDURE Get_Associated_Samples( EMPID_IN IN MAS_EMPLOYEE.EMP_AUTOID%TYPE, ID_OUT OUT tbl_CONSOLIDATED_ID, SAMDDTEXT_OUT OUT tblSAM_DD_TEXT, SAMTYPE_OUT OUT