oracle10g

“ORA-01012” error message when trying to connect to an Oracle database

前提是你 提交于 2019-12-05 11:04:10
Using C# and Oracle Data Provider for .NET (ODP) I made a long query to the database, then I end the connection on the server side using TOAD. After that, the subsequent calls to the database, even creating a new OracleConnection object, throw the following error: ORA-01012: not logged on Process ID: xxx Session ID: yyy Serial number: zzz Where Process ID and Session ID are the identifiers I used to end the connection. It seems like when I end the connection to the Oracle database on the server side, the broken connection is returned to the connection pool. And when the C# client code (using

difference between “tab” table and all_tables in oracle

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-05 09:55:49
what tables are returned by using (in oracle) select * from tab and select * from all_tables I would like to know the difference between two. tab is an ancient data dictionary table that should never be used. It exists solely to provide backwards compatibility for scripts that were written potentially decades ago. tab does not get updated as new object types and new features get added. all_tables gives you information about all the tables that you have access to. tab gives you information about tables, views, and synonyms that you own (making it more similar to views like user_tables , user

Is there a way to copy BLOB records between databases in Oracle 10g?

青春壹個敷衍的年華 提交于 2019-12-05 09:11:58
We have a production table that has millions of rows in it and contains a BLOB field, I would like to copy a smaller selection of these records into our development database without getting a DBA involved if possible. I tried the following COPY command but received a CPY-0012: Datatype cannot be copied COPY FROM user/password@prod_db TO user/password@dev_db - INSERT TABLE_A (COL1, COL2, COL3, BLOB_COL) USING - SELECT COL1, COL2, COL3, BLOB_COL - FROM TABLE_A WHERE COL1='KEY' Is there a way to copy records with a BLOB field between databases via SQL? Datajam Unfortunately you cannot copy BLOB

Why do I have ORA-00904 even when the column is present?

依然范特西╮ 提交于 2019-12-05 08:46:13
问题 I see an error while executing hibernate sql query. java.sql.SQLException: ORA-00904: "table_name"."column_name": invalid identifier When I open up the table in sqldeveloper, the column is present. The error is only happening in PROD, not in DEV. What should I check? 回答1: It could be a case-sensitivity issue. Normally tables and columns are not case sensitive, but they will be if you use quotation marks. For example: create table bad_design("goodLuckSelectingThisColumn" number); 回答2: Oracle

“loader constraints violated when linking javax/xml/namespace/QName class” from webapp on Oracle 10g

点点圈 提交于 2019-12-05 08:45:21
We have a web application that can be deployed on many application servers, including Oracle 10g. On that platform, however, we are having classpath issues. The webapp uses JAXB 2, but Oracle 10g ships with JAXB 1, and this was causing errors. To get around those we configured Oracle to prefer classes in our webapp, but now we are getting the above error when attempting to instantiate a JAXB context. Looking up the "loader constraints violated" exception - it seems to be thrown when a class that has been loaded with one classloader attempts to access something that is package private in the

How do I use the BLOB data type with Hibernate?

北城余情 提交于 2019-12-05 07:44:45
I am retrieving a blob field containing JSON file from Oracle 10g database. I want to convert it in to a string in my DAO and give it to an incoming service request. My entity class is: @Lob @Column(name = "DTA_BLOB") private Blob DataBlob; /** * @return the DataBlob * */ public Blob getDataBlob(){ return DataBlob; } /** * @param DataBlob the DataBlob to set */ public void setDataBlob(Blob DataBlob) { this.DataBlob = DataBlob; } My DAO have the method to get the string from the blob as shown below: @Override @Transactional public String getMenu(Long menuDataId) throws SQLException, IOException

Oracle duplicate row N times where N is a column

拈花ヽ惹草 提交于 2019-12-05 07:02:08
I'm new to Oracle and I'm trying to do something a little unusual. Given this table and data I need to select each row, and duplicate ones where DupCount is greater than 1. create table TestTable ( Name VARCHAR(10), DupCount NUMBER ) INSERT INTO TestTable VALUES ('Jane', 1); INSERT INTO TestTable VALUES ('Mark', 2); INSERT INTO TestTable VALUES ('Steve', 1); INSERT INTO TestTable VALUES ('Jeff', 3); Desired Results: Name DupCount --------- ----------- Jane 1 Mark 2 Mark 2 Steve 1 Jeff 3 Jeff 3 Jeff 3 If this isn't possible via a single select statement any help with a stored procedure would be

Dynamically select the columns to be used in a SELECT statement

女生的网名这么多〃 提交于 2019-12-05 06:41:10
I would love to be able to use the system tables (Oracle in this case) to drive which fields are used in a SELECT statement. Something like: SELECT ( select column_name from all_tab_cols where table_Name='CLARITY_SER' AND OWNER='CLARITY' AND data_type='DATE' ) FROM CLARITY_SER This syntax doesn't work, as the subquery returns multiple rows, instead of one row with multiple columns. Is it possible to generate a SQL statement dynamically by querying the table schema information in order to select only certain columns? ** edit ** Do this without using a function or procedure, if possible. You can

Create a temp table in PL/SQL

余生颓废 提交于 2019-12-05 06:06:19
I'm working with an Oracle 10g database, and I want to extract a group of records from one table, and then use that for pulling records out of a bunch of related tables. If this were T-SQL, I'd do it something like this: CREATE TABLE #PatientIDs ( pId int ) INSERT INTO #PatientIDs select distinct pId from appointments SELECT * from Person WHERE Person.pId IN (select pId from #PatientIDs) SELECT * from Allergies WHERE Allergies.pId IN (select pId from #PatientIDs) DROP TABLE #PatientIDs However, all the helpful pages I look at make this look like a lot more work than it could possibly be, so I

Getting Error Message For oci_execute() Error (PHP)

余生颓废 提交于 2019-12-05 05:47:18
问题 I would like to get the specific error message if a query fails in Oracle 10g. For MySQL, PHP has the mysql_error() function that can return details about why a query failed. I check the php.net manual for the oci_execute() function, but from what I see it only returns false on fail. I tried using oc_error(), but I am not getting anything from it. Here is a code sample: $err = array(); $e = 0; //Cycle through all files and insert new records into database for($f=0; $f<sizeof($files); $f++) {