|
Re: redirect the cursor to forms [message #111028 is a reply to message #111027] |
Sat, 12 March 2005 05:26 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Next time, please post your problem-code instead of attaching a file (if your code is too large to post, change it into a representable sample-code)
You'd want something like this:
declare
cursor c1
( b_text in varchar2
) is
select utilisateur
, userpass
from connexion cnx
where cnx.utilisateur like '%'||b_text||'%'
;
begin
open c1 (:bloc3.element_texte4);
fetch c1
into :bloc3.xnom1
, :bloc3.xpass_1;
close c1;
end;
Note that you can't use this in a library; you have to use the built-ins copy and name_in then.
hth
|
|
|
i need help [message #111029 is a reply to message #111027] |
Sat, 12 March 2005 06:04 |
khabbab
Messages: 10 Registered: March 2005 Location: france
|
Junior Member |
|
|
the result of execution of this script give us more than one row
in my forms application i obtain only one.
declare
cursor c1
( b_text in varchar2
) is
select utilisateur
, userpass
from connexion cnx
where cnx.utilisateur like '%'||b_text||'%'
;
begin
open c1 (:bloc3.element_texte4);
fetch c1
into :bloc3.xnom1
, :bloc3.xpass_1;
close c1;
end;
i have :bloc3.xnom1 and :bloc3.xpass_1 an multilign element text
|
|
|
|
Re: i need help [message #111031 is a reply to message #111030] |
Sat, 12 March 2005 06:21 |
khabbab
Messages: 10 Registered: March 2005 Location: france
|
Junior Member |
|
|
how i can fetch all recordes of the cursor when i execute the selection whith like i obtain 4 rows.
|
|
|
Re: i need help [message #111033 is a reply to message #111029] |
Sat, 12 March 2005 06:33 |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
Please stop creating new threads when it is all about the same problem...
Your requirements don't make sense.
You want to fill 1 field (:bloc3.xpass_1) with multiple values, namely the multiple rows from the cursor.
Maybe it would make some more sense if you described your block and stated what the multiple rows in the form should look like.
hth
|
|
|
|
|
|
Re: redirect the cursor to forms [message #111302 is a reply to message #111232] |
Tue, 15 March 2005 08:40 |
|
saadatahmad
Messages: 452 Registered: March 2005 Location: Germany/Paderborn
|
Senior Member |
|
|
Hello guys....
He wanted this type of solution which I have already provided him. I'm writing here the solution also for other persons.
I'm giving here the solution step by step.
schema used : scott/tiger
Create a new Form.
Create a new Data Block named CONTROL.(Not a database block)
CONTROL is a Multi Record Block showing 10 records.
Create a New Canvas.
Show scrollbar on that Canvas.
Create a text item v_text Recors displayed = 1
Create item empno Records displayed = 10
Create item ename Records displayed = 10
Create button 1 Records displayed = 1 Label Populate
Create button 2 Records displayed = 1 Label Clear
Place the items properly on the Canvas.
When-Button-Pressed Trigger for Button1:
:GLOBAL.g_text := '%'||:control.v_text||'%';
DECLARE
cursor c1 IS
SELECT empno, ename
FROM emp e
WHERE e.ename LIKE :GLOBAL.g_text;
BEGIN
OPEN c1;
FIRST_RECORD;
LOOP
FETCH c1 INTO :CONTROL.empno, :CONTROL.ename;
EXIT WHEN c1%NOTFOUND;
NEXT_RECORD;
END LOOP;
CLOSE c1;
END;
FIRST_RECORD;
Erase('GLOBAL.g_text');
When-Button-Pressed Trigger for Button2:
GO_BLOCK('CONTROL');
CLEAR_BLOCK;
Run the Form and you can query the data from emp table giving a condition in the v_text Field.
Cheers!
[Updated on: Fri, 22 September 2006 01:19] by Moderator Report message to a moderator
|
|
|