oracle10g

xml to oracle DB table : encountering problems

二次信任 提交于 2019-12-24 03:49:06
问题 I have a sample xml file created using Editplus( in windows). < ?xml version="1.0" encoding="UTF-8" ?> < badges > < row UserId="3714" Name="Teacher" Date="2008-09-15T08:55:03.923"/> < row UserId="994" Name="Teacher" Date="2008-09-15T08:55:03.957"/> < / badges> My goal here is to get this information into Oracle DB table. As suggested here https://stackoverflow.com/questions/998055?sort=newest#sort-top, I tried to execute the sql commands. But couldn't succeed, ========================= sql

create table with select union has no constraints

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 03:15:15
问题 I created a table using select with a union , as follows: create table tableC as select column1, column2 from tableA union all select column1, column2 from tableB The resulting table ( tableC ) has inherited none of the constraints from tableA or tableB . Why weren't the constraints copied to the new table? 回答1: Using select ... as ... to create a table never copies constraints. If you want the new table to inherit constraints from the original tables, you must create the new constraints

Using TransactionScope with System.Data.OracleClient - TransactionAbortedException

我的未来我决定 提交于 2019-12-24 01:53:22
问题 My system write some data to a SQL Server DB (2008), extracts it later and processes it some more, before writing it to an Oracle (10g) DB. I've wrapped my SQL Server interactions in a TransactionScope but when I try the same think with my Oracle interactions I get a `TranactionAbortedException - "The transaction has aborted". Remove the TransactionScope, and everything works OK. I could always revert back to manually managing my own transactions, but I'm hoping there is a simple solution.

Oracle “Cannot update to NULL”

匆匆过客 提交于 2019-12-24 00:59:57
问题 I have this query on Oracle 10g: UPDATE "SCHEMA1"."CELLS_GLIST" SET ("GLIST_VALUE_ID", "USER_ID", "SESSION_ID") = ( SELECT "GLIST_VALUE_ID", 1 AS "USER_ID", 123456 AS "SESSION_ID" FROM "SCHEMA1"."GLISTS_VALUES_UOR" WHERE ("UOR_ID"=3) AND ("GLIST_ID"=67) AND ("GLIST_VALUE_DESC" = ( SELECT "GLIST_VALUE_DESC" FROM "BMAN_TP1"."GLISTS_VALUES_UOR" WHERE ("UOR_ID"=3) AND ("GLIST_VALUE_ID"="CELLS_GLIST"."GLIST_VALUE_ID") )) ) WHERE EXISTS (......) It keeps saying ORA-01407: cannot update ("SCHEMA1".

Oracle inactive connection

蹲街弑〆低调 提交于 2019-12-24 00:56:07
问题 There are a lot of inactive connection in my oracle server. I retrieve SQL text from those inactive. The SQL test is SELECT PARAMETER, VALUE FROM SYS.NLS_DATABASE_PARAMETERS WHERE PARAMETER IN ('NLS_CHARACTERSET', 'NLS_NCHAR_CHARACTERSET') but I never use the SQL statement in my system, and do not know why the statement run automatically without closing automatically. 回答1: Is there a problem? In most systems, most sessions are inactive the vast majority of the time. An inactive session merely

Oracle JDBC select with WHERE return 0

情到浓时终转凉″ 提交于 2019-12-24 00:56:06
问题 Similar question to: Strange problem with JDBC, select returns null but people didn't ask for this. My code: public int myMethod(String day) throws SQLException{ String sql = "Select count(*) from MyTable WHERE someColumn = " + day; Connection connection = ConnFactory.get(); PreparedStatement prepareStatement = null; ResultSet resultSet = null; int ret = -1; try{ prepareStatement = connection.prepareStatement(sql); resultSet = prepareStatement.executeQuery(sql); if(resultSet.next()){ ret =

Oracle 10g - invalid character on DB importing

孤人 提交于 2019-12-24 00:39:15
问题 I have several SQL files that I want to import. An example: CREATE TABLE BB_Department ( idDepartment number(2) , DeptName varchar2(25) , DeptDesc varchar2(100) , DeptImage varchar2(25) , CONSTRAINT dept_id_pk PRIMARY KEY(idDepartment) ); insert into bb_department values(1,'Coffee','Many types of coffee beans','coffee.gif'); When importing this with http://localhost:8080/apex I continually receive the 'invalid character' error. It seems that one can only run ONE SQL statement at a time. The

How to use Oracle stored procedures with Scala Anorm in Playframework

江枫思渺然 提交于 2019-12-23 18:45:47
问题 I have many stored procedures which have Lists of Strings as result How can i access the refcurser in the play 2.0 Framework with scala? Can someone make a simple example how i can fill a list? I tried this: case class XXXX(name: String, description: String) object XXXX{ val simple = { get[String]("name") ~ get[String]("description") map { case name~description => XXXX(name, description) } } def all(): List[XXXX] = DB.withConnection { implicit c => SQL("""exec PROCEDURE""").as(XXXX.simple *)

JAXB 2 in an Oracle 10g Webapp

丶灬走出姿态 提交于 2019-12-23 18:20:02
问题 I have a web application that uses JAXB 2. When deployed on an Oracle 10g Application Server, I get errors as soon as I try to marshal an XML file. It turns out that Oracle includes JAXB 1 in a jar sneakily renamed "xml.jar". How I can force my webapp to use the version of the jaxb jars that I deployed in WEB-INF/lib over that which Oracle has forced into the classpath, ideally through configuration rather than having to mess about with classloaders in my code? 回答1: I assume you use the

Viewing oracle's metadata about primary/foreign key constraints

霸气de小男生 提交于 2019-12-23 18:02:28
问题 Which table contains detailed information(For example the table the foreign key is referring to) about the constraints? The tables 'all_cons_columns' , 'all_constraints' contains only the name of the constraints which isn't very helpful. I am currently using dbms_metadata.get_ddl() but it doesn't work on all the databases. Thanks. 回答1: It is all in there: the column R_CONSTRAINT_NAME in ALL_CONSTRAINTS contains the name of the referenced PK/UK constraint for a foreign key. You can then look