SQL & PL/SQL :: No Data Found Stops The Loop Action Inside Block?

Jul 1, 2013

I am trying to create an anonymous PL/SQL block to output privilege information for each of the users listed in DBA_USERS In a loop. This is my block so far (not finished):

declare
v_usr varchar2(30);
v_out_header varchar2(100);

[Code]....

The output is as follows:

***User-Role Privilege report***
-----------------------------------
username: ANDREY , profile: DEFAULT
SYSTEM privileges granted directly to the user(not through ROLE) :
no_data_found

A problem I am encountering is that for some users I have no direct privileges that are not granted through roles, And when I have the expression v_qry (which is basically "'select grantee ||'',''|| privilege from DBA_SYS_PRIVS where grantee not in (select role from dba_roles) and grantee ='||'''' ||v_usr||''''") not initialized with values because the select statement retrieved 0 results, I have the process interfered by the no_data_found error/exception.

Questions: how I can preferrably simply, avoid/overcome my problem? Some way to make the loop go on in spite of no data found? maybe something similar to NVL?

View 14 Replies


ADVERTISEMENT

SQL & PL/SQL :: Place Insert Statement In Loop Inside Anonymous Block?

Nov 25, 2012

can we place insert statement in loop inside anonymous block?

CREATE TABLE DEP(DEPTID NUMBER(5) NOT NULL PRIMARY KEY,DNAME VARCHAR2(10),LOCID VARCHAR2(10));
DECLARE
I NUMBER(5);
BEGIN
I := 0;
LOOP
INSERT INTO DEP VALUES(&DEPTID,'&DNAME',&LOCID);
I := I+1;
EXIT WHEN I = 5;
END LOOP;
END;

View 6 Replies View Related

Loop Inside Cursor

Sep 11, 2012

I have a cursor returning some value.

for each value returned by the cursor i need to traverse through 31 rows(1 row per day * no of days in the month).

E.g. if cursor returns service_name as xyz then for xyz there can be 31 rows(service may not be used on some days)

I need to go to all of them and take some values and move them to a flat file. how should that be done?

Attached File(s)
Query.png ( 20.99K )
Number of downloads: 9

View 1 Replies View Related

SQL & PL/SQL :: Execute Immediate Inside A WHILE Loop

Jan 6, 2011

I have a dynamic query which i want to run till it return zero records.

I am using WHILE loop for that but it is giving compilation error:

The query is

