Home » Developer & Programmer » Forms » Problem multiple forms - missing data
Problem multiple forms - missing data [message #78148] Tue, 22 January 2002 06:23 Go to next message
Gert Verstrepen
Messages: 1
Registered: January 2002
Junior Member
Hi, I'm pretty new to Forms, so here's the thing : I have 2 forms, one "logon"-form in which I check if a username and password exist in a table. If this is the case, I open another form with the NEW_FORM command. This works, except that certain data are missing from the called form. Actually, it's not the data that's missing, but the text-boxes don't appear alltogether. Coincidence or not, they are all DATE-types.

However, if I run this second form separately, there is no problem. Everything is displayed correctly. Since the forms have nothing to with each other "data-wise", I don't use any parameters...
Here's the code I'm using :

DECLARE
Alert_Button NUMBER;
UNAME VARCHAR(10);
PWD VARCHAR(10);
CURSOR Users_cur IS SELECT USERNAME, PASSWORD FROM FOLLOWUP_USERS;

BEGIN
OPEN Users_cur;
LOOP
FETCH Users_cur INTO UNAME, PWD;
EXIT WHEN Users_cur%NOTFOUND;
IF (UNAME = :USERNAME) AND (PWD = :PASSWORD) THEN
NEW_FORM('FOLLOWUP_FORM',TO_SAVEPOINT, NO_QUERY_ONLY);
END IF;
END LOOP;
IF Users_cur%NOTFOUND THEN
Alert_Button := Show_Alert('INVALID_LOGON');
END IF;
CLOSE Users_cur;
IF Alert_Button = ALERT_BUTTON1 THEN
Go_ITEM('USERNAME');
ELSIF Alert_Button = ALERT_BUTTON2 THEN
EXIT_FORM(NO_COMMIT, TO_SAVEPOINT);
END IF;
END;

If anyone knows what I'm doing wrong, I'd appreciate you're ideas...

Thanks,
Gert
Re: Problem multiple forms - missing data [message #78155 is a reply to message #78148] Tue, 22 January 2002 11:43 Go to previous messageGo to next message
sokeh
Messages: 77
Registered: August 2000
Member
Your problem is the cursor. Your cursor loops and returns only the last record on the its list and displays only those.
Since there is one username per user and no dupes are allowed (I am assuming it is the case with you) then use regular select statement like:
SELECT USERNAME, PASSWORD
into :username, :password
FROM FOLLOWUP_USERS, dba_users
where username = dba_users.username
and username = :user;
You can then follow through with your if constructs and alert messages.
Hope this helps, let us know.
Re: Problem multiple forms - missing data [message #78168 is a reply to message #78155] Tue, 22 January 2002 22:07 Go to previous messageGo to next message
eliza
Messages: 5
Registered: January 2002
Junior Member
I would really like to know if that helped, since it seems totally irrelevant to me...
I mean, what if the cursor returns only one record?? what this has to do with the other form??
Re: Problem multiple forms - missing data [message #78173 is a reply to message #78155] Wed, 23 January 2002 04:09 Go to previous message
Gert
Messages: 2
Registered: January 2002
Junior Member
No, I don't think that's it either. I don't have different users in the normal sence, so I can't use DBA_USERS anyway. In fact I'm DBA and I can do anything I want except create users. But there are 2 different profiles, 1 with change-rights and 1 with read-only. I also keep a table with userids, passwords and a profile. I connect to the DB using the "read-only" profile, I show the logon-screen and based on the userid I want to look up the corresponding profile to create a new connection with "change" or "read-only", depending on the profile found in my table containing the user-id's...

But anyway, back to the cursor-thing : I just now tried to create a trigger "WHEN_BUTTON_PRESSED" with nothing in it except the following command:

OPEN_FORM('FOLLOWUP_FORM', ACTIVATE, SESSION)

That still gives me the same result : some of the fields are simply not displayed.

I'm just guessing here, but could it be that the problem is my data block ? I DID experiment with the "database" properties of the missing fields, as well as the properties of the data_block, but I reset them to the original settings as far as I can tell...
Previous Topic: Forms 4.5 to Forms 6i migration
Next Topic: Master-detail
Goto Forum:
  


Current Time: Fri Apr 19 05:42:20 CDT 2024