473,326 Members | 2,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Learning to build a natural dynamic cursor in PL/SQL

I am trying to learn how to use a basic natural dynamic cursor for use in Pro*C and am getting the following error I cannot get past: "Missing IN or OUT parameter at index:: 1" Here is the query generating the error:
Expand|Select|Wrap|Line Numbers
  1. DECLARE
  2.   detail_string VARCHAR2(6000);
  3.   dp_1          a.date_parm_1%TYPE;
  4.   dp_2          a.dte_parm_2%TYPE;
  5.   t_a           a.tme_assigned%TYPE;
  6.   t_s           a.time_system%TYPE;
  7.   pgm_name      CHAR(8) := 'CLMDAREP';
  8.   TYPE dtl_crs IS REF CURSOR;
  9.   detail_cursor dtl_crs;
  10. BEGIN
  11.   detail_string := 'SELECT a.date_parm_1, a.dte_parm_2, a.tme_assigned, a.time_system FROM t_system_parms a WHERE a.nam_program = :pgm_name';
  12.   OPEN detail_cursor FOR detail_string;
  13.   LOOP
  14.     FETCH detail_cursor INTO :date_parm_1, :dte_parm_2, :tme_assigned, :time_system;
  15.     EXIT WHEN detail_cursor%NOTFOUND;
  16.   END LOOP;
  17.   CLOSE detail_cursor;
  18. EXCEPTION
  19.   WHEN OTHERS THEN
  20.   dbms_output.put_line('ERROR!');
  21. END;
  22.  
All I need is to figure out the basic first step and then I can build the actual 160 line query that I really need.
Oct 10 '06 #1
0 6145

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kevin Frey | last post by:
Hello, I have a test database with table A containing 10,000 rows and a table B containing 100,000 rows. Rows in B are "children" of rows in A - each row in A has 10 related rows in B (ie. B has...
0
by: Shailesh | last post by:
If I'm not mistaken, C++ doesn't have support for dynamic class members. I'm considering if such a facility would be useful, and what method would make a good workaround. I have a generic...
5
by: Joško Šugar | last post by:
On this site: http://www.sommarskog.se/dynamic_sql.html I have found an example how to use cursor with dynamic SQL: DECLARE @my_cur CURSOR EXEC sp_executesql N'SET @my_cur = CURSOR FOR SELECT...
5
by: Todd Huish | last post by:
I have noticed something disturbing when retrieving datasets over a relatively slow line (multiple T1). I am looking at about 25 seconds to retrieve 500 rows via a php-odbc link. This same select...
1
by: Todd Peterson | last post by:
I'm a newbie to DB2 and am trying to figure out how to write a stored procedure, using dynamic SQL statements to return a result set. I believe the majority of the hurdles I have been facing might...
36
by: utab | last post by:
Dear, I have experince in C( numerical projects, like engineering problems, scientific applications) I have the basic notion of C++ also, I have read Accelerated C++ until Chapter 7, however it...
7
by: Hal Vaughan | last post by:
I have a problem with port forwarding and I have been working on it for over 2 weeks with no luck. I have found C programs that almost work and Java programs that almost work, but nothing that...
0
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 * * ...
14
by: ddg_linux | last post by:
I am a beginner learning php too. I think for me is the fact that I don't know all of the functions, or how all of the php code actually works. <?php echo 'hello world'; ? - this piece of code...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.