oracle11g

cursor loop and continue statement : unexpected behaviour

≡放荡痞女 提交于 2019-12-07 04:10:09
问题 I might be overlooking something due to deadline stress. But this behaviour amazes me. It looks as if the cursor caches 100 rows and the continue statement flushes the cache and begins with the first record of a new cache fetch. I narrowed it down to the following script: drop table test1; create table test1 (test1_id NUMBER); begin for i in 1..300 loop insert into test1 values (i); end loop; end; / declare cursor c_test1 is select * from test1; begin for c in c_test1 loop if mod(c.test1_id

How can I see the last SQL statement executed in Oracle database 11g r2?

我只是一个虾纸丫 提交于 2019-12-07 03:35:48
问题 I am new to oracle database. Can someone give me an example of the steps for how to see the last statements executed on the Oracle database 11g r2? 回答1: You can use the below query to get the last sql executed based on last sql which was active in database select ltrim(sq.sql_text) from v$sql sq, v$session se, v$open_cursor oc where sq.sql_id = oc.sql_id and se.saddr = oc.saddr and se.sid = oc.sid and se.audsid = SYS_CONTEXT('userenv', 'sessionid') order by oc.LAST_SQL_ACTIVE_TIME desc; 回答2:

Oracle: Single multicolumn index or two single column indexes

百般思念 提交于 2019-12-07 01:47:07
问题 I have table create table1( column1 number(10, column2 number(10), column3 number(10) ); column1 is Primary Key column2 and column3 is Foreign key I have created unique constraint on 2 columns alter table table1 add constraint table1_contr1 unique(column1,column2) using index tablespace tbs1; when I went to create index on both columns as create index table1_idx1 on table1(column1,coulmn2); ERROR at line 1: ORA-01408: such column list already indexed So Oracle already created index when I

System.Data.OracleClient Vs. ODP.NET [closed]

眉间皱痕 提交于 2019-12-07 01:18:15
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 8 years ago . Which of the above should I use. Please let me know with respect to the following aspects: Efficiency Licensing (are both free? ) Ease

Fetch and bulk collect from a REF CURSOR returned by a procedure

两盒软妹~` 提交于 2019-12-07 00:17:25
I have a stored procedure that has a SYS_REFCURSOR as an OUT parameter. The signature is, for example, as follows: PROCEDURE myProc(p_someID IN INTEGER, p_cursor OUT SYS_REFCURSOR); I call this procedure from a function, where I have to copy a column named clientID from the p_cursor to a scalar nested table. I am doing as follows: CREATE OR REPLACE FUNCTION myFunction RETURN sys_refcursor IS someID INTEGER := 1234; myCursor SYS_REFCURSOR; TYPE t_clientID_nt IS TABLE OF NUMBER(16,0); clientID_nt t_clientID_nt; otherID SYS_REFCURSOR; BEGIN myProc (someID, myCursor); FOR i IN myCursor LOOP

Can not connect ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

戏子无情 提交于 2019-12-06 23:14:28
I want to connect my PLSQL developer tools into database but fail to connect due to error below. ORA-12514: TNS: listener does not currently know of service requested in connect descriptor Check configuration below. How to configure to make it works? SQL> select value from v$parameter where name='service_names'; VALUE orcl SQL> select instance from v$thread; INSTANCE orcl SQL> select host_name,instance_name,version from v$instance; HOST_NAME INSTANCE_NAME VERSION ex-cs-b orcl 11.2.0.1.0 SQL> select global_name from global_name; GLOBAL_NAME ORCL SQL> lsnrctl status LSNRCTL for Linux: Version 11

Accessing a table without specifying the schema name

痞子三分冷 提交于 2019-12-06 21:32:17
问题 I have a schema called GBO_ARC_SCHEMA , in which I have one table called TEST_EMP , and I have two users say USER_A and USER_B . First I connected to USER_A and fired below query select count(*)from TEST_EMP; count ----- 20 After that I connected as USER_b and fired below query but it is giving an error, saying that table or view does not exit select count(*)from TEST_EMP; But if I use scma.object name it is allowing me to query like below select count(*)from GBO_ARC_SCHEMA.TEST_EMP; but as

SQL Developer error Unable to find Java Virtual Machine [duplicate]

China☆狼群 提交于 2019-12-06 19:27:06
问题 This question already has answers here : How to change settings for SQL Developer to correctly recognize current version of SDK (11 answers) Closed 5 years ago . After installing Oracle 11g client, when I tried to run SQL Developer it's asked me to give it java.exe path. As I didn't know I gave it the wrong path to program files java installation. Which I later found out that I should have given the path to java.exe inside oracle folder. Now every time I run it doesn't ask me for java.exe

Oracle 11gR2 installation in Windows server 2012

我与影子孤独终老i 提交于 2019-12-06 18:54:13
问题 While installing Oracle 11gr2 it gives the error [INS-13001] Environment does not meet minimum requirements. I've looked at the prerequisites given at the Oracle website, but everything seems to be there. There is this log file genereated, but I am not able to tell what it's looking for. sing paramFile: E:\win64_11gR2_client\win64_11gR2_client\client\install\oraparam.ini Checking monitor: must be configured to display at least 256 colors. Actual 4294967296 Passed The commandline for unzip: E:

increment function in plsql

末鹿安然 提交于 2019-12-06 18:31:42
问题 In most programming languages you have a fast way to write an increment for a variable like the following examples: inc(variableName); variableName++; variableName += 1; Which ways are there in Oracle Pl/Sql to do this instead of using the following: variableName := variableName + 1; 回答1: The operators are listed in the documentation. There is no equivalent of ++ or += . I'm afraid you have to do it the long way. You could write your own inc() function but that would probably make your code