SQL & PL/SQL :: Procedure Compiled Successfully But Not Show Result

Aug 17, 2010

I made one code for understanding purpose its complied successfully, but not show result...its give me message procedure successfully completed.

Code is :

BEGIN
For emp_rec in (SELECT * FROM EMP)
LOOP
DBMS_OUTPUT.PUT_LINE(emp_rec.ename);
END LOOP;
END;
/

View 4 Replies


ADVERTISEMENT

When Are Statements Within Stored Procedure Compiled

Jul 23, 2010

connect the following concepts/information I've been collecting. This is not my field but I'm interested in filling some of mine conceptual/technical gaps.

From a JDBC perspective, one of the benefits of Prepared (and so Callable) statements have over the regular ones is that the statement is "compiled"(*) once and then reused (performance gain).

(*) for SQL statements: building of parse tree and exec.plan

In which way can this notion be extrapolated to invocation of Oracle Stored Procedures through CallableStatements? (After clearing my doubts, I may end concluding that the only relevant feature of CallableStatements is their capacity to deal with stored procedure invocations)

According to procedure's precompiled execution plan SQL compilation implies execution plans generation PL/SQL compilation implies P-code generation and, SQL statements (from PLSQL code) are treated no differently by Oracle than SQL from Java or C/C++. These SQLs will be parsed and execution plans for those SQLs created.
...
When the PL code executes the SQL statement, only then does the SQL engine receive the SQL, parse it, and create an execution plan for it.

Therefore, even when the stored procedure can be parsed and cached in SGA (through the OracleConnection.preparedCall("proc") invocation), the SQL statements won't be effectively compiled until they are executed, right? And going deeper, will those SQL statements be cached to be reused in future invocations of the containing stored procedure? Is this a characteristic of the regular stored procedure execution in Oracle? or is it due to the CallableStatement "origin"?

View 2 Replies View Related

SQL & PL/SQL :: How To Check Procedure Compiled Warnings And Errors

Sep 26, 2013

I have compiled some procedures, at the time of compilation i saw some warnings & errors but i did not notice, Now can we see that errors or warnings in db console or any other way.

View 7 Replies View Related

PL/SQL :: Valid Objects Need To Be Compiled While Running Packaged Procedure

Aug 8, 2012

I have a requirement to create a packaged proc which lists down a set of database objects and its statuses whenever the status of objects is changed as valid/invalid in user_objects. Also, those valid objects need to be compiled while running the packaged proc.

View 5 Replies View Related

SQL & PL/SQL :: Writing Procedure In User 2 Schema Accessing Table Product - Not Compiled?

Dec 17, 2010

I have got 2 users as user1 and user2.I have used the following statements from user 'user1':

create role GENEVAOBJECTS;
grant select, insert, update, delete on PRODUCT to GENEVAOBJECTS;
grant GENEVAOBJECTS to user2;

In the above statements, product is a table. Now, I could able to access this table from user 'user2'. But however if I write a procedure in user2 schema accessing the table product, then the procedure is not getting compiled.

create or replace procedure test_prc as
v_test number(9);
begin
select product_id into v_test
from PRODUCT where rownum=1;

[code]...

why I cannot access that table from procedure?

View 8 Replies View Related

PL/SQL :: O/P Not Displaying While Procedure Is Successfully Executed?

Apr 4, 2013

I m executing below PLSQL procedure . Its getting executed successfully but not displaying the O/P. I have set serveroutput on also.

set serveroutput on

DECLARE
   lc_file_handle        UTL_FILE.file_type;
   lc_file_dir           VARCHAR2 (100);
   lc_file_name          VARCHAR2 (50);
  
[code]...

View 14 Replies View Related

SQL & PL/SQL :: Procedure Successfully Completed But Not Able To View The Data

Sep 26, 2010

I've created one procedure with following code.

PROCEDURE MaxNo IS
A Number;
BEGIN
Select Max(Supplier_ID)+1 into A from supplier ;
END;
SQL> Select Max(Supplier_ID)+1 from supplier;
MAX(SUPPLIER_ID)+1
------------------
6

when I execute it in a SQL PLus

SQL> SET SERVEROUTPUT ON
SQL> exec MaxNo;

PL/SQL procedure successfully completed.

View 4 Replies View Related

SQL & PL/SQL :: Show Result Random

Mar 24, 2010

I run follwing query.

select * from crp_00_08

it shows result like

BAS_CODBAS_DES

1MAIN GATE (FRONT)
2NEAR MILL # 3, 3-1
3NEAR MILL # 3, 3-2
4NEAR MILL # 3, 3-3

[Code]...

i want that when i run above query every time bas_cod column should start with difference value. now it is starting from 1, i need when i run next time it should start with another number except 1,

