How to run a query in Oracle form? (renamed by LF) [message #262536] |
Mon, 27 August 2007 07:32 |
janaq
Messages: 22 Registered: August 2007
|
Junior Member |
|
|
Dear All,
I am making my final year project using oracle 9i and developer 9i. i am stuck with a query which i need to run on my form. the query is :
SELECT TICKETID,TITLE,USERID,INPUTDATE,DESCRIPTION,PRIORITYID,ticket.STATUSID
FROM TICKET, Status
WHERE ticket.statusid = status.statusid
and status.status = 'New'
This query is running fine in SQL. Now i need to run it on form. can anyone help me how can i run this query on form and which trigger shall i use for it.
looking forward for a prompt response.
[Updated on: Mon, 27 August 2007 07:47] by Moderator Report message to a moderator
|
|
|
|
Re: Need Urgent Help!!!! [message #262546 is a reply to message #262538] |
Mon, 27 August 2007 07:56 |
janaq
Messages: 22 Registered: August 2007
|
Junior Member |
|
|
i am making a help desk system as my final year project. a have a form name as inbox in which i need to display some specific records for that i need to run this query. i tried do it with the when new form instance trigger but the data is not being displayed. i m not sure if i m using a correct trigger that is y i need some to help me with form triggers.
thanks and regards.
|
|
|
|
|
Re: Need Urgent Help!!!! [message #263830 is a reply to message #262582] |
Fri, 31 August 2007 02:29 |
janaq
Messages: 22 Registered: August 2007
|
Junior Member |
|
|
Dear Littlefoot,
Thanks for your advice it worked and my problem has been resolved now ....
now i am running this query on WHEN-BUTTON-PRESSED trigger:
begin
exit_form;
call_form('E:\FinalProject\FinalProject\login.fmx', hide, do_replace);
end;
exit form is working but call_From is not working can you please tell me where am i making the mistake.
waiting for your prompt response.
Thank you.
|
|
|
|
|
Re: Need Urgent Help!!!! [message #265108 is a reply to message #263843] |
Wed, 05 September 2007 07:56 |
janaq
Messages: 22 Registered: August 2007
|
Junior Member |
|
|
Dear LittleFoot,
Need a little help. When i run this code the Alert message for invalid password shows up which is in the else statement:
Declare
v_uname varchar(100);
v_pwd varchar(100);
v_usertype varchar(100);
alert_id alert;
choice number;
alert_id1 alert;
choice1 number;
begin
begin
select username, password, usertypeid into v_uname, v_pwd, v_usertype
from user_master
where username = :login.username
and user_master.active = 'Yes';
exception
when others then
alert_id := Find_Alert ('Username');
choice := Show_ALert(alert_id);
end;
if v_pwd = :login.password then
call_form ('E:\FinalProject\FinalProject\CUSTOMER.fmx', hide, do_replace);
else
alert_id1 := Find_Alert ('pwd');
choice1 := Show_ALert(alert_id1);
end if;
end;
But when i run the code below the invalid password alert does not shows up which is in the last else statement. Can you please tell me where am i making the mistake.
Declare
v_uname varchar(100);
v_pwd varchar(100);
v_usertype varchar(100);
alert_id alert;
choice number;
alert_id1 alert;
choice1 number;
begin
begin
select username, password, usertypeid into v_uname, v_pwd, v_usertype
from user_master
where username = :login.username
and user_master.active = 'Yes';
exception
when others then
alert_id := Find_Alert ('Username');
choice := Show_ALert(alert_id);
end;
if v_pwd = :login.password then
if v_usertype = 1 then
call_form ('E:\FinalProject\FinalProject\CUSTOMER.fmx', hide, do_replace);
else if v_usertype = 2 then
call_form ('E:\FinalProject\FinalProject\Support.fmx', hide, do_replace);
else if v_usertype = 3 then
call_form ('E:\FinalProject\FinalProject\adminpage.fmx', hide, do_replace);
else
alert_id1 := Find_Alert ('pwd');
choice1 := Show_ALert(alert_id1);
end if;
end if;
end if;
end if;
end;
[EDITED by LF - added [code] tags and formatted code. Next time, please, do it yourself.]
[Updated on: Wed, 05 September 2007 12:42] by Moderator Report message to a moderator
|
|
|
Re: Need Urgent Help!!!! [message #265189 is a reply to message #265108] |
Wed, 05 September 2007 12:48 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Alert would show up only if
- v_pwd = :login.password
- v_usertype not in (1, 2, 3)
Are those conditions true?
You might rewrite that IF construct as follows (looks prettier):if v_pwd = :login.password
then
if v_usertype = 1
then
call_form ('E:\FinalProject\FinalProject\CUSTOMER.fmx', hide, do_replace);
elsif v_usertype = 2
then
call_form ('E:\FinalProject\FinalProject\Support.fmx', hide, do_replace);
elsif v_usertype = 3
then
call_form ('E:\FinalProject\FinalProject\adminpage.fmx', hide, do_replace);
else
alert_id1 := Find_Alert ('pwd');
choice1 := Show_ALert(alert_id1);
end if;
end if;
|
|
|
Re: Need Urgent Help!!!! [message #265303 is a reply to message #265189] |
Thu, 06 September 2007 01:56 |
janaq
Messages: 22 Registered: August 2007
|
Junior Member |
|
|
The condtions are if username is equal to datbase username then check for password if password is equal then check for usertype if usertype is matched then call form.
But if username is not correct then show invalid username alert.
If username is correct and password is incorrect then show invalid password alert.
This is the scenario, now the alert for incorrect username is working but the incorrect password alert in not showing up. I tried the code you corrected but that is also not working.
Please advice.
Thank you in advance.
|
|
|
|
|