oracle11g

Oracle select query with inner select query error

余生长醉 提交于 2019-12-10 03:00:54
问题 I am getting a SQL error and trying to resolve, any pointers would be helpful, // this gets executed SELECT empid FROM employees WHERE deptid IN (10,20,30,40 ); // this gets executed SELECT deptid FROM department WHERE description LIKE '%application%' ORDER BY createddate DESC but the below query throws error: SELECT empid FROM employees WHERE deptid IN (SELECT deptid FROM department WHERE description LIKE '%application%' ORDER BY createddate DESC); error: ORA-00907: missing right parenthesis

in Oracle JDBC is it possible to batch stored procedure calls and retrieve OUT parameters?

拥有回忆 提交于 2019-12-10 02:47:11
问题 I have a stored procedure in an Oracle 11g database like f(a IN, b IN, c OUT). I want to call it from JDBC in batch mode and then read all the OUT variables. Is this possible? I have this so far CallableStatement statement = connection.prepareCall("f(?, ?, ?)"); for(Item i : items) { int i = 0; statement.setString(++i, item.getA()); statement.setString(++i, item.getB()); statement.registerOutParameter(++i, Types.NUMERIC); statement.addBatch(); } statement.executeBatch(); int[] answers = ?

How to add interval partitions to an existing table in Oracle

点点圈 提交于 2019-12-10 00:20:07
问题 I have a scenarios like ,I need to create interval partitions(monthly) to an existing table in Oracle which has no partitions .please suggest me how to proceed. I tried with below alter table RSST_TP_ORDERINVOICED_NETREV_F set interval(NUMTOYMINTERVAL(1,'MONTH')); TABLESPACE "RSST_DATA" PARTITION BY RANGE ( "DATE_SK" ) INTERVAL ( NUMTOYMINTERVAL(1,'MONTH') ) ( PARTITION "P_FIRST" VALUES LESS THAN (TO_DATE(' 2000-01-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')) TABLESPACE

deserialize java object from a blob

Deadly 提交于 2019-12-09 18:47:53
问题 first of all, i apologize, i'm about to ask a set of dumb questions. i don't know java AT ALL and i don't know if we are allowed to ask questions like these. if not - delete my topic. there's a table in oracle that stores a blob. it's binary and i'm able to decode it, the output looks like this ¬í sr /com.epam.insure.credentialing.forms.StorageBeanÀÓ ¯w/§ L variablest Ljava/util/Map;xpsr java.util.HashMapÚÁÃ`Ñ F loadFactorI thresholdxp?@ w t $_hasCompletedt t $_wf_progresssr java.lang

call an Oracle function that do an insert/update from PHP?

好久不见. 提交于 2019-12-09 18:44:10
问题 we have a function if we call it by using SELECT we get the error code ORA-14551 "Cannot preform a DML operation inside a query" select pkg_tools.replace_site(1121,3343) from dual; how to run this function and get the results when we run it in SQL developer in this way: declare v_return VRACHAR2(200); begin v_return := pkg_tools.replace_site(1121,3343); end; works with no errors and we need this function to be called inside PHP note: I can not paste this function here, because it's to long,

NHibernate (3.1.0.4000) NullReferenceException using Query<> and NHibernate Facility

我怕爱的太早我们不能终老 提交于 2019-12-09 16:25:55
问题 I have a problem with NHibernate, I can't seem to find any solution for. In my project I have a simple entity (Batch), but whenever I try and run the following test, I get an exception. I've triede a couple of different ways to perform a similar query, but almost identical exception for all (it differs in which LINQ method being executed). The first test: [Test] public void QueryLatestBatch() { using (var session = SessionManager.OpenSession()) { var batch = session.Query<Batch>()

Oracle Database import .sql file by command prompt

别说谁变了你拦得住时间么 提交于 2019-12-09 15:39:42
问题 I want to import .sql file in Oracle by command prompt so please tell me that command to import .sql file in oracle in MYSQL I am using it like this mysql -u root -p -h localhost softpoint < D:\Nisarg\NEult\softpoint.sql but In Oracle I don't know how to use this utility so please help me Thanks 回答1: In Oracle, to run a script ( .sql) you use SQL PLUS command line utility. c:\> sqlplus user_name/user_password@connect_string @path\your_sql.sql 回答2: Try to use sqlplus : sqlplus user/password

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

别说谁变了你拦得住时间么 提交于 2019-12-09 15:39:37
问题 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. 回答1: Perhaps there is an INDEX associated with the PRIMARY KEY CONSTRAINT , and it is also named

SQL to add column and comment in table in single command

走远了吗. 提交于 2019-12-09 13:59:45
问题 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

Oracle ORA-01805 on Oracle 11g database

我的未来我决定 提交于 2019-12-09 13:26:44
问题 Our Oracle 10g database was recently upgraded to 11g. The database is running on a Windows Server 2003 X64 machine. In SQL queries from a .NET application that access a table that has a TIMESTAMP (6) WITH TIME ZONE data columns, I am getting the following exception. System.Data.OracleClient.OracleException : ORA-01805: possible error in date/time operation The suggested action for the exception is to ensure that the client and server are the same version: ORA-01805: possible error in date