i mean whenever i run above query,order of bas_cod must be change from last.

how can i do it.

View 12 Replies View Related

Client Tools :: Remove / Prevent PL/SQL Procedure Successfully Completed Message

Aug 20, 2010

I do not want the "PL/SQL procedure successfully completed." message in my output file - I don't see/recognise an option to suppress or remove this.

-- Test Proc
--
set linesize 500
set pagesize 50000
set tab off
set wrap off
set serveroutput on
set feedback on
[code]...

PL/SQL procedure successfully completed.

View 2 Replies View Related

SQL & PL/SQL :: Show Result Of Query Just Like Pivot Table?

Jul 20, 2011

me in building a query. I want to show the result of the query just like pivot table.
Test case
CREATE TABLE CPF_YEAR_PAYCODE
(
CPF_NO NUMBER(5),
INC_DATE DATE,
PAYCODE_TYPE CHAR(1 BYTE),

[code]...

I want that my query should look like the format as attached in the xls sheet.

View 1 Replies View Related

Client Tools :: Different Charactersets Show Line-break In Select Result

Mar 22, 2010

i have a little curiosity in result of a select statement.

One database has following characterset settings:

NLS_CHARACTERSET WE8ISO8859P15
NLS_NCHAR_CHARACTERSET AL16UTF16

and the following select statement results in multiple lines:

SQL> select INSTANCE_NAME,STATUS from v$instance;
INSTANCE_NAME
------------------------------------------------
STATUS
------------------------------------
BUP
OPEN

Another database has following characterset settings:

NLS_CHARACTERSET UTF8
NLS_NCHAR_CHARACTERSET AL16UTF16

and the same select shows only a 2 line result:

SQL> select INSTANCE_NAME,STATUS from v$instance;
INSTANCE_NAME STATUS
---------------- ------------------------------------
HPSMP OPEN

Both databases are version 10.2.0.4 and both are running on HPUX 11.31.Why do we get this differents in showing the result?

Our problem is that the package-start scripts from HP, to start a database, check the result of the select statement above and if we have the multiline result the check gives an error and stops the package again.

View 3 Replies View Related

SQL & PL/SQL :: Get Result Set Back From Stored Procedure?

Apr 9, 2012

I come from a world of MSSQL and have been thrown into doing some Oracle work. Great! Ok, moving on.. I work in an environment where I do not have direct access to the database tables that I need data from. As a workaround, I have been asked to create a stored procedure that will be loaded into our CRM system's production db once it goes through the internal "approval" process.Basically, I need to return a result set back to the client by calling a stored procedure.

Version 1 of this that was already in place was done with the following code.

procedure events_by_day (p_start_date IN OPERATION_LOG.DT%type,
p_end_date IN OPERATION_LOG.DT%type,
p_results OUT SYS_REFCURSOR) IS
BEGIN
OPEN p_results FOR

[code]....

Then the code is executed from the client side like so:

events_by_day(p_start_date => to_date('2012-3-27 00:00:00', 'YYYY-MM-DD HH24:MI:SS'),
p_end_date => to_date('2012-3-29 23:59:59', 'YYYY-MM-DD HH24:MI:SS'),
p_results => r_cursor);
LOOP
FETCH r_cursor
INTO event_date, event_acct_no, event_type, event_count;

[code]....

As you can see, a SYS_REFCURSOR was used in this case to pass the data back.

View 3 Replies View Related

PL/SQL :: Compare 2 Result Sets In Procedure

Apr 17, 2013

I have two queries. One selects 5 values (all number datatypes), the second query selects 2 values (both number datatypes).If a value from query 2 exists in the resultset of query 1 - go make table updates using the second value in the select statment of query 2. If there is not a match, update a table with values from query 1.

Currently, I have two cursor for loops, which are nested. This works but of course is horribly slow. What is a better way to process this data?The number of rows varies between the two resultsets.

Oracle 11.2.0.3.2

View 7 Replies View Related

Application Express :: To Change The Default Behavior Of Hide / Show Region To Show

Jun 26, 2012

I am trying to change the default behavior of Hide/Show Region to show, after some attempts i got it partially working but now clicking the icon to toggle hide/show doesn't work also changed the icons and added type="" but its not working.

View 16 Replies View Related

PL/SQL - Wrote Code Successfully But Cannot Bulk Update It?

Dec 15, 2008

Has 2 tables with the following columns

1.abc_y (notes,frmt)
sample data:
notes:
i live in texas and work in AIG.

2.abc_z(tags_name)
sample data:
tags_name:

live in work.We shoud look for tags_name in notes field of abc_y. If we encounter any tags_name in notes field they should be removed and inserted in frmt field Now the column format should be updated to 'i texas and AIG'.abc_y has 2 million rows and abc_z has 120 rows.wrote the code sucessfuly but cannot bulk update it, which is really needed for me.

I am havin some problm in FOR LOOP after FORALL in the folowing.

DECLARE
l_sql_strng VARCHAR2 (20000);
TYPE var_tab IS TABLE OF VARCHAR2 (20000)
INDEX BY BINARY_INTEGER;
l_text_arry var_tab;
CURSOR c1

[code]...

View 1 Replies View Related

Forms :: File Successfully Transferred To Database

Jun 3, 2010

I have one problem. i am using client_to_db function to store the file to database table.During upload of file,System showing me message "File successfully transferred to database". but when i am downloading the file from database, its not working.

View 5 Replies View Related

Reports & Discoverer :: Report Successfully Generated Or Not?

May 24, 2010

how to know that report is generated successfully because i want to one flag only if report is generated successfully other wise no need.

View 3 Replies View Related

Statement Separate In SQLPlus / It Successfully Returns Schema

Mar 28, 2008

I am running this statement in a Java DAO and it results in an SQLException. I'm trying to get the DB schema. If I run this statement separate in SQLPlus, it successfully returns the schema. Why this is failing in my Java program?

ResultSet r = s.executeQuery("SELECT sys_context('USERENV', 'CURRENT_SCHEMA') FROM S_DUAL;");

View 5 Replies View Related

Server Utilities :: Send Email After Export Done (successfully Without And With Error )

Jun 16, 2011

I have a ORACLE 10g(10.2.0.1.0) database that I am running on windows. I have export backups batch file running every day through windows scheduler. I would like to know If there is some way that sends me an email after the backup is finished and also send me if it does not finish with error.

I have successfully done this om my SQL Server machine but don't know for ORACLE as I have not purchased it and have license

View 16 Replies View Related

Server Utilities :: Dump - Export Terminated Successfully With Warnings

Dec 6, 2012

When i do run export command through command prompt, its shows below error.

Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-2001 Microsoft Corp.

C:Documents and SettingsAdministrator>Exp disdeva/disa123@distesta file=D:DAI LY_BACKUPdistesta.dmp log=D:DAILY_BACKUPdistesta.log statistics=none buffer=5 000000 owner=distesta

Export: Release 10.2.0.3.0 - Production on Thu Dec 6 15:06:21 2012

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Release 10.2.0.3.0 - Production Export done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
server uses AL32UTF8 character set (possible charset conversion)

About to export specified users ...

EXP-00010: DISTESTA is not a valid username Export terminated successfully with warnings.

C:Documents and SettingsAdministrator>

When i connect from sqlplus, it doesn't give any erro. What could be the reason?

SQL> conn disdeva/disa123@distesta
Connected.
SQL>

View 8 Replies View Related

Data Guard :: How To Delete Archivelog In Standby Database When Applied Successfully

Aug 20, 2008

How to make the automatic deletion of all the archivelogs when it is applied successfully on the standby database? We have 1 primary database and 1 standby database using oracle physical dataguard.

In the primary database, we have daily backup job so that the applied archivelogs are deleted automatically, no problem

But in the standby database ( physical standby) I have to go there and delete manually because I don't issue backup on this database. Is there any solution for this problem.

View 3 Replies View Related

Application Express :: Running Jquery Code After Button Submits Successfully?

Jan 27, 2013

running a jquery code after submit button has successfully completed, how do i integrate these 2 events ? clicking the submit button and if submits successfully execute the small jquery code based on the same submit button

View 33 Replies View Related

Server Administration :: Event Alert Created Successfully On Custom Table But Not Firing?

Mar 8, 2013

I have created custom table in inventory and after register table & columns, i create event alert on it. event alert is not firing.

View 1 Replies View Related

Reports & Discoverer :: 11g Printing Error - Report Generated Successfully But Distribution To Destination Failed

Jul 10, 2010

when I am trying to send report for prints then I received this error.

"
REP-57054: In-Process Job terminated: The report generated successfully but distribution to destination failed.
REP-50159:The report generated Successfully but distribution to destination failed.
REP-50151: Destination ID Currency failed with error An error occured while sending the file to the printer :HPofficejetpro7700Series- Cannot run program "COrcaleMiddlewareasinst_5Config
eportsin
wlpr":

create process error=2, The system cannot fine the file specified."

View 6 Replies View Related

Unix Command Run Successfully Through PL/SQL But Showing No Impact In UNIX?

May 19, 2007

I am using Oracle 9i and Unix on my system and trying to execute a UNIX shell command through external procedure in C.I created a shared lib (libextproc.so) for the following function.

int sysrun(char *command)
{
return system(command);
}

This function runs fine when caled through a driver function in C, meaning that the shared lib is fine.In PL/SQL, I have used the following method to invoke a UNIX command:-
create or replace library shell_lib as '/home/ECETRAonsite/oracle/OraHome1/lib/libextproc.so';
/
create or replace function sysrun (syscomm in varchar2)
return binary_integer
as language C
name "sysrun"
library shell_lib
parameters(syscomm string);
/

Now when I call this PL/SQL function to invoke the command, it is run succesfully but does not create the file.

SQL>
1 declare
2 rc number;
3 begin
4 rc := sysrun('/bin/touch /home/ECETRAonsite/oracle/OraHome1/test/sach');
5 dbms_output.put_line('Return Code='||rc);
6* end;
SQL> /
Return Code=0

PL/SQL procedure successfully completed.I have verified that the path for 'touch' is correct.Following are my configuration files.
listener.ora
-------------
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =

[code]...

View 1 Replies View Related

Backup & Recovery :: RMAN Backup Successfully?

May 29, 2013

when I execute this rman backup script

run{
allocate channel d1 type disk;
allocate channel d2 type disk;
backup as compressed backupset incremental level 0 filesperset 4 database;
backup as compressed backupset incremental level 0 archivelog all delete all input;
release channel d1;
release channel d2;
};

it throws a error RMAN-00558 etc. in the end.

Description in alert_orcl.log:

Wed May 29 14:10:21 2013
Thread 1 cannot allocate new log, sequence 129
Private strand flush not complete
Current log# 1 seq# 128 mem# 0: D:ORACLEPRODUCT10.2.0ORADATAORCLREDO01.LOG
Thread 1 advanced to log sequence 129
Current log# 2 seq# 129 mem# 0: D:ORACLEPRODUCT10.2.0ORADATAORCLREDO02.LOG

backup successfully? What does the description represent?

View 7 Replies View Related

PL/SQL :: How To Write Procedure To Load Data Into Table Using XML File As Input To Procedure

Sep 20, 2013

how to write procedure to load the data into a table using xml as input parameter to a procedure and xml file is as shown below which is input to me. 

xml version="1.0"?><DiseaseCodes><Entity><dcode>0</dcode><ddesc>(I87)Other disorders of veins - postphlebitic syndrome</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J04)Acute laryngitis and tracheitis</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity><Entity><dcode>0</dcode><ddesc>(J17*)Pneumonia in other diseases - whooping cough</ddesc><claimid>34543></claimid><reauthflag>0</reauthflag></Entity></DiseaseCodes>.

View 3 Replies View Related

SQL & PL/SQL :: Exception In Procedure / Created One Procedure Based On One Table Item Master

Mar 6, 2010

I have created one procedure based on one table item master which has a field called item stock or non stock based on this i will fetch data from one of two tables .If its a stock item data will be retrieved from wip_main_acnt table and if its non stock it will pick from ns_main_acnt.my procedure is working fine but all i need is i just want to put an exception that if data is not found in one of the table based on the item selected.I am confused which one to be used whether no_data_found or notfound%.

CREATE OR REPLACE PROCEDURE dflt_pr_acnt (
l_item_code IN VARCHAR2,
l_main_acnt_code OUT VARCHAR2
)
[code]....

View 8 Replies View Related

SQL & PL/SQL :: Show Last 4 Digits

Mar 4, 2010

I have a requirement where I have a value stored in varchar2(12), and no matter what the size of data, I should mask all the characters except the last 4

eg: - 23115645

after masking should be - xxxx5645,

create table test1(x varchar2(12))
insert into test1 values('34567745')
/
insert into test1 values('438765311')
/
insert into test1 values('1112345')
/
commit

[Code].....

y should store value of x in such a way that no matter what the size of x is (7 characters or 9), we should see only the last 4, but the remaining should be masked with xxxx

I tried the above update, but using substr, i am able to get this if x has 9 characters

not sure how to achieve this if x has 7, or 4 characters

View 22 Replies View Related

SQL & PL/SQL :: Row Value Show In Column Wise

Mar 1, 2012

I have a table which have three column.

1) empid
2) date
3) status

I want to show the value empid intime outime.

select in1.empid,in1.atttime,out.atttime from (select empid ,atttime from attend
where status=1 and to_char(atttime,'mmyyyy')='022012' order by empid,atttime desc) in1,
(select empid,atttime from attend where status =0 and to_char(atttime,'mmyyyy')='022012'
order by empid,atttime desc) out
where in1.empid=out.empid and in1.empid='02256'
order by in1.atttime,out.atttime

But this query do .one value relation with all column.means first february in time with all out time.

View 1 Replies View Related







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