Cursors in forms 6i
Hi experts ,
Please tell me whether usage of cursor with a cursor is permited in forms 6i or not because when i am executing the code in oracle 9i it is running fine but when ever i am using the below code in form the second cursor is not responding at all and I ahve such exprience that even a simple select query is not at all responding
inside a cursor.
the code
declare
DID DEPT.DID%type;
NAME EMP.NAME%type;
cursor abc is select did from reject_call_records;
cursor efg is select NAME from DEPT where and dept_TYPE ='I' and did=v_did;
begin
for v_abc in abc loop
DID := v_abc.did;
for v_efg in efg loop
NAME := v_efg.NAME;
dbms_output.put_line(NAME||' '||DID);
end loop;
end loop;
end;
Can anyone tell me the reason.
Rajat
Dear.......................
In form 6i the the syntax use for cursor is given below try to use this I hope it will work very well.
My Code:
Declare
DID DEPT.DID%type;
NAME EMP.NAME%type;
cursor abc is select did from reject_call_records;
cursor efg is select NAME from DEPT where and dept_TYPE ='I' and did=v_did;
BEGIN
For v_abc in abc loop
DID := v_abc.did;
For v_efg in efg loop
NAME := v_efg.NAME;
MESSAGE(NAME||' '||DID);
NEXT_RECORD;
End loop;
End loop;
END;
Similar Messages
-
Need help on Dynamic SQL Cursor in Forms
Hi All,
I am trying to execute Dynamic SQL Cursor in forms using EXEC_SQL built in.
I have a cursor for example:
'select * from supplier where supplier = '||p_supplier||' and processing_order = '||p_order
My code is
cur_num := Exec_SQL.Open_cursor;
sql_order := 'select * from supplier where supplier = '||p_supplier||' and processing_order = '||p_order;
EXEC_SQL.PARSE(cursor_number, sql_order);
EXEC_SQL.DEFINE_COLUMN(cur_num ,1,ln_Supp_Id);
EXEC_SQL.DEFINE_COLUMN(cur_num ,2,ls_Suppl_Name,30);
EXEC_SQL.DEFINE_COLUMN(cur_num ,24,ls_exchange,20);
sql_count := EXEC_SQL.EXECUTE(cur_num );
While EXEC_SQL.FETCH_ROWS(cur_num ) > 0 Loop
EXEC_SQL.COLUMN_VALUE(cur_num ,1,ln_Supp_Id);
EXEC_SQL.COLUMN_VALUE(cur_num ,2,ls_Suppl_Name);
EXEC_SQL.COLUMN_VALUE(cur_num ,24,ls_exchange);
End Loop;
EXEC_SQL.CLOSE_CURSOR(cur_num );
In this case I have to write 24 Define Columns and 24 Column value. Is there any way to assign them to %rowtype at one time as I need all coulmn of the table.
I had similar case on multiple tables.
Please help me
Thanks,
MaddyI need this dynamic sql because p_supplier and p_order values changes at run time
I do not understand. Is this a simplified sample or the real thing? You do know that you can pass variables to cursors:
cursor test is
select * from supplier where supplier = p_supplier and processing_order = p_order;
or does e.g. p_supplier hold other parts of the query?
cheers -
REF Cursor in Forms 4.5
I am using forms 4.5. I have a function whcih returns cursor. I would like to store the return values in Forms cursor variable and iterate thru the result set. When I declare TYPE cname IS REF CUROSOR I get compilation error. Is it possible to declare REF CURSOR in forms 4.5 . Help is greatly appreciated
Thanks. Is there any way I can capture the ref curosr (or resultset) passed from server from the oracle forms. The purpose is to call the function from the forms with a table id which will return a resultset which is the items in the list , which is used to populate list in forms. To have a centralised location for list elements.
Is there any package on forms which can be used to capture the returned resultset, pl. let me know -
Use of Cursors in Forms!!
Hi all,
Here i want to write a generic procedure, which creates a cursor with query based on the users' choice of table and the given query....
the procedure looks like the following....
Procedure xyz(iv_table_name IN VARCHAR2,
iv_where_condition IN VARCHAR2)
IS
Cusor lcur_generic IS
Select field1, field2
from <iv_table_name> -- Here i want to use the above parameter..
and i want to attach the iv_where_condition string
as where condition...
Could any one help me in this issue,
It is very important and urgent
I'm Using Forms 6
Help is appreciated.
Tnx
RK RajuIN THE FORMS PREPARE THE STATEMENT
:BLOCK1.DT:='SELECT FIELD1,FIELD2,FIELD3,FIELD4 FROM TABLE1 WHERE FIELD1=XXX';
THEN YOU CAN CALL THE PROCEDURE
IN THE BLOCK PROPERTIES INSTEAD OF TABLE USE PROCEDURE
QUERY DATA SOURCE NAME 'CUR.RCURSOR'
QUERY DATA SOURCE COLUMNS
SET FIELD1 TYPE VARCHAR2 ......
FIELD2 TYPE VARCHAR2 ......
FIELD3 TYPE VARCHAR2 ......
FIELD4 TYPE VARCHAR2 ......
QUERY DATA SOURCE ARGUMENTS
SET RESULTSET TYPE REFCURSOR
TYPE NAME CUR.FINSTYPE
MODE INOUT
DT TYPE VARCHAR2
MODE IN
VALUE :BLOCK1.DT
THIS WILL WORK ON THE BLOCK EXECUTE QUERY
MAKE SURE THE FIELD1,FIELD2,FIELD3,FIELD4 ARE DATABASE SET TO YES
HERE IS THE CODE FOR THE PACKAGE YOU NEED TO CREATE..
Package CUR /* IF YOU USE authid current_user */ IS
type FINSTYPE is ref cursor ;
PROCEDURE RCUR(RESULTSET IN OUT finstype,DT IN VARCHAR2 );
END CUR;
-------------------------------BODY-------------
Package CUR
IS
PROCEDURE RCUR(RESULTSET IN OUT FINSTYPE ,DT VARCHAR2 )
IS
BEGIN
OPEN RESULTSET FOR
DT;
EXCEPTION WHEN OTHERS THEN
NULL;
END;
END ;
IF YOU
DECLARE
FCURSOR CUR.FINSTYPE;
STATEMENT1 VARCHAR2(2000):='SELECT FIELD1,FIELD2,FIELD3,FIELD4 FROM TABLE1 WHERE FIELD1=X';
BEGIN
CUR.RCUR(FCURSOR,STATEMENT1);
FETCH ..... LOOP
END LOOP;
CLOSE STATEMENT1;
END;
THIS WILL WORK INSIDE OTHER PROCEDURES OR FUNCTIONS BUT NOT INSIDE FORMS PLSQL.
TO WORK INSIDE FORMS PLSQL
YOU HAVE TO CREATE IN THE PACKAGE
RECORDX OF TYPES FIELD1,FIELD2,FILED3,FIELD4
AND THEN
INSTEAD OF
type FINSTYPE is ref cursor ;
YOU SAY
type FINSTYPE is ref cursor OF RECORDX ;
GOOD LUCK
I HOPE WHAT I WROTE MAKES SENCE BECAUSE IT WORKS... -
Invisible Text item cursor in forms 4.5... How to resolve?
In certain Text items in forms 4.5, the txt cursor is not displayed. The propertys are the same that other text items, the display propertys are:
-Font : MS SanSerif
-Size : 8
-type : plain
-weight : DemiLight
Foreground : Black
Background : White
What i need to do to make this cursor visible?Try making the fields a bit taller - I seem to remember that there was a bug on this way back in 4.5 so it may be that you're hitting.
-
Cursor in form field when page opens?
Client wants cursor in first form text field when page opens,
without the user clicking in that box. Must be possible, I just
don't know how to do it.
Thanks,
Alanall you have to do is set an onload function for the page to
set the focus of that text field
<!-- this sets the focus of the text field when the page
loads -->
<body OnLoad="document.myform.txtfield.focus();">
<!-- setting the names up on the form and fields makes the
javascript work -->
<form name="myform">
<input name="txtfield" type="text">
</form> -
Opening Ref Cursor in Forms 10
Hi,
I have a procedure test which returns refcursor as out parameter. How can I open and process this refcursor in forms to poulate a non base table block ?
Regards,
RajeshHello
In your forms builder Online help search for 'Creating a Data Block from a Procedure that Uses a Ref Cursor'. It provides a pretty good example.
cheers
Q -
Help me show rowcount of a cursor on forms canvas,,
i mean..
The program unit is not in the forms application but in the oracle server side.
i need to show a cursor's rowcount on forms canvas
while a cursor is running loop in the program unit in real-time..
so i used the when-timer-expired trigger that reads a data(related record count from some table) every 1second.
i hoped that the timer trigger synchrozes with the server program unit.
but there was only one time event when the server program unit has finished.
How can i resolve the problem..??duplicate
i try to display a number of executed record on the forms screen.
Please do not create a new thread for the same problem. -
Flickering cursor in form?
Hi all, in some of the forms I've been creating,when I mouse over and then out of a field, it sputters/flickers my cursor back and forth between the hourglass and pointer. Why does this happen, and how can I ultimately stop it?
Thanks for any advice you can provide!I think Adobe Reader 8 is not supported, revert to 7 perhaps?
Interactive Forms with Abobe 8.0 -
Cursor Style, Forms Web Implementation 6.0
I am using the Forms server 6.0 with static HTML to display
forms over Intranet. The cursor styles through SET APPLICATION
PROPERTY builtin does not seem to change the cursor in the
browser. (Works fine when I test the form in Client/Server
environment.) Tried it with both IE 4.0 and NetScape 4.5. I did
not see in Developer 6.0 documentation that Cursor Style is not
available in Web implementation.
Has anyone used cursor styles successfully with Developer 6.0 in
static Web Implementation?
Thanks,
Amir
nullCherif,
please ask Oracle customer support for this.
thanks
Frank -
Help with creating a cursor select form
Hey guys i need some help, I have a client who would like a menu on her website that allows users to select differnt cursors, I have never done anything like this before hand, Can anyone help out or point me in the direction of a tutorial for this sort of thing, thanks
Hi,
as I know, you can change your cursors by system software or/and browser. On the other hand you can use programs "outside" of your DW. I suggest to "Google" for them, as I did, and found for example this:
http://www.google.de/#hl=de&xhr=t&q=create+cursor&cp=13&pf=p&sclient=psy&site=&source=hp&a q=0&aqi=g2&aql=&oq=create+cursor&pbx=1&bav=on.2,or.r_gc.r_pw.&fp=e8c6fad3e718b799&biw=1280 &bih=785
or http://www.cursors-4u.com/ and while examining this website my cursor changed immediately.
Hans-Günter -
Help plss Should a cursor be created in database or program unit in forms l
Where can i create a cursor should it be in database i.e isql plus using internet explorer or should i create the cursor in forms
forms can i create the cursor so that i can use the cursor in the post item trigger of the userid item of login page
Can i create the cursor in a package specification and how can i call that cursor into a post_text item trigger
details below
Iam working on a Online exam for students Dummy project using forms
The student 1st comes to a WELCOME page i.e form which asks him if he is a new student or registered stud
If he clicks registered pushbutton it takes him to a LOGIN page where there are two items userid and password.I am using a Validate_item OR Post_item trigger to fire after the student enters his userid.
I need to compare the entered userid with the userid stored in the database STUDENTS table which i created which consists of the registered students details.
Our project Guide suggested that we create a cursor and fetch each userid everytime into the cursor and compare the entered userid with the cursor.hi Sqlstar,
Regarding to your all questions , i prefered that you search for a simple document or book in order to understand much more more about creating cursors.
however since this forum made to help people and to make a integerated community i would be glad to offer my help and going with you step bt step with your answers.
as for beginning
1) when you create the user_exists function in database , if you want to call it in the form level you would wirte a code like this
----WHEN-VALIDATE-ITEM------------user_id item---------
IF scheme_name.procedure_name(:block1.userid)!='TURE' then
message('User Name is not correct');
raise form_trigger_failure;
end if;
2) it's not a waste of recourse to make 2 validation of both userid and password
and as same you create a procedure for useris you should create a procedure for password where the user id is the outcomming of userid item in the form.
3)you have all choices to create the 2 procedures on database side or in the program unit at design time for the form it's up to you and as a small hint for you ,
when you create them in the program unit and want to call the procedures in the WHEN-VALIDATE-ITEM trigger you should denote the procedure name with the name of package first as following
-------[Package Spec Code]-------
PACKAGE user_validation IS
function user_exists (p_user_id number) return boolean;
end ;
--------------[Package Body Code]------
PACKAGE BODY user_validation IS
function user_exists (p_user_id number) return boolean
is
user_number number;
cursor c_user_id is
select user_id from <user_table>
where user_id=p_user_id;
begin
open c_user_id ;
loop
fetch user_id into user_number ;
return (true);
exit when c_user_id%NOTFOUND;
end loop;
execption when others then
return(false);
end user_exists;
end;
-----Calling at Validation level-----------
IF (user_validation.user_exists(:block1.userid))!=TURE then
message('User Name is not correct');
raise form_trigger_failure;
end if;
i hope this could be helpful engouh to start your application
Good Luck .
Regards
Omar -
Changing textfield cursor color in Forms
Hi All,
We are using Oracle App Server 9iAS and 9iDS. I need to change the color of my cursor for the text field/or change the cursor to a block cursor in forms application. Does any one know how that can be done ?.
TIA
SaurabhSaurabh,
changing the color of a cursor is more difficult than changing its shape. You can use a PJC to change the cursor shape to one of the standard shapes. If you need a custom cursor then you still can used a PJC, but designing your own cursors in Java is not trivial.
See:
http://www.oracle.com/technology/sample_code/products/forms/demo/9i/javabeans_pjc_samples/mod_cursor/viewlet/pjc_modcursor_viewlet.html
which is available in the Forms 9i demos at
http://www.oracle.com/technology/sample_code/products/forms/index.html
Frank -
Batch procedure in Forms 10g, calling rdf and send by mail
Hi all,
I need your advice regarding my task: i have a table with invoices of some clients. I have created a report in Oracle Reports 10g R2, so to have a pdf with all the data from this table.
I have created a form in Forms 10g R2, displaying in a screen one field, where the user can choose the date of invoice. Then i will query by that date all my invoices in that table, and then i want to create a procedure in Forms, so that for every line in that table with the invoice date just chosen i will run HOST(rwrun ... all my parameters).
My questions:
1. I need to read some more about how to create a custom xml so to pass to my rwrun, and depending on the records fetched in my cursors in Forms 10g, i will pass a xml variable to my reports, so i will get the data from Forms 10g in the report created in Oracle Reports 10g. Is there any way that i can grep the errors? I need to create some insertions based on succes on failure, how can i accomplish this?
2. Is the above described scenario way to complicated to loop throuh a cursor, create a pdf, and mail the pdf until the cursor is totally fetched? Do you recommend me a simpler way to accomplish this task?
Thank you so much,
Michael.Hello,
I have a report with all my clients, with their email addresses in the same report. Each client as unique account number or invoice number.
So i want to burst and distribute each invoice to the corresponding client:
1. I have set REPEAT ON: INVOICE in oracle reports.
2. From Oracle Reports, i click on Distribution list, and in the DESNAME i type email_address (which is the column from the table with the invoices).
3. Then, File >> Distribute. Says: distribution completed succesfully, but nothing happens.
Question:
1. Where am i mistaking?
2. Is there any log activity file that i could see what the application is doing, step by step?
Thank you,
Michael -
Unable to close the cursors in the database
While executing a stored program unit(containing three cursors and sub programs or functions containing another two cursors) through forms the client running the form stops responding. While checking the database the open_cursor view reports that there is 74 cursors are opened. The cursor limitation in the database is 200. Help me sort out this problem!!!!
How do you know it is a cursor problem?
It looks like the stored procedure does not end. Is it in a loop? Can you run the procedure successfully from SQL*Plus instead of Forms (with the same input parameters)?
Maybe you are looking for
-
Editing in Camera Raw with Bridge in CS6
Whenever I try to edit an image with Bridge I get a message saying: "Camera Raw editing is not enabled. Camera Raw requires that a qualifying product has been launched at least once to enable this feature" I have looked throughout the Adobe site
-
How to change the value in an Integer object?
Hi, Is it possible to change the value that is contained in an Integer object. I know Integer objects are immutable. So it might not be possible to chage to value in an integer object once its been initalized a value @ the time of construction. Also
-
Unable to resolve hostname to IP
Hi, I have a query which seems unusual but very important to get my job done. I'm trying to resolve the hostname to IP on a linux platform (Cent OS). Have a sample code how I'm trying to achieve the same. TestJava Class: import java.net.*; import jav
-
ASSERTION_FAILED in XD01,XD02 while maintaining Industry in Marketing tab
While creating a new customer (XD01) or changing an existing customer (XD02), in the Marketing tab, Industry field, when a value is maintained, it results in runtime error ASSERTION_FAILED. This occurs in line: assert condition lv_ind_sector_type is
-
I have a brand new 2GB computer and have been making a pdf using Acrobat 8 Standard. Its 235MB and now its too big for me to do anything with it! It won't even load up anymore because its so huge. Any suggestions on anything I can do?