execute immediate ' Delete from tbl_archive_trade_list
where deal_id in (
select deal_id from tbl_archive_trade_list where trade_id in (
select trade_id from ' || main_trade_group_table || ' where tradegroup_id in (
select tradegroup_id from ' || main_trade_group_table || ' a , tbl_archive_trade_list b

[Code]...

I want to run this Query in While loop till the above command return 0 records.

I tried giving the above statement inside WHILE loop but it is failing.

Without the WHILE loop the above statement works fine and executed properly.

View 5 Replies View Related

SQL & PL/SQL :: Query Inside For Loop

Nov 3, 2011

i am trying to do something the following .. but I can't get the syntax correctly for the select statement inside the secondary_loop ...

EmailBodyHTML := '';
main_loop := '';
secondary_loop := '';

[Code]....

View 4 Replies View Related

SQL & PL/SQL :: Variable Value Not Displaying Inside Loop

Jul 8, 2011

I have below peice of SQL,Im trying to form the P_attribute1 value by using the Loop index(i) but the P_attribute1 value which i assigned in declaration not displaying in the output.

DECLARE P_attribute1 VARCHAR2(100) := '110000027';
P_attribute VARCHAR2(100);
l_cnt NUMBER := 10;
v_buffer VARCHAR2(500);
v_buffer1 VARCHAR2(500);
BEGIN
FOR i IN 1 .. l_cnt
LOOP
v_buffer := v_buffer || '' || 'P_attribute' || i || '' || '!';
END LOOP;
dbms_output.put_line('v_buffer :' || v_buffer);
END;
v_buffer :P_attribute1!P_attribute2!P_attribute3!P_attribute4!P_attribute5!P_attribute6!P_attribute7!P_attribute8!P_attribute9!P_attribute10!

View 6 Replies View Related

SQL & PL/SQL :: Bulk Collect Inside A Loop?

Mar 8, 2012

I have a select..bulk collect into clause which is inside a for loop as the query gets a parameter from the loop, Then, how to extend the collection rows for each iteration.

My collection is of a sql object type.

View 5 Replies View Related

Application Express :: Display Not-found.png For Image Type When Data Not Found?

May 22, 2013

I have an Image Type on a forum page. I want a default "not-found" image to display if the BLOB column value is null or if there is no data for that search value. The image is stored with the app: #APP_IMAGES#not-found.png

APEX 4.2 (with listener) on Oracle 11gR2

View 10 Replies View Related

SQL & PL/SQL :: How To Use Desc Inside Block

Aug 1, 2011

how to use desc inside pl sql block?

View 16 Replies View Related

SQL & PL/SQL :: Loop Through Records Using Block?

Nov 8, 2011

How do I loop through a Input parameter (varchar_table) and pass the input value to a select query.

Procedure Test
(
param1 IN dbms_sql.varchar2_table
)

[Code]....

1. How do I define temp_tbl and is it a best practice to use temporary table - if not what is the best method to do the same.

View 5 Replies View Related

SQL & PL/SQL :: Cursor Declaration Inside Block?

Jun 30, 2011

I can't understand the following cursor declaration (inside the DECLARE of a PL/SQL block)

CURSOR c_emps IS
SELECT emp_large_ot(empno, ename, job, mgr,hiredate, sal, comm, deptno) FROM emp_large;
emp_large_ot is an object type created as
CREATE TYPE emp_large_ot AS OBJECT
( empno NUMBER
, ename VARCHAR2(10)
, job VARCHAR2(9)

[code]...

and emp_large is similar to the standard emp table

View 3 Replies View Related

SQL & PL/SQL :: Select On Dba_pending_transactions Inside Block?

May 14, 2011

While writing a procedure I went into this problem. Whenever I write Query : Select * from dba_pending_transactions It works fine.

But whenever I use same Select Query inside PL-SQL block it gives error Table or view not exist. Dba_pending_transactions is view.

SQL> declare
2 v_count number(2);
3 begin
4 execute immediate 'select count(*) from dba_ending_transactions' into v_count;
5 dbms_output.put_line(v_count);
6 end;
7 /
declare
*
ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at line 4

Same error I get when i use it inside a procedure.

View 2 Replies View Related

PL/SQL :: Add Another FETCH INTO Statement In While Loop Block

Jul 12, 2012

I execute the below code in TOAD.

DECLARE
CURSOR c1
IS
SELECT *
FROM tab
WHERE ROWNUM < 5;
[code]....

If I add another FETCH INTO statement in the while loop block ,I will get the output.why I am getting this error exactly and how another FETCH INTO is preventing it.

View 10 Replies View Related

PL/SQL :: Dynamic Execution Of Block Inside Trigger?

Jan 3, 2013

Im using the following oracle database.

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production

I have one problem in trigger execution. I have a small plsql block in trigger and, I want to execute it as a dynamic way. but it is giving the error. Please find the trigger code. Here my intension is that, the column name used in trigger should be dynamic. In future, if I want to switch the column name, I have to do without modification in trigger.
The error im getting is "ORA-01008: not all variables bound".

CREATE OR REPLACE TRIGGER ETM_AR_IU
AFTER UPDATE ON
EXTERNAL_MAPPING
REFERENCING NEW AS NEW OLD AS OLD
FOR EACH ROW

[code]...

View 17 Replies View Related

Application Express :: 4.2.1 Dynamic Action Definition True Action Settings Not Visible

May 16, 2013

im working with apex 4.2.1 and when i try to define a Dynamic action on any item, if the action type is "Set Value" or execute SQL/Javascript code it should appear a text field that let me define the action taking place. However this wont do..

this is what happens:

And this is what should happen:

I know that patch 4.2.2 solves some issues regarding dynamic actions but in the bug report there's no reference to such a problem.

View 1 Replies View Related

Performance Tuning :: Tablespace With Different Block Size Inside Same Database?

Nov 25, 2011

All the analysis till now on our system proves that our system is clearly I/O bound and db sequential read is the biggest culprit.

We have even identified the index which is being affected by sequential read. I am thinking of creating a new tablespace with 32K blocksize (currently all table spaces are 8k) and migrate this index to the new space. That way, Oracle will have to do less number of reads to get the required data.

But is there anything wrong in having just one tablespace with a differnt block size? Or is there anything that I have to be watchful about while doing it?

View 14 Replies View Related

Server Administration :: Block Corruption - Segment Not Found

May 16, 2012

I have a database where view v$database_block_corruption shows a corrupted block

SQL> select * from v$database_block_corruption;

FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO
---------- ---------- ---------- ------------------ ---------
4 756652 1 5.5157E+12 CORRUPT

I am not able to get the relevant segment from the above information

SQL> select segment_name, segment_type, owner
2 from dba_extents
3 where file_id = 4
4 and 756652 between block_id
5 and block_id + blocks -1;

no rows selected

DBVERIFY Summary
DBVERIFY - Verification complete
Total Pages Examined : 3932160
Total Pages Processed (Data) : 3119107
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 755048

[code]....

I have uploaded the complete logfile.

Below is a part of logfile

DBVERIFY - Verification starting : FILE = /prd/dvp/ora/oradata/LHF/disk06/gds_t01_01.dbf
Block Checking: DBA = 21728172, Block Type = KTB-managed data block
**** kdxcoavs = -84 < 0, avail = 3129
---- end index block validation
Page 756652 failed with check code 6401
##not here that 756652 is the same block# mentioned in v$database_block_corruption

here i tried finding the OBJECT ID as below

SELECT dbms_utility.data_block_address_block(21728172) "BLOCK", dbms_utility.data_block_address_file(21728172) "FILE" FROM dual;
BLOCK FILE
---------- ----------
756652 5

Now for the same BLOCK it is giving different File, again the segment_name or segment_id could not be found from the above information.

View 4 Replies View Related

Server Administration :: ORA-04030 - Split From Tablespace With Different Block Size Inside Same Database

Nov 26, 2011

i written this code i m facing ORA-04030: out of process memory when trying to allocate 16408 bytes error

/* Formatted on 2011/11/26 11:52 (Formatter Plus v4.8. */
DECLARE
row_id varchar2(50);
v_batch_id temp.batch_id%TYPE;
v_slab_id temp.slab_id%TYPE;
flag NUMBER (2);
num varchar2(50) := &row_id;

[code].....

View 1 Replies View Related

Forms :: Multi Data Block And Checkbox Field Based On Control Block

Nov 19, 2010

i have multi data block filed. and checkbox field which based on control block...My task is when i check checkbox only one field should enabled and my mouse goes to that field

e.g

item11 item21 item31 chkbox1
item12 item22 item32 chkbox2

Scenario like this :

My item field based on data block and checkbox based on control block,while i checked chkbox1 , only item31 on that current record should be enabled and i changed value only on that field

when i checked chkbox1 , my cursor goes to item31...not item32

View 12 Replies View Related

Current Action Vs Action In

Oct 22, 2013

ApplicationCurrent SQLbxaptxn8wf54jCurrent SQL CommandSELECTLast Call Duration26:7 (mm:ss)
SQL TraceDISABLEDCurrent SQL Trace Level1Trace With Wait InformationDISABLEDTrace With Bind InformationDISABLED
Open Cursors71ProgramUnavailableServicePRODCurrent ModuleIEUSEUWQCurrent ActionFRM:JOSONC1:RBI Collections Ag.

The above is from dbconsole - it shows the "current module" and the "current action".

 GeneralModuleIEUSEUWQActionFRM:VICKERYJ:RBI

Collections AgeParsing SchemaAPPSPL/SQL Source (Line Number)Not ApplicableSQL Profilen/aSQL Plan Baselinen/a  The above is also from the same module, but this time we have "action". 

What would be the difference between "action" and "current action"?? I have checked several documents, such as URL....which deal with "action", but nothing to reference "current action" 11.2.0.3RHEL 5.5

View 2 Replies View Related

TNSListener Service Stops Automatically?

Apr 7, 2011

In our production server, TNSListener Service stops automatically, atleast (once in a day). No alert in alert log file.

View 1 Replies View Related

Oracle 10G Listener Stops Automatically

Mar 8, 2011

We have installed Oracle 10G in windows 2003 server. Oracle is working fine when oracle services are running in local system account, when we change the option �Log On As� from local system account to an domain id the oracle listener stops automatically.

I tried the below mentioned options, We created a new listener it did not worked . we are able to connect the db through command prompt but not through SQL plus or TOADWhen we add the domain id to the local administrator group the oracle is working fine. But we cannot have the domain id in local administrator group since GPO will automatically remove the domain id from local administrator group.

View 2 Replies View Related

SQL & PL/SQL :: Getting Next Data With Loop

Jun 14, 2013

This query that I pasted is working correctly.Let's say a case has 4 owners, it finds me the first owner and show me its address.

However, I want to execute this query for all owners so it should jump the previous owner it found. Lets say for that example that the loop ends at 4.
How may I fix this problem so that the loop do not return always the first owner but it keeps getting 1,2,3,4...also I should increase the sequence value for each situation

SELECT
DECODE(BREINV.NAMEKEY, NULL,'0','1') "BRE_INV",
DECODE(BREINV.NAMEKEY, NULL,' ',BREINV.SEQUENCE) "BRE_NUMINV1",
DECODE(BREINV.NAMEKEY, NULL, ' ', DECODE(BREINV.SEQUENCE,NULL,NULL,RTRIM(ADDINV.FORMATTEDADDRESS,CHR(0))||CHR(13) || CHR(10) ||'Citizen of ' ||SUBSTR(PAY.COUNTRYDESCRIPTION,1,30))) "BRE_NOMINV",
INDIVIDU.FIRSTNAME || ' ' || INV.NAME "BRE_NOMPREINV"
[code].......

View 3 Replies View Related

Installation :: Oracle 10g Client - Progress Bar Stops At 80 Percent

Jul 18, 2012

I was installing Oracle 10g Client on my PC. But after Specifying Home Details, I was unable to proceed. The installation hangs in the Loading Product Information form.

The Progress bar stops at 80%.

View 3 Replies View Related

SQL & PL/SQL :: For Loop - Inserting Data?

Mar 7, 2012

create table stg1(x number, y number);
create table stg2(x number, y number);
create table stg(x number, y number);

I want to insert data from stg1, stg2 into stg

Instead of writing two insert statements, I want to write only one in a for loop to insert data into stg from stg1 and stg2

I tried this
begin
for i in 1..2 loop
insert into stg(x,y) select stgi.x, stgi.y from stgi;
end loop;
end;

it gives me table does not exist error:

so by stgi, i mean it should take stg1, stg2 etc

View 4 Replies View Related

SQL & PL/SQL :: ORA-01403 / No Data Found

Aug 10, 2010

I have a problem with a package that generate reports.

ORA-01403: no data found

This is the first error rule.

p_pte_tab( r_sales.product_type ).shipped_units := p_pte_tab( r_sales.product_type ).shipped_units + r_sales.shipped_units;

From the next procedure (the whole package is a bit too large to post) :

procedure sales_report_2hnd( p_running_date date )
is
cn_procname constant varchar2(61) := 'sales_report_2hnd';
t_error_rec bol_exceptions.error_rec_type;
cursor c_rpt
is

[code]....

I thought there was a NULL record for shipping units but thats not the case.

View 5 Replies View Related

PL/SQL :: ORA-01403 / No Data Found

Aug 3, 2012

I'm using Oracle database10g.

I have a table called T1 with column C1

ORA-01403: no data found.

I know when I create a trigger I reference the new and old values using :NEW.C1 & :OLD.C1.

What about of the value is not changed and I still want access it what is the syntax.

View 2 Replies View Related

SQL & PL/SQL :: Null Value - No Data Found

Dec 8, 2011

I'm making PL/SQL function. Slice of

dbms_lob.append(temp_clob,to_clob(' <property>'||crlf));
fol:=lb_folios.get_chap1_sec1(folioid);
fetch fol into recid,rec_nr,text,shares,obj_size,monetary_sum,rec_status;
if fol%found then
dbms_lob.append(temp_clob,to_clob(' <chap1_sec1>'||crlf));

[Code]....

And I have error on "select jnl_id into jid" this line. And the error text is "no data found". And I know that there is no data in the table column jnl_id.

View 7 Replies View Related

Reports & Discoverer :: Oracle Report Builder 11g Stops When Destype Is File

Jul 9, 2013

In Oracle Report Builder 11g whenever i set destype to file report Builder Stops.

View 15 Replies View Related

Forms :: Webutil EXCEL Download CLIENT_OLE2 Stops When Create Object

May 22, 2010

When Running forms on local machine I successfully download data to excel. But when I place this to server (unix), the forms stops in this line: application := Client_OLE2.create_obj('Excel.Application');

I think I have no problem with webutil setup or signing it including the jacob because another form is running on server with webutil functions loading and downloading images (pdf).

The problem is why when it comes to excel I have this issue. When I run the form and the code mentioned above is encountered, the program stops. What I have on java console are:

Loading http://59.0.0.132:7778/forms/java/frmall_jinit.jar from JAR cache
Loading http://59.0.0.132:7778/forms/java/frmwebutil.jar from JAR cache
Loading http://59.0.0.132:7778/forms/java/jacob.jar from JAR cache
proxyHost=null
proxyPort=0
connectMode=HTTP, native.
Forms Applet version is : 10.1.2.0

[code]....

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved