Command for "How to find Cursor Size" in Oracle Stored Procedure"
Hi
Can u tell me....
How to find Cursor Size" in Oracle Stored Procedure........
I want command for that........
why don't you try select count(*) from your_table;That requires running the same query twice - or rather running two different queries twice. Besides it still doesn't guarantee anything, because Oracle's read consistency model only applies at the statement level (unless you're running in a serialized transaction).
This is such a common requirement - users are wont to say "well Google does it" - it seems bizarre that Oracle cannot do it. The truth is that that Google cheats. Firstly it guesses the number on the basis of information in its indexes and refines the estimate as pages are returned. Secondly, Google is under no onus to kepp all its data and indexes synchronized - two simultaneous and identical queries which touch different Google servers can return different results. Oracle Text works the same way, which is why we can get a count with CTX_QUERY.COUNT_HITS in estimate mode.
Cheers, APC
blog: http://radiofreetooting.blogspot.com
.
Similar Messages
-
How to find the list of unused stored procedures in SQL Server 2005?
Hi,
I need to find out the list of stored procedures which are not in use.
I found there is something called "sys.dm_exec_procedure_stats " for SQL server 2008.
Can you please suggest your ides here to do the same job for SQL server 2005.
Many Thanks.In SQL 2005 there is, sort of. This is query lists the last execution
time for all SQL modules in a database:
SELECT object_name(m.object_id), MAX(qs.last_execution_time)
FROM sys.sql_modules m
LEFT JOIN (sys.dm_exec_query_stats qs
CROSS APPLY sys.dm_exec_sql_text (qs.sql_handle) st)
ON m.object_id = st.objectid
AND st.dbid = db_id()
GROUP BY object_name(m.object_id)
But there are tons of caveats. The starting point of this query is
the dynamic management view dm_exec_query_stats, and the contents is
per *query plan*. If a stored procedure contains several queries,
there are more than one entry for the procedure in dm_exec_query_stats.
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
How to find out names of all stored procedures?
Hi All,
I need to find out the names of all stored procedures with parameters and return types. I can use DBA_SOURCE, but in this case I must parse TEXT to find out what I need. Is there any dictionary where the names, parameters and return types of stored procedures saved separately?
Thanks,
Andrej.Not much fair to bring this old post up, sorry!
I am still looking for an answer to my post
where are stored functions like ORA_HASH or GROUPING_ID -
Oracle - how to find columns in a table + stored procedures dependent on th
Scenario:
I need to list all the columns in a table1 and all stored procedures that depends on those columns of this table1. I need to populate column name and stored procedures to a new table.
I created new_table(col1, sProc) and tried to populate the column name and respective stored procedure on this new_table. Code I wrote is given below:
Declare
Beginfor i in (select column_name from user_tab_columns where lower(table_name) like 'table1') loop
insert into new_table
select i.column_name, name from user_source where lower(text) like '%' || i.column_name || '%';
commit;
end loop;
end;
Result: The scripts run successfully but the no data is populated on this new_table.
Stress: I tried to solve it for 1 whole day and could not figure it out. Any help on this would be greately appreciated. Thank you once again.select i.column_name, name from user_source where lower(text) like '%' || i.column_name || '%';Hi,
At first check this,
SQL> desc user_source
Name Null? Type
NAME VARCHAR2(30)
TYPE VARCHAR2(12)
LINE NUMBER
TEXT VARCHAR2(4000)I tried it like this for my testing purpose,
SQL> create table new_table(cname varchar2(40),pname varchar2(40));
Table created.
SQL> Declare
2 v_pname varchar2(40);
3 Begin
4 for i in (select column_name from user_tab_columns where lower(table_name) like 'table1') loop
5 dbms_output.put_line(i.column_name);
6 select name into v_pname from user_source where lower(text) like '% '||lower(i.column_name)||' %';
7 insert into new_table values(i.column_name ,v_pname);
8 commit;
9 end loop;
10 end;
11 /
STR
PL/SQL procedure successfully completed.
SQL> select * from new_table;
CNAME PNAME
STR MY_PROCEDURETwinkle -
How to create Nested table in oracle stored procedure(Temp Table)
Hi
I am creating Nested table in stored procedure(Temp Table)
type t_v_tbl_rec is record(cumid number,col1 varchar(50),col2 varchar(50),col3 varchar(50),col4 varchar(50),col5 varchar(50),col6 varchar(50));
type t_v_tbl is table of t_v_tbl_rec index by binary_integer;
V_V_TBL t_v_tbl;
But i can't insert value in to this temp table
Plz help meWhat is problem?
SQL>declare
2 type t_v_tbl_rec is record( cumid number,
3 col1 varchar(50),
4 col2 varchar(50),
5 col3 varchar(50),
6 col4 varchar(50),
7 col5 varchar(50),
8 col6 varchar(50) );
9 type t_v_tbl is table of t_v_tbl_rec index by binary_integer;
10 v_v_tbl t_v_tbl;
11 begin
12 v_v_tbl(1).cumid := 1;
13 dbms_output.put_line(v_v_tbl(1).cumid);
14 end;
15 /
1
PL/SQL procedure successfully completed. -
How to find the size of an arrayList through Expression Builder.
Hai OTN,
How to find the size of an arrayList through Expression. I have a managed bean in View Scope.I am using Jdeveloper 11.1.1.2 with ADF Faces components.
Managed Bean :
ArrayList<IllnessEmployeesObj> employeeGridList =
new ArrayList<IllnessEmployeesObj>();
JSPX :
Value="#{viewScope.PandIVH.employeeGridList.size}"
Error : java.lang.NumberFormatException: For input string: "size"Hi Dinil,
I have provided you with a sample that would show you the how you can get the size of an arraylist
the sample has a page untitled1 and a bean named test.
I have run in on jdev 11.1.2 and it is ok, it will be ok on 11.1.3
after running the sample you will see the 2.
please remember that you must add the JSTL taglib on the viewcontroller.
just right click on viewcontroller, go to tag lib select the jstl.
page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<f:view>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>untitled1</title>
</head>
<body>
<h:form>
<h:outputText value="#{fn:length(test.a)}"/>
</h:form>
</body>
</html>
</f:view>
bean
import java.util.ArrayList;
public class Test {
public Test() {
a= new ArrayList();
Object o=new Object();
a.add(o);
a.add(o);
ArrayList a;
public void setA(ArrayList a) {
this.a = a;
public ArrayList getA() {
return a;
I hope this sample came handy.
regards, -
How to find the size of the pipe. I mean the total number of bytes/messages available in the named pipe?
NAVEENI'm afraid this forum for Microsoft Project Customization and Programming is not the correct forum for your question. Please Choose correct forum in order
to get help from experts. I think your question is more relevant to SQL server
kirtesh -
How to find data dictionary and oracle schema tables for UTF8 char conversi
I am doing UTF8 char conversition, i got lot of convertable objects,as per document we don't need to worry about data dictionary objects and how to find data dictionary and oracle schema objects for UTF8 char conversition.
USER.TABLE Convertible Truncation Lossy
MDSYS.OPENLS_NODES 17 0 0
MDSYS.SDO_COORD_OP_PARAM_VALS 200 0 0
MDSYS.SDO_GEOR_XMLSCHEMA_TABLE 1 0 0
MDSYS.SDO_STYLES_TABLE 78 0 0
MDSYS.SDO_XML_SCHEMAS 3 0 0
ORDDATA.ORDDCM_CT_PRED_OPRD 51 0 0
ORDDATA.ORDDCM_DOCS 9 0 0
ORDDATA.ORDDCM_MAPPING_DOCS 1 0 0
SYS.METASTYLESHEET 178 0 0
SYS.REGISTRY$ERROR 2 0 0
SYS.RULE$ 21 0 0
SYS.SCHEDULER$_EVENT_LOG 182 0 0
SYS.WRH$_SQLTEXT 2,099 0 0
SYS.WRH$_SQL_PLAN 1,736 0 0
SYS.WRI$_ADV_ACTIONS 5,452 0 0
SYS.WRI$_ADV_DIRECTIVE_META 5 0 0
SYS.WRI$_ADV_OBJECTS 2,278 0 0
SYS.WRI$_ADV_RATIONALE 9,594 0 0
SYS.WRI$_ADV_SQLT_PLANS 455 0 0
SYS.WRI$_ADV_SQLT_PLAN_STATS 288 0 0
SYS.WRI$_DBU_FEATURE_METADATA 188 0 0
SYS.WRI$_DBU_FEATURE_USAGE 16 0 0
SYS.WRI$_DBU_HWM_METADATA 20 0 0
SYS.WRI$_REPT_FILES 27 0 0
XDB.XDB$DXPTAB 2 0 0
XML CSX Dictionary Tables:
USER.TABLE Convertible Truncation Lossy
Application Data:
USER.TABLE Convertible Truncation Lossy
APPLSYS.BISM_OBJECTS 4 0 0
APPLSYS.DR$FND_LOBS_CTX$I 0 103 1,260,883
APPLSYS.FND_CONC_PROG_ANNOTATIONS 272 0 0
APPLSYS.FND_OAM_CONTEXT_FILES 15 0 0
APPLSYS.FND_OAM_DOC_LINK 1 0 0
APPS.FND_OAM_CONTEXT_FILES_1 6 0 0
AZ.AZ_APIS 11 0 0
AZ.AZ_SELECTION_SET_ENTITIES_B 48 0 0
ECX.ECX_DTDS 205 0 0
ECX.ECX_FILES 91 0 0
IBC.IBC_ATTRIBUTE_BUNDLES 41 0 0
JTF.JTF_HEADER_DTD 1 0 0
JTF.JTF_MESSAGE_OBJECTS 82 0 0
JTF.JTY_TRANS_USG_PGM_SQL 29 0 0
ODM.ODM_PMML_DTD 1 0 0
OKC.OKC_REPORT_SQL_B 3 0 0
OKC.OKC_REPORT_SQL_TL 2 0 0
OKC.OKC_REPORT_XSL_TL 5 0 0
XDP.XDP_PROC_BODY 10 0 0
[Distribution of Convertible, Truncated and Lossy Data by Column]
Data Dictionary Tables:
USER.TABLE|COLUMN Convertible Truncation Lossy
MDSYS.OPENLS_NODES|SYS_NC00004$ 17 0 0
MDSYS.SDO_COORD_OP_PARAM_VALS|PARAM_VALUE_FILE 200 0 0
MDSYS.SDO_GEOR_XMLSCHEMA_TABLE|XMLSCHEMA 1 0 0
MDSYS.SDO_STYLES_TABLE|DEFINITION 78 0 0
MDSYS.SDO_XML_SCHEMAS|XMLSCHEMA 3 0 0
ORDDATA.ORDDCM_CT_PRED_OPRD|SYS_NC00004$ 51 0 0
ORDDATA.ORDDCM_DOCS|SYS_NC00005$ 9 0 0
ORDDATA.ORDDCM_MAPPING_DOCS|SYS_NC00007$ 1 0 0
SYS.METASTYLESHEET|STYLESHEET 178 0 0
SYS.REGISTRY$ERROR|MESSAGE 1 0 0
SYS.REGISTRY$ERROR|STATEMENT 1 0 0
SYS.RULE$|CONDITION 21 0 0
SYS.SCHEDULER$_EVENT_LOG|ADDITIONAL_INFO 182 0 0
SYS.WRH$_SQLTEXT|SQL_TEXT 2,099 0 0
SYS.WRH$_SQL_PLAN|OTHER_XML 1,736 0 0
SYS.WRI$_ADV_ACTIONS|ATTR5 2,726 0 0
SYS.WRI$_ADV_ACTIONS|ATTR6 2,726 0 0
SYS.WRI$_ADV_DIRECTIVE_META|DATA 5 0 0
SYS.WRI$_ADV_OBJECTS|ATTR4 2,278 0 0
SYS.WRI$_ADV_RATIONALE|ATTR5 9,594 0 0
SYS.WRI$_ADV_SQLT_PLANS|OTHER_XML 455 0 0
SYS.WRI$_ADV_SQLT_PLAN_STATS|OTHER 288 0 0
SYS.WRI$_DBU_FEATURE_METADATA|INST_CHK_LOGIC 21 0 0
SYS.WRI$_DBU_FEATURE_METADATA|USG_DET_LOGIC 167 0 0
SYS.WRI$_DBU_FEATURE_USAGE|FEATURE_INFO 16 0 0
SYS.WRI$_DBU_HWM_METADATA|LOGIC 20 0 0
SYS.WRI$_REPT_FILES|SYS_NC00005$ 27 0 0
XDB.XDB$DXPTAB|SYS_NC00006$ 2 0 0
XML CSX Dictionary Tables:
USER.TABLE|COLUMN Convertible Truncation Lossy
Application Data:
USER.TABLE|COLUMN Convertible Truncation Lossy
APPLSYS.BISM_OBJECTS|SYS_NC00023$ 4 0 0
APPLSYS.DR$FND_LOBS_CTX$I|TOKEN_TEXT 0 103 1,260,883
APPLSYS.FND_CONC_PROG_ANNOTATIONS|PROGRAM_ANNOTAT 272 0 0
APPLSYS.FND_OAM_CONTEXT_FILES|TEXT 15 0 0
APPLSYS.FND_OAM_DOC_LINK|DOC_LINK_INFO 1 0 0
APPS.FND_OAM_CONTEXT_FILES_1|TEXT 6 0 0
AZ.AZ_APIS|FILTERING_PARAMETERS 11 0 0
AZ.AZ_SELECTION_SET_ENTITIES_B|FILTERING_PARAMETE 48 0 0
ECX.ECX_DTDS|PAYLOAD 205 0 0
ECX.ECX_FILES|PAYLOAD 91 0 0
IBC.IBC_ATTRIBUTE_BUNDLES|ATTRIBUTE_BUNDLE_DATA 41 0 0
JTF.JTF_HEADER_DTD|HEADER_DTD 1 0 0
JTF.JTF_MESSAGE_OBJECTS|BUS_OBJ_DTD 41 0 0
JTF.JTF_MESSAGE_OBJECTS|BUS_OBJ_SQL 41 0 0
JTF.JTY_TRANS_USG_PGM_SQL|BATCH_DEA_SQL 1 0 0
JTF.JTY_TRANS_USG_PGM_SQL|BATCH_INCR_SQL 5 0 0
JTF.JTY_TRANS_USG_PGM_SQL|BATCH_TOTAL_SQL 6 0 0
JTF.JTY_TRANS_USG_PGM_SQL|INCR_REASSIGN_SQL 5 0 0
JTF.JTY_TRANS_USG_PGM_SQL|REAL_TIME_INSERT 6 0 0
JTF.JTY_TRANS_USG_PGM_SQL|REAL_TIME_SQL 6 0 0
ODM.ODM_PMML_DTD|DTD 1 0 0
OKC.OKC_REPORT_SQL_B|SQL_TEXT 3 0 0
OKC.OKC_REPORT_SQL_TL|HELP_TEXT 2 0 0
OKC.OKC_REPORT_XSL_TL|HELP_TEXT 2 0 0
OKC.OKC_REPORT_XSL_TL|XSL_TEXT 3 0 0
XDP.XDP_PROC_BODY|PROC_BODY 10 0 0
-------------------------------------------------- ---------------- ---------------- ----------------Hi;
Please run below query which could be helpful for your issue:
select * from dictionary where TABLE_NAME LIKE '%NLS%'
select * from dictionary where TABLE_NAME LIKE '%GLOBAL%'
Regard
Helios -
How to find the size of a database?
I'm not an oracle dba but a report developer. I'd like to find out the size of my database.
Is this possible using simple query?francislazaro wrote:
I'm not an oracle dba but a report developer. I'd like to find out the size of my database.
Is this possible using simple query?There are many threads related to the same topic,
http://forums.oracle.com/forums/search.jspa?threadID=&q=How+to+find+the+size+of+a+database&objID=f61&dateRange=all&userID=&numResults=15&rankBy=10001
HTH
Aman.... -
How to increase instance size in oracle bpm 10.3.1
Hi,
anyone please help me how to change instance size in oracle bpm 10.3.1 whenver i amm attaching maximum size file it is giving error
Caused by: fuego.server.exception.MaxInstanceSizeRuntimeException: Max instance size exceeded.
Current size is 69033, whereas the maximum size is 16384. This occurs with instance 'Process1' at activity 'Interactive[Interactive1]' of process '/Process#Default-1.0'
Edited by: user12171025 on Nov 16, 2009 10:13 PMHi,
In the engine configuration in the Execution tab set the Maximum Instance Size that by default is 16Kb.
If you are going to have large values for the instance size probably you have to consider to define the instance variable as separated
Regards -
How to use a parameter passed to stored procedure in cursor?
I am rather new to Oracle stored procedures and I'm sure that
this is rather simple. Could someone tell me how to do the
following: I would like to pass the variable status into my
stored procedure and then use it in the where clause when
defining my cursor. I have the stored procedure working 100%
other than this small detail.
CREATE OR REPLACE PROCEDURE p_report_starwood_exhibita2(hno
VARCHAR2, cid INTEGER, kperiod INTEGER, status VARCHAR2, user
VARCHAR2) IS
BEGIN
DECLARE
CURSOR bid_cursor IS
SELECT bm.hotelid
FROM dbo.bidmaster bm
WHERE bm.channelid = cid
and bm.contractperiod = kperiod
and bm.bidstatus like '&status'
END;
Thank youI am rather new to Oracle stored procedures and I'm sure that
this is rather simple. Could someone tell me how to do the
following: I would like to pass the variable status into my
stored procedure and then use it in the where clause when
defining my cursor. I have the stored procedure working 100%
other than this small detail.
CREATE OR REPLACE PROCEDURE p_report_starwood_exhibita2(hno
VARCHAR2, cid INTEGER, kperiod INTEGER, status VARCHAR2, user
VARCHAR2) IS
BEGIN
DECLARE
CURSOR bid_cursor IS
SELECT bm.hotelid
FROM dbo.bidmaster bm
WHERE bm.channelid = cid
and bm.contractperiod = kperiod
and bm.bidstatus like '&status'
END;
Thank you You can do something like this
CREATE OR REPLACE PROCEDURE p_report_starwood_exhibita2(hno
VARCHAR2, cid INTEGER, kperiod INTEGER, status VARCHAR2, user
VARCHAR2) IS
BEGIN
DECLARE
CURSOR bid_cursor (p_status varchar2) IS
SELECT bm.hotelid
FROM dbo.bidmaster bm
WHERE bm.channelid = cid
and bm.contractperiod = kperiod
and bm.bidstatus like p_status
END;
and then in the BEGIN section do
open bid_cursor(status)
This should work.
Regards
Manoj -
How to check image size in oracle 9i & 10g database
hi,
i have inserted an Image into a table in oracle database & I want to View the Query How to check image size in oracle 9i & 10g database
thanks
Edited by: user8920919 on May 30, 2010 1:43 AMuser8920919 wrote:
hi,
How to check image size in oracle 9i & 10g database
thanksWhat do you mean with "image size"? -
How to find encrypted columns in oracle 10g database
Hi,
How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
my question is apart from this is there anyother views or tables?
Thanks..user602872 wrote:
Hi,
How to find encrypted columns in oracle 10g database? We can see using view dba_encrypted_columns or all_encrypted_columns .
my question is apart from this is there anyother views or tables?Hmm not which I could find,
SQL> select * from dict where lower(table_name) like '%encrypted%';
TABLE_NAME
COMMENTS
DBA_ENCRYPTED_COLUMNS
Encryption information on columns in the database
ALL_ENCRYPTED_COLUMNS
Encryption information on all accessible columns
USER_ENCRYPTED_COLUMNS
Encryption information on columns of tables owned by the user
SQL>HTH
Aman.... -
Find out if a certain Stored Procedure runs
Hi all,
i have to state that i dont have much oracle specific database knowledge but i've spend half a day now gathering information about a certain problem and didnt find any really working solution.
What i want is to be able to find out if a certain stored procedure is currently running (executing) in the database. I need that to be able to prevent a user of my client application from executing a certain procedure more than once in the same time.
I have found some interesting information about the oracle Call Stack (dbms_utility.format_call_stack) but its not as helpfull as i orginaly thought because as far as i can see it only shows which procedures where executed (and are still executing) while the procedure with the dbms_output.put_line(dbms_utility.format_call_stack) command is executing.
But it doesnt show anything about procedures which are running in another instance of SQL*Plus, for example.
I have no other idea at the moment ...
So i hoped anybody in here maybe has an idea or maybe allready a solution.
But ... thanx in anyway =).
With greetings from germany,
Oliver BankelI'm sure there are several solutions.
This is how we solve this problem, not elegant but it works.
We have a table of procs that are running.
Active_Jobs
JOBNAME VARCHAR2(35)
USERNAME VARCHAR2(30)
STATUS VARCHAR2(20)
Then within the proc
job_conflict EXCEPTION;
BEGIN
select count(1) into v_status from ACTIVE_JOBS
where username = USER and status = 1 ;
if v_status > 1 then
RAISE JOB_CONFLICT ;
end if;
INSERT INTO ACTIVE_JOBS (JOBNAME, USERNAME, STATUS)
VALUES ('PROC NAME', USER, 1) ;
COMMIT;
DELETE FROM ACTIVE JOBS WHERE JOBNAME = 'PROC NAME' AND USERNAME = USER ;
COMMIT;
exception
WHEN job_conflict THEN
raise_application_error( -20010,'YOUR MESSAGE HERE');
END; -
How to pass the parameter of a stored procedure to iReport
Hi... i don't know how to pass the parameter of the stored procedure to the iReport.
In the Report Query, i tried
1. sp_storedprocedure ' value'
2. sp_storedprocedure +''''+$P{parameter}+''''+
3. sp_storedprocedure +$V+$P{parameter}++$F($F is a variable having a value of ' (a single quote))may you enlighten us please? thank youFor M$ SQL server I find that it only works when U use the fully qualified name...
e.g. catalod.dbo.my_procedure_name 'variable'
My full query in the Report Query window is something like this:
EXEC arc.dbo.jasper_Invoice 1000
Note that you may find that selecting from VIEWS / TABLES fails for no apparent reason and iReport will prompt you with the usual very unhelpful (we have what we "pay" for) prompt, stating that "The document is empty".
To work around this issue, where a statement like "SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id=1000" does not work, simply create a PROC, something like:
CREATE PROC jasper_MyProc (@my_rec_id integer) AS
SELECT * FROM arc.dbo.acc_invoices WHERE Invoice_id= @my_rec_id integer
...to wrap your SELECT statement, then call the PROC
Edited by: Sylinsr on Apr 22, 2008 4:23 PM
Maybe you are looking for
-
Error while uploading data from a flat file
Hi All, I am trying to load data from a flat file to an ODS. The flat file contains a field, say FLAT01, of numerical type(Type Decimal, Length 18, Decimals 2). I have created an infoobject, say ZIO10, with type CURR and currency field, 0CURRENCY. In
-
Dear sir, Plz i need ur service to clear my doubts.. plz take attention and help me and recover from this problem... with regards chandra
-
Hello We would like to know how to model a commission-agent business model with Order Management. In such an arrangement, the principal delivers (through commissionaire) goods to the customer; commissionaire remits the price received to the principal
-
How do I find trace on Illustrator CS?
I know how to find it on CS6, but i only have access to CS. Can someone please tell me how i can find trace on this version?
-
No sound when recieving a notification.
Im using an IPhone6 but dont get a notification sound when an udate on facebook/twitter is sent to me....email notifications work as do text messages