oracle11g

How to select values within a column

最后都变了- 提交于 2019-12-12 00:19:59
问题 Apologies for sharing little information than needed. Should have provided the entire thing. Here's it. we are sending pre-check patching information from many DB's via a tool to some logs on another server, that server has the main DB which will store this info for comparing later on. We are using the tags "<>" to make our statements unique for identification. The logfile info will look like this: StepLog:Info: dbname instance_name hostname objnames and so on.. From the database on that

oracle 11g r2 - deploying dbmsclr.plb as sysdba after ODAC installation

对着背影说爱祢 提交于 2019-12-12 00:16:07
问题 I just finished installing ODTwithODAC112012 on my system. Now I am trying to deploy dbmsclr.plb But I am getting the error SP2-024 nothing to change. Here is the command window:- C:\>sqlplus /nolog SQL*Plus: Release 11.2.0.1.0 Production on Tue Aug 14 22:59:39 2012 Copyright (c) 1982, 2010, Oracle. All rights reserved. SQL> connect sys/Bel29072012 as SYSDBA Connected. SQL> C:\app\thoshiba\product\11.2.0\dbhome_1\RDBMS\ADMIN\dbmsclr.plb SP2-0024: Nothing to change. SQL> select count(*) from

Unable to resolve error - java.sql.SQLException: ORA-01000: maximum open cursors exceeded

偶尔善良 提交于 2019-12-11 23:54:38
问题 I made a java method to add a row to a database. I am calling this method about 1000 plus times for testing purposes. I called the close() method on my prepared statement and i am still getting the oracle error whenever this method is called to insert a row. Error ORA-01000: maximum open cursors exceeded Source Code public void insertARow(ArrayList<String> row) { try { //Proper SQL statement here, checked by running on DB String insert = "INSERT INTO user.info(cola,colb) values(?,?)"; //Add a

Overlap function in Oracle

六眼飞鱼酱① 提交于 2019-12-11 22:43:39
问题 I'm writing a package to learn Oracle . I want to create an OVERLAP function that checks if two date ranges overlap each other. FUNCTION OVERLAP(p_START_DATE_1 DATE, p_END_DATE_1 DATE, p_START_DATE_2 DATE, p_END_DATE_2 DATE) RETURN VARCHAR2 AS lv_RESULT VARCHAR2(1); BEGIN lv_RESULT := SELECT 'T' AS overlap FROM dual WHERE (p_START_DATE_1, p_END_DATE_1) overlaps (p_START_DATE_2, p_END_DATE_2); IF (lv_RESULT = 'T') RETURN 'T'; RETURN 'N'; END OVERLAP; I tried to execute my function, but getting

crystal report failed to get data

隐身守侯 提交于 2019-12-11 21:43:39
问题 I'm new in crystal report I need some help: I have been set the report Database Logon in two ways as following: 1st: rpt.SetDatabaseLogon(userId, userPassword); 2nd: DatabaseLogOn(fullserverName, dBName, dBUser, userPassword); the first way is working well but I need to change it to the second one for some reasons but Unfortunately it's not working and I don't know the reason: public void DatabaseLogOn(string serverstring, string databasestring, string useridstring, string passwordstring) {

Case statement in oracle with comparision in Then clause

冷暖自知 提交于 2019-12-11 21:26:17
问题 I am new to using Oracle trying something similar to below code, but unable to accomplish the task. CASE WHEN Dimension='abc' then value=100 When Dimension='def' then Value between 200 and 300 end but it is throwing error Missing Keyword state Please help me to solve this issue 回答1: You can rewrite your where clause this way. (Dimension='abc' and value=100) or (Dimension='def' and value between 200 and 300) 来源: https://stackoverflow.com/questions/19534054/case-statement-in-oracle-with

fiscal year date sequence generation

旧城冷巷雨未停 提交于 2019-12-11 21:03:48
问题 I have a table called fiscal year with column start_date,end_date(empty table), I want to insert records for each fiscal year till 2060 FISCAL_YEAR Start dt is Jul 1st, End dt is Jun 31st of next year what i tried select add_months(start_date ,-6),add_months(start_date ,6)-1 from ( select to_date('20000101','yyyymmdd') start_date from dual ) basis how do i generate this sequence till 2060 Decription start_date end_date FISCAL YEAR 2000 7/1/1999 6/30/2000 回答1: SQL> select 2 to_date('01-07-' ||

I have to write a very interesting query which calculates null values and rows with values

拥有回忆 提交于 2019-12-11 20:42:12
问题 I have a scenario where i need to calculate number of total values and number of null values against each ID each ID column have a number of rows Summarizing Data - ID Col1 Col2 Col3 Col4 Col5 Col6 - 132 12 0.5 0 Null 0.3 1.5 - 132 Null 0.5 0 Null 0.3 1.5 - 132 1 0.5 Null Null 0.3 1.5 - 132 2 0.5 0 0.3 1.5 Null - 132 21 0.5 0 Null 0.3 1.5 - 133 Null Null 0 Null Null 1.5 - 133 12 0.5 0 Null 0.3 1.5 - 133 Null 0.5 0 Null 0.3 1.5 - 133 1 0.5 Null Null 0.3 1.5 - 133 2 0.5 0 0.3 1.5 Null - 133 1

oracle function and cursor using dynamic table name

别等时光非礼了梦想. 提交于 2019-12-11 20:20:26
问题 IN my oracle database i want to create a function or procedure with cursor which will use dynamic table name.here is my code. CREATE OR REPLACE Function Findposition ( model_in IN varchar2,model_id IN number) RETURN number IS cnumber number; TYPE c1 IS REF CURSOR; c2 c1; BEGIN open c2 FOR 'SELECT id,ROW_NUMBER() OVER ( ORDER BY id) AS rownumber FROM '||model_in; FOR employee_rec in c2 LOOP IF employee_rec.id=model_id then cnumber :=employee_rec.rownumber; end if; END LOOP; close c2; RETURN

Non Ending Loop in Cursor.

瘦欲@ 提交于 2019-12-11 20:17:34
问题 Please find the below code. It runs non stop with no operations or output. what I'm doing wrong. declare cid number; cadd number; ctras number; cr varchar(2); cad number; cursor c1 IS select c_tras, c_id, c_add from customer_master; cursor c2 IS select c_address, cr from customer_address where c_id = cid; begin open c1; open c2; LOOP fetch c1 into ctras, cid, cadd; fetch c2 into cad, cr; if cr='N' THEN update customer_master set c_address = (select c_address from customer_address where cr =