Hi All,
I have this strange problem. I am user of two different database (both are same version 9i). I created a procedure and within this procedure i used a cursor to select the values, this is working very fine.
When i copy this procedure in other database and try to run the procedure, the procedure runs successful, but the cursor does not populate the values, when i run the query written in the cursor, query returns the correct values.
Another interesting thing is that when i run the cursor not within procedure it runs successfully but when i try to use within procedure it does not work.
Another thing is that if i run the same procedure with cursor but omitting the where clause the procedure works fine again, but with where it does not populate the values in the cursor and cursor row count is = 0.
Anyone have the answer please.
CREATE OR REPLACE PROCEDURE proc_dps_check
as
PM_TABLE_NAMES VARCHAR2 (50);
CURSOR pmC IS SELECT LOWER(RTRIM(LTR IM(tname))) AS v_TABLENAME FROM dps_prc;-- WHERE LOWER(RTRIM(LTR IM(tname))) IN (SELECT LOWER(RTRIM(LTR IM(TABLE_NAME)) ) FROM ALL_TABLES WHERE OWNER = 'TEST');
BEGIN
FOR I IN PMC LOOP
Dbms_Output.PUT _LINE(I.v_TABLE NAME);
--Code goes here...
--COMMIT;
END LOOP;
END;
Thanks.
2 3880
HI ALL,
I HAVE FOUND THE PROBLEM, AND IM RESOLVING IT. THANKS
Hi All,
I have this strange problem. I am user of two different database (both are same version 9i). I created a procedure and within this procedure i used a cursor to select the values, this is working very fine.
When i copy this procedure in other database and try to run the procedure, the procedure runs successful, but the cursor does not populate the values, when i run the query written in the cursor, query returns the correct values.
Another interesting thing is that when i run the cursor not within procedure it runs successfully but when i try to use within procedure it does not work.
Another thing is that if i run the same procedure with cursor but omitting the where clause the procedure works fine again, but with where it does not populate the values in the cursor and cursor row count is = 0.
Anyone have the answer please.
CREATE OR REPLACE PROCEDURE proc_dps_check
as
PM_TABLE_NAMES VARCHAR2 (50);
CURSOR pmC IS SELECT LOWER(RTRIM(LTR IM(tname))) AS v_TABLENAME FROM dps_prc;-- WHERE LOWER(RTRIM(LTR IM(tname))) IN (SELECT LOWER(RTRIM(LTR IM(TABLE_NAME)) ) FROM ALL_TABLES WHERE OWNER = 'TEST');
BEGIN
FOR I IN PMC LOOP
Dbms_Output.PUT _LINE(I.v_TABLE NAME);
--Code goes here...
--COMMIT;
END LOOP;
END;
Thanks.
Hi
BilalGhazi
Welcome to TSDN.
You have reached the right place for knowledge shairing.
Here you will find a vast resource of related topics and code.
Feel free to post more doubts/questions in the forum.
But before that give a try from your side and if possible try to post what/how you have approached to solve the problem.
It will help Experts in the forum in solving/underestanding your problem in a better way.
Please follow the posting guidelines in every new post/reply.
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Chris Botha |
last post by:
The machine is running XP Pro with all the latest service packs, etc. I must
access an Oracle database so I installed the Oracle client stuff. I can
query Oracle from a Windows app, no problem. Using the exact same code (copy
and paste) into a Web app I get the following error "Error while trying to
retrieve text for error ORA-01019". Security I thought, so I use
Impersonation on the Web site, then the aspnet_wp.exe crashes with "The...
|
by: André Nobre |
last post by:
I don't know if this is the right place to make this question, so, if
isn't, let me know...
I have an oracle package with some procedures, and i need to access one
procedure using vb.net. The problem is that i really don't know what
this oracle procedure will return to vb.net. If I execute this normally,
like ADO.NET Store Procedure, i'll get a DataSet/DataTable? What should
i pass as parameter to "cC1" (in out - procedure
P_G_CLI_I8)?
|
by: JV |
last post by:
A ref cursor data type can obviously be returned as an output parameter of a
stored procedure, but can an ASP.NET application call an oracle proc that
uses a ref cursor as an input parameter? If so, how? What object do you
pass as that parameter?
We are using System.Data.OracleClient, but if necessary, we might be able to
switch.
|
by: peteh |
last post by:
Hi All;
We have many production jobs that "load from cursor" to a UDB/AIX 8.2
(with dpf) data warehouse from source tables residing Oracle 9i. Since
Oracle dates are (roughly) equivalent to DB2 timestamps, we frequently
use the date() function to "convert" from the Oracle date datatype to
the DB2 date datatype.
We have used this technique on over 20 Oracle tables for several months
with no problem. One table in particular fails with a...
|
by: debasisdas |
last post by:
RESTRICTIONS ON CURSOR VARIABLES
=================================
Currently, cursor variables are subject to the following restrictions:
Cannot declare cursor variables in a package spec.
CREATE PACKAGE emp_stuff AS
TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
emp_cv EmpCurTyp; -- not allowed
END emp_stuff;
| |
by: Vinod Sadanandan |
last post by:
All,
Below listed are the new features in Oracle 11g ,please join me in this discussion to generate a testcase and analyze each of the listed features .
Precompilers: Additional Array INSERT and SELECT Syntax Support by
Pro*C/C++ and Pro*COBOL
Precompilers: Dynamic SQL Statement Caching in Pro*C/C++ and Pro*COBOL
Precompilers: Fix Execution Plan in Pro*C/C++ and Pro*COBOL
Precompilers: Flexible B Area Length...
|
by: debasisdas |
last post by:
SAMPLE CODE TO SHOW USE OF REFCURSOR
=======================================
EXAMPLE #1
----------------------
declare
--declare the fer cursor.
type my_ref_cur_typ is ref cursor;
--declare a variable of rec cursor type.
my_ref_cur my_ref_cur_typ;
|
by: debasisdas |
last post by:
Cursor Variable Returning %ROWTYPE
-----------------------------------------------------------
DECLARE
TYPE TmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
tmp_cv TmpCurTyp;TYPE EmpCurTyp IS REF CURSOR RETURN tmp_cv%ROWTYPE;
emp_cv EmpCurTyp;
BEGIN
NULL;
|
by: t_rectenwald |
last post by:
Hello,
I attempting to execute an Oracle query, and write the results to a
file in CSV format. To do so, I've done the following:
import cx_Oracle
db = cx_Oracle.connect('user/pass@DBSID')
cursor = db.cursor()
cursor.arraysize = 500
cursor.execute(sql)
|
by: tickle |
last post by:
Need to convert this PL/SQL script to Dynamic SQL Method 2
* copybook - celg02u3.sql SIR 24265 *
* updates dt_deny for all rows in *
* the removal_eligibility_link table for all persons *
* in all stages associated with the victim who has *
* has had a specific legal status change *
EXEC SQL EXECUTE
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |