Execute procedure from forms
Dear all,
i want to execute a procedure from forms. my code is below for calling procedure, this code is working fine from the SQLPLUS, but not working from forms.
forms_ddl('execute audit_sessions('||''''||'et20'||''''||',sysdate,'||''''||'HELP'||''''||')');my procedure is below
CREATE OR REPLACE PROCEDURE audit_sessions(uname varchar2,logon_date date,APP_USER VARCHAR2) is
begin
insert into admin.session_audit values(uname,logon_date,APP_USER);
commit;
end;my table is below
SQL> desc session_audit
Name Null? Type
ACTIVE_DIRECTORY_USER VARCHAR2(30)
LOGON_TIME NOT NULL DATE
APPLICATION_USER NOT NULL VARCHAR2(30)kindly help. i am using oracle 10g database and forms version 9.0.4.0.19
Regards.
Edited by: Maahjoor on 09-Feb-2013 19:34
Edited by: Maahjoor on 09-Feb-2013 19:35
Edited by: Maahjoor on 09-Feb-2013 20:18
Wa Alaikum Salam,
Dear Ahmad Rafiq,
it is compiled without error, so i think it should work, but now currently the forms is opened by some user,
as soon as i am able to delete the old one and paste the current one, i will update you and will mark the answer correct accordingly.
thank you so much dear.
Similar Messages
-
Execute store procedure from form
How do I execute a store procedure from FORM
I have a store procedure in the database
all it does insert a value to table test.
in 'WHEN-NEW-INSTANT-TRIGGER' of the form MODLUE I put
test_curor; (name of the store procedure)
The module does have block or any thing it.
There was no syntax errors or form error
but it did not insert into the table.
Why????I just tested this myself and you are right. If you have one block with no items in it the when-new-form-instance trigger will not be fired. I got a message back saying 'block had no items', though it ran OK. This kinda makes logical sense, since there is nothing for the form to do. I put a button onto the block and the procedure fired no problem. I must admit I have never tried creating a form with no items in it so I haven't seen this behaviour before.
Shucks you live and learn every day! -
How to call Pl/sql procedure from form ?
Hi all,
I need to call a procedure from form after the user has pressed the button to invoke the sql procedure, can anyone please advise me on how to do it ?
Thanks.
LimHi,
Thanks for your reply.
yes, I have include in when-button-pressed trigger as
AIC_PROC_AR_CCID_UPD;
Below is my procedure :-
CREATE OR REPLACE PROCEDURE AIC_PROC_AR_CCID_UPD(errbuf out Varchar2,
retcode out Number ) is
VAR_BUF VARCHAR2(240);
Cursor C1 is
SELECT CONCATENATED_SEGMENTS ACCT,
SEGMENT5 SEG5
FROM AIC_GL_COA AGC
WHERE AGC.CODE_COMBINATION_ID IS NULL;
Rec1 C1%RowType;
BEGIN
FOR Rec1 IN C1 LOOP
BEGIN
UPDATE AIC_GL_COA A SET ( DESCRIPTION, CODE_COMBINATION_ID, SEGMENT5 )=
( SELECT FFVT.DESCRIPTION, GLA.CODE_COMBINATION_ID, GLA.SEGMENT5
FROM GL_CODE_COMBINATIONS_KFV GLA,
FND_FLEX_VALUES_TL FFVT,
FND_FLEX_VALUES FFV
WHERE GLA.CONCATENATED_SEGMENTS = REC1.ACCT
AND FFV.FLEX_VALUE = REC1.SEG5
AND FFV.FLEX_VALUE_ID = FFVT.FLEX_VALUE_ID
AND FFV.FLEX_VALUE_SET_ID = 1002673 )
WHERE A.SEGMENT5 = REC1.SEG5 ;
EXCEPTION
WHEN NO_DATA_FOUND THEN
FND_FILE.PUT_LINE(FND_FILE.OUTPUT, 'NO RECORD UPDATE !!');
END;
END LOOP;
COMMIT;
RETURN;
END;
However, when I try to compile it, error prompt :-
Error 306 at line 1, column 1
wrong number or types of arguments in call to 'AIC_PROC_AR_CCID_UPD'
Error 0 at line 1, column 1
statement ignored.
By the way, my form 6i is running at client site and connection to procedure in unix server. Will this is ok ?
Thanks
Rgds
Lim -
Call Stored Procedure from Forms 6i -- Urgent Plz...
Dear All,
I am first writing a stored procedure as:-
CREATE OR REPLACE FUNCTION
good_hire
(birthdate_in IN DATE,
reqsal_in IN NUMBER)
RETURN BOOLEAN
IS
too_young BOOLEAN :=
ADD_MONTHS
(SYSDATE, -216) >
birthdate_in;
too_expensive BOOLEAN :=
reqsal_in > fin.dept_bal;
BEGIN
RETURN NOT (too_young
OR too_expensive);
END;
Now in my forms also i have the same function,which i defined in in my program unit i.e., with the same name good_hire,but with different parameters.
If I want to call this stored procedure(good_hire)in my form
I am writing this code in the pre-Insert trigger.
IF good_hire
(:newemp.birthdate,
:newemp.proposed_sal)
THEN
SELECT empseq.NEXTVAL
INTO :newemp.empno
FROM dual;
ELSE
RAISE FORM_TRIGGER_FAILURE;
END IF;
Notice that i am sending bind variables from my form to the
stored procedure. Now my question :
1) Can i pass bind variables to the stored procedures from
forms or is there any other way i can access the
stored roceures from forms(Expecting a detailed answer) and
from which triggers can I access the stored procedures(like pre-
Insert here)?
2) If at all I have the same parameters in my program unit
function and with the same name good_hire, I know that the code
in the pre-Insert trigger will call only the function in my
program unit and not the stored procedure, but if I like to
call my stored procedure instead of the local function good_hire
then what should I do?
2)As I said before if i have different parameters, for the
stored procedure good_hire and local function good_hire and If
I call good_hire from my pre-insert trigger .. Is it that the
Forms will decide and call the Local function or stored
procedure depending on the parameter list?
I hope all my points are very clear.
I am expecting the best and detailed answer for my
Queries, I also hope these Quests will clear the doubts of many
members in our esteemed group.
Thnx in Advance...
Regards
siree....Dear Siree,
Oh!! how many Questions? Each how much big??
Ok First of all the answer to your first question.
You can use the Stored procedures in the same way as the Forms procedures. You can pass bind variables to the stored procedures as well. You can also use the stored procedures in any triggers, I think there are no restrictions for that. The only thing is you should be connected to database while compiling the trigger where you are calling the stored procedure.
Answer to your second question.
You cannot direct Forms (I don't know about version 10g), untill 9i, you cannot tell forms to take the stored procedure and leave the local procedure. It will always take the local procedure, once a procedure is called. If not found locally then only it will go for the Stored procedures.
For your third question.
As I told you b4 forms searches for the procedure being called locally first, if locally present, does not go to the stored procedure. If declared by different paramaters in the stored procedure and it is called, then it will throw error (as it first searches for the name locally and if found will take up the one present locally and since that procedure is with different parameter, will throw up error). It is after all a stupid machine and can't think like us.
Regards,
Senthil .A. Perumal -
Problem with IN OUT parameters whiloe calling procedure from Form 6i
Hi
Could some help please? I have the following scenario.
I am calling a stored procedure from form 6i by pressing a button on the form. Procedure has two IN OUT parameters, and I am passing these two IN OUT parameters and have declared them the way they are declared passed to the procedure. But I get an error when calling that procedure with these IN OUT parameters. the procedure works fine if parameters are IN only. The error says:
PLS:00363: Expression '1' cannot be used as an assigment target.
NO matter I pass some value or leave it blank, I get the same error message persistenetly.
Please help.
Thanksmake sure you are calling your procedure with variables as parameters,
i.e.
l_v1 := 1 ;
l_v2 := 'hello world' ;
your_proc(l_v1, l_v2)
not
your_proc(1,'hello world') -
Execute Procedure in Forms Personalization with 4 parameters
Dear Friends,
i want to use ( Execute Procedure ) in forms personalization of Absence Form and i want to pass 4 parameters to the procedure (2 date and 2 number datatype)
but i failed so far in writing this so please help me to write this
my code look like this :
=' begin
XX_HR_CALL_REPORTS('''${ABA.ABSENCE_DAYS.value} ''','''||
${ABA.DATE_START.value}||''','''||${ACCRUALS.AFTER_NET_ENTITLEMENT.value}||''','''||
${ABA.DATE_END.value}||'''
end
Thank & Regards,
YasNo Replies ? Is this an irrelevant question or I posted into wrong forum ??
-
Error when calling procedure from form personalization
Hi every body
I want to call a procudre using form personalization . I made the procedure and in form personalization i call it as follow:
built in type : Execute a Procedure
Argument :
='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )'
but the following error raised when i click on Apply Now button :
the string (='GAZ_EMP_ASSIGN_UPDATE(' || :ASSGT.ORGANIZATION_ID || ', ' || :ASSGT.ASSIGNMENT_ID || ', ' || FND_PROFILE.VALUE('USER_ID') || ', ' || FND_PROFILE.VALUE('DB_SESSION_ID') ||' )' )
couldn't be evaluated because of error ORA-06550 :line 1 , column 43
PLS-00103:encountered the symbol ")" while expecting one of the folowing (- + ...... etc
can anyone have a solution to this problem because it made me mad .(urgent)
Or if anyone have another way to call the procedure ??
Note that i want to pass db_session_id to the procedure from the application so does anyone have a complian about the way of passing this parameter to the procedure ??See http://oracle.ittoolbox.com/groups/technical-functional/oracle-apps-l/forms-personalization-execute-a-procedure-1778674
-
Running Stored procedures from Forms
I have several stored procedures (stored in the database) that I
want to run from Forms (client), but when they're running my
application (in Forms) is frozen until the procedure end.
I don't know how to run that stored without lock the application,
somebody Can Help me???
THANKS
nullThe second parameter of the DBMS_JOB.SUBMIT procedure needs to be
a valid PL/SQL call, i.e. it must at least be terminated by a
semicolon. You could also wrap it into an anonymous PL/SQL block,
like: 'BEGIN SP_CREA_FACTURAS_PADRE; END;'
Marisol (guest) wrote:
: Dietmar:
: I put this code in my application and I didn't get any response
: DBMS_JOB.SUBMIT( iJobNumber,
: 'SP_CREA_FACTURAS_PADRE',
: SYSDATE,
: 'null',
: FALSE);
: COMMIT;
: When I select the option that executes this code my application
: ends without any message...
: You know why is this happen?
: How can I resolve??
: Thanks :)
null -
Calling stored procedure from Forms 6.0(developer)
Friends,
Thanks for your replies. I am really grateful for your help for my last query. But I still have one hitch. How do I call from Developer 2000 Forms 6.0 a stored procedure which I made in Oracle 8i ?
nullThis is an example from Forms on-line help "Invoking a stored program" topic:
DECLARE
ld DATE;
ln NUMBER;
lv VARCHAR2(30);
BEGIN
** Calling Database Procedure/Function
database_procedure_name(ld,ln,lv);
ld := database_function_name(ln,lv);
END;
Helena -
Calling Stored procedure from Forms 6i
Dear all,
I have a stored procedure having INand INOUT parameters. I need to call it from Forms 6i triggers. Will you please tell me the syntax for calling stored procedure and stored function from Forms 6i and report 6i.
Saibaldas
[email protected]Just the same as for a local procedure, the only restrictions concern package public variables which are not visible from client side PL/SQL, and you probly want to keep the interfaces simple as client side PL/SQL (e.g. the Forms and Reports engines) don't support the same range of datatypes that the database does.
-
Different session used when calling stored procedure from form
after commiting data in a form to a table, a stored procedure is called that inserts the data written to the table into several other tables. Some columns in the original table are updated - no commit is issued in the procedure. On returning from the procedure the form is re-queried but the updated columns don't contain the updates. This seems to imply that the stored procedure is running as a different session to the one of the form.
Is this the case? Can we make the form and the stored procedure use the same session so that the data is available in both without having to commit in the procedure?No. They should be within one session unless you explicitly open a new session.
The reason why you dont see updates of the data block when you requery is probably the changes on the form never go to the back end. I think first you have to make sure data changes go to db table. You can do a commit_form before calling the stored procedure and open up another session (e.g. sqlplus) to check the data in the table changed or not. -
Passing Parameter to Stored Procedure from Form
Hello All,
I have been stuck while passing a form parameter to a database Procedure.In the query data source arguments I have provided the parameter Value as :parameter.parameter_1...Is it right...
Can somebody throw some more light on this...
Regards,
KapsYou can pass the parameters from Forms through the Query Data Source Arguments of this block.
There are a little example on http://www.Friedhold-Matz.de/appl_plan.htm.
I used in block B the Query Data Source Arguments property to fill the
procedure input arguments with the :PARAMTER.P_name of this Form.
Hope it helps
Friedhold -
How to compile and execute procedure from hr to scott
Hi all ,
I am trying to compile and execute a stored procedure from hr user to scott user.
first i gave grant command to hr.
By using:- grant create any procedure to hr;
After i compile a procedure from hr to scott.
create or replace procedure scott.sp_hr
is
begin
dbms_output.put_line('run by scott user');
end;
but it says :-
ORA-01031: insufficient privileges
01031. 00000 - "insufficient privileges"
any one help me.it works for me
20:29:29 SQL> 20:29:29 SQL> connect / as sysdba
Connected.
20:47:41 SQL> grant create any procedure to hr;
Grant succeeded.
20:48:01 SQL> connect hr/hr
Connected.
20:48:07 SQL> create or replace procedure scott.sp_hr
is
begin
dbms_output.put_line('run by scott user');
end;
20:48:21 2 20:48:21 3 20:48:21 4 20:48:21 5 20:48:21 6
20:48:23 7 /
Procedure created.
20:48:25 SQL> -
Trying to execute procedure from analoymous block
Hi ,
Iam trying to exeute the procedure from analymous block but I raising an exception
Could you please help me on this scenario.
Error report:
ORA-01001: invalid cursor
ORA-06512: at line 31
01001. 00000 - "invalid cursor"Hi,
FMI
<code>
DECLARE
pn_Result NUMBER;
pc_Cursor SYS_REFCURSOR;
SUBMIT_DATE DATE;
REQUESTOR_NAME NVARCHAR2(200);
approval_date DATE;
APPROVER_NAME NVARCHAR2(200);
REQUEST_TYPE_DESC NVARCHAR2(200);
COMPANY_NAME NVARCHAR2(200);
card_no NUMBER;
card_user_name NVARCHAR2(200);
company_embossed_name NVARCHAR2(200);
auth_strat VARCHAR2(200);
CARD_STATUS VARCHAR2(200);
request_status VARCHAR2(200);
BEGIN
corporate.GET_CARD_REQUEST_SS
(NULL,
NULL,
5,
NULL,
NULL,
NULL,
0,
NULL,
NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,pn_Result, pc_Cursor,NULL);
FETCH pc_Cursor
INTO
REQUESTOR_NAME,
approval_date,
APPROVER_NAME,
REQUEST_TYPE_DESC,
COMPANY_NAME,
card_no,
card_user_name,
company_embossed_name,
auth_strat,
CARD_STATUS,
request_status;
DBMS_OUTPUT.PUT_LINE( REQUESTOR_NAME);
END;
<code>
My procedure is
<code>
create or replace
PROCEDURE GET_CARD_REQUEST_SS
ps_Req_First_Name IN NVARCHAR2,
ps_Req_Last_Name IN NVARCHAR2,
pn_Request_Type IN NUMBER,
pn_Request_Status IN NUMBER,
pn_Ageing IN NUMBER,
pn_Ageing_compare IN NUMBER,
pn_Application_Id IN NUMBER,
ps_Embossed_Name IN NVARCHAR2,
ps_Structure_Point IN NVARCHAR2,
ps_Date_From IN VARCHAR2,
ps_Date_To IN VARCHAR2,
ps_Approver_Name IN NVARCHAR2,
ps_Processor_Name IN NVARCHAR2,
pn_Company_Id IN NUMBER,
pn_Requestor_Or_Approver IN PLS_INTEGER,
pn_callingUserId IN CST.T_USER_ID,
pn_Screen_output IN PLS_INTEGER,
pn_Result OUT NUMBER,
pc_Cursor OUT CST.CUR_TYPE
,pn_iso_code IN NUMBER DEFAULT 826)
IS
ls_Select varchar2(4000);
ls_SelectFrom varchar2(4000);
ls_Where varchar2(4000);
ls_Order_By varchar2(4000);
lb_Debug BOOLEAN := FALSE;
ln_iso_code PLS_INTEGER ;
C_CARD_REQUESTOR CONSTANT PLS_INTEGER := 0;
C_COMPANY_APPROVER CONSTANT PLS_INTEGER := 1;
C_BANK_APPROVER CONSTANT PLS_INTEGER := 2;
BEGIN
--if lb_Debug then
PLSQL_LOG('card_request_admin.get_card_request: ---- Start at'|| to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') );
PLSQL_LOG('card_request_admin.get_card_request:scheme user '|| SYS_CONTEXT('USERENV', 'session_user') );
PLSQL_LOG('card_request_admin.get_card_request:user '|| SYS_CONTEXT('Godot','user') );
PLSQL_LOG('card_request_admin.get_card_request:company '|| SYS_CONTEXT('Godot','company') );
PLSQL_LOG('card_request_admin.get_card_request:node '|| SYS_CONTEXT('Godot','node') );
PLSQL_LOG('card_request_admin.get_card_request:bank '|| SYS_CONTEXT('Godot','bank') );
PLSQL_LOG('card_request_admin.get_card_request:mgr '|| SYS_CONTEXT('Godot','mgr') );
PLSQL_LOG('card_request_admin.get_card_request:provider '|| SYS_CONTEXT('Godot','provider') );
PLSQL_LOG('card_request_admin.get_card_request:verif_code '|| SYS_CONTEXT('Godot','verif_code') );
PLSQL_LOG('card_request_admin.get_card_request:Restriction '|| SYS_CONTEXT('Godot','Restriction') );
PLSQL_LOG('card_request_admin.get_card_request:execute development.security_set_context.set_context('|| SYS_CONTEXT('Godot','user')||','|| SYS_CONTEXT('Godot','company')||','||SYS_CONTEXT('Godot','node')||','||SYS_CONTEXT('Godot','bank')||','||SYS_CONTEXT('Godot','mgr')||','||SYS_CONTEXT('Godot','provider')||','||SYS_CONTEXT('Godot','verif_code')||','||SYS_CONTEXT('Godot','Restriction')||');' );
PLSQL_LOG('card_request_admin.get_card_request:ps_Req_First_Name = '||ps_Req_First_Name );
PLSQL_LOG('card_request_admin.get_card_request:ps_Req_Last_Name = '||ps_Req_Last_Name );
PLSQL_LOG('card_request_admin.get_card_request:pn_Request_Type = '||pn_Request_Type );
PLSQL_LOG('card_request_admin.get_card_request:pn_Request_Status = '||pn_Request_Status );
PLSQL_LOG('card_request_admin.get_card_request:pn_Ageing = '||pn_Ageing );
PLSQL_LOG('card_request_admin.get_card_request:pn_Ageing_compare = '||pn_Ageing_compare );
PLSQL_LOG('card_request_admin.get_card_request:pn_Application_Id = '||pn_Application_Id );
PLSQL_LOG('card_request_admin.get_card_request:ps_Embossed_Name = '||ps_Embossed_Name );
PLSQL_LOG('card_request_admin.get_card_request:ps_Structure_Point = '||ps_Structure_Point );
PLSQL_LOG('card_request_admin.get_card_request:ps_Date_From = '||ps_Date_From );
PLSQL_LOG('card_request_admin.get_card_request:ps_Date_To = '||ps_Date_To );
PLSQL_LOG('card_request_admin.get_card_request:ps_Approver_Name = '||ps_Approver_Name );
PLSQL_LOG('card_request_admin.get_card_request:ps_Processor_Name = '||ps_Processor_Name );
PLSQL_LOG('card_request_admin.get_card_request:pn_Company_Id = '||pn_Company_Id );
PLSQL_LOG('card_request_admin.get_card_request:pn_Requestor_Or_Approver = '||pn_Requestor_Or_Approver);
PLSQL_LOG('card_request_admin.get_card_request:pn_callingUserId = '||pn_callingUserId);
PLSQL_LOG('card_request_admin.get_card_request:pn_Screen_output = '||pn_Screen_output);
--end if;
if pn_iso_code = 0 or pn_iso_code is NULL then
ln_iso_code := 826 ;
else
ln_iso_code := pn_iso_code;
end if;
ls_Select := '
select
RM.SUBMIT_DATE
,DECODE(rm.requestor_super_user_id, NULL, NULL, ''Superuser on behalf of '') ||
DECODE(RM.REQUESTOR_USER_ID, null, RD.FIRST_NAME || '' '' || RD.LAST_NAME, RU.FIRST_NAME || '' '' || RU.LAST_NAME ) as REQUESTOR_NAME
,DECODE(rm.request_status,
'||cst.c_card_request_org_approve||', rm.company_approval_date,
'||cst.c_card_request_bank_approve||', rm.bank_approval_date
, NULL) as approval_date
,DECODE( RM.REQUEST_STATUS,
:1, DECODE(rm.comp_apprvr_super_user_id, NULL, NULL, ''Superuser on behalf of '') ||CA.FIRST_NAME || '' '' || CA.LAST_NAME,
:2, DECODE(rm.comp_apprvr_super_user_id, NULL, NULL, ''Superuser on behalf of '') ||CA.FIRST_NAME || '' '' || CA.LAST_NAME,
:3, BA.FIRST_NAME || '' '' || BA.LAST_NAME,
:4, BA.FIRST_NAME || '' '' || BA.LAST_NAME,
null) as APPROVER_NAME
,nvl(L.TEXT_STRING, to_char(RM.REQUEST_TYPE)) as REQUEST_TYPE_DESC
, decode(rm.bca_card_id,
NULL,decode(rm.card_id, NULL,NULL ,(SELECT co_bca.name_desc FROM company co_bca,card bca WHERE bca.card_id = c.bca_card_id AND bca.company_id_external = co_bca.company_id ) ),
(SELECT co_bca.name_desc FROM company co_bca,card bca WHERE rm.bca_card_id = bca.card_id AND bca.company_id_external = co_bca.company_id )
) as COMPANY_NAME
,SUBSTR(ENCRYPT_FD.decrypt_ext_company_id(co.external_company_id), 1, LENGTH(ENCRYPT_FD.decrypt_ext_company_id(co.external_company_id))-LENGTH(dp.data_provider))
, DECODE(c.card_no,NULL,NULL,encrypt_fd.display_card_no(c.card_no)) AS card_no
,chu.first_name || '' '' || chu.last_name as card_user_name
,C.EMBOSSED_NAME || '' '' || C.EMBOSSED_LINE2 as company_embossed_name
,RD.HOME_ADDRESS_LINE_1, RD.HOME_ADDRESS_LINE_2, RD.HOME_ADDRESS_LINE_3, RD.HOME_ADDRESS_LINE_4 ||'' ''||RD.HOME_ADDRESS_LINE_5 as HOME_ADDRESS_LINE_4,
RD.HOME_PHONE, RD.BUSINESS_PHONE ,RD.HOME_ADDRESS_COUNTRY
,decode (code.code,null,null,code.code||'' - ''|| code.description) as auth_strat
,RD.TOTAL_CREDIT_LIMIT
,code_card_status.description as CARD_STATUS
,rd.status_change_comment
,RM.CARD_REQUEST_ID
,decode (rm.request_status ,2,''For final approval'' ,3,''Approved'' ,4,''Rejected'' ,9,''Unsuccessful'' , -9, ''Reset failed'', to_char(RM.REQUEST_STATUS)) as request_status
,RM.REQUEST_TYPE
,rd.shipping_option
IF pn_Screen_output = 1 THEN
ls_Select := ls_Select || '
,TRUNC(SYSDATE, ''DD'') - TRUNC(RM.SUBMIT_DATE, ''DD'') as request_age
, RM.UPDATE_TAG
, c.card_id
, rm.bca_card_id
, rm.requestor_user_id
, rm.request_status as request_status_int
, decode(rm.bca_card_id, NULL,NULL, (SELECT ENCRYPT_FD.decrypt_ext_company_id(co_bca.external_company_id) FROM company co_bca,card bca WHERE rm.bca_card_id = bca.card_id AND bca.company_id_external = co_bca.company_id ) ) as external_company_id
END IF;
ls_SelectFrom := '
FROM
card_request_master rm
,card_request_data_view rd
,users ru
,users rsu
,users ca
,users ba
,company co
,provider dp
,product p
,card c
,request_type rt
,language_string l
,code
,users chu
,code code_card_status
ls_Where := '
WHERE RM.CARD_REQUEST_ID = RD.CARD_REQUEST_ID
AND RM.REQUESTOR_USER_ID = RU.USER_ID(+)
AND rm.requestor_super_user_id = rsu.user_id(+)
AND RM.COMPANY_APPROVER_USER_ID = CA.USER_ID(+)
AND RM.BANK_APPROVER_USER_ID = BA.USER_ID(+)
AND RM.COMPANY_ID = CO.COMPANY_ID
AND RM.CARD_ID = C.CARD_ID(+)
AND C.PRODUCT_ID = P.PRODUCT_ID(+)
-- predicate_PRODUCT trick for performance
and p.product_id in ( select distinct product_id from card )
AND P.DATA_PROVIDER = DP.DATA_PROVIDER(+)
AND RM.REQUEST_TYPE = RT.REQUEST_TYPE
AND RT.STRING_ID = L.STRING_ID
AND l.iso_code = '||ln_iso_code||'
AND rm.auth_strat_code_id = code.code_id(+)
AND chu.user_id(+) = c.user_id
AND code_card_status.code_id(+) = rm.card_state_code_id
IF pn_callingUserId IS NOT NULL THEN
ls_Where := ls_Where || ' AND C.USER_ID != '||pn_callingUserId||' ';
END IF;
CASE pn_Requestor_Or_Approver
WHEN C_CARD_REQUESTOR THEN ls_Where := ls_Where || ' and RM.Requestor_User_Id = :5 ';
WHEN C_COMPANY_APPROVER THEN ls_Where := ls_Where || ' AND RM.REQUESTOR_USER_ID != SYS_CONTEXT(''Godot'', ''user'') ' ;
WHEN C_BANK_APPROVER THEN ls_Where := ls_Where || ' and RM.Bank_Approver_User_Id = :5 ';
END CASE;
if ps_Req_First_Name is not null then
ls_Where := ls_Where || ' and ( UPPER(RD.FIRST_NAME) like ''' || common.fix_odd_quotes(ps_Req_First_Name) || ''' or UPPER(RU.FIRST_NAME) like ''' || common.fix_odd_quotes(ps_Req_First_Name) || ''') ';
end if;
if ps_Req_Last_Name is not null then
ls_Where := ls_Where || ' and ( UPPER(RD.LAST_NAME) like ''' || common.fix_odd_quotes(ps_Req_Last_Name) || ''' or UPPER(RU.LAST_NAME) like ''' || common.fix_odd_quotes(ps_Req_Last_Name) || ''') ';
end if;
if pn_Request_Type is not null then
ls_Where := ls_Where || ' and RM.REQUEST_TYPE = ' || pn_Request_Type || ' ';
end if;
if pn_Request_Status is not null then
ls_Where := ls_Where || ' and RM.REQUEST_STATUS = ' || pn_Request_Status || ' ';
end if;
if pn_Ageing is not null then
ls_Where := ls_Where || ' and TRUNC(SYSDATE, ''DD'') - TRUNC(RM.SUBMIT_DATE, ''DD'') ' ;
CASE
WHEN pn_Ageing_compare = 1 THEN ls_Where := ls_Where || ' < ';
WHEN pn_Ageing_compare = 2 THEN ls_Where := ls_Where || ' > ';
WHEN pn_Ageing_compare = 3 THEN ls_Where := ls_Where || ' = ';
ELSE ls_Where := ls_Where || ' != ';
END CASE;
ls_Where := ls_Where || pn_Ageing || ' ';
end if;
if ps_Embossed_Name is not null then
ls_Where := ls_Where || ' and ( UPPER(RD.EMBOSSED_LINE1) like ''' || common.fix_odd_quotes(ps_Embossed_Name) || ''' or UPPER(RD.EMBOSSED_LINE2) like ''' || common.fix_odd_quotes(ps_Embossed_Name) || ''') ';
end if;
if ps_Structure_Point is not null then
ls_Where := ls_Where || ' and UPPER(S.DESCRIPTION) like ''' || common.fix_odd_quotes(ps_Structure_Point) || ''' ';
end if;
if ps_Date_From is not null then
ls_Where := ls_Where || ' and RM.SUBMIT_DATE >= to_date(''' || common.fix_odd_quotes(ps_Date_From) || ''', ''DD/MM/YY'') ';
end if;
if ps_Date_To is not null then
ls_Where := ls_Where || ' and RM.SUBMIT_DATE <= to_date(''' || common.fix_odd_quotes(ps_Date_To) || ''', ''DD/MM/YY'') ';
end if;
if ps_Approver_Name is not null then
ls_Where := ls_Where || ' and UPPER(DECODE( RM.REQUEST_STATUS, '|| CST.C_CARD_REQUEST_ORG_APPROVE ||', CA.FIRST_NAME || '' '' || CA.LAST_NAME, '||CST.C_CARD_REQUEST_BANK_WITHDRAW||', CA.FIRST_NAME || '' '' || CA.LAST_NAME, '||CST.C_CARD_REQUEST_BANK_APPROVE||', BA.FIRST_NAME || '' '' || BA.LAST_NAME, '||CST.C_CARD_REQUEST_AT_PROCESSOR||', BA.FIRST_NAME || '' '' || BA.LAST_NAME, null)) like ''' || common.fix_odd_quotes(ps_Approver_Name) || ''' ' ;
end if;
--if ps_Processor_Name is not null then
-- ls_Where := ls_Where || ' and UPPER(DP.NAME) like ''' || ps_Processor_Name || ''' ';
--end if;
if pn_Company_Id is not null then
ls_Where := ls_Where || ' and RM.COMPANY_ID = ' || pn_Company_Id || ' ';
end if;
if lb_Debug then
PLSQL_LOG( 'select count(*) ' || ls_SelectFrom || ls_Where );
end if;
CASE pn_Requestor_Or_Approver
WHEN C_CARD_REQUESTOR THEN
execute immediate 'select count(*) ' || ls_SelectFrom || ls_Where
into pn_Result using SYS_CONTEXT('Godot','user');
WHEN C_COMPANY_APPROVER THEN
execute immediate 'select count(*) ' || ls_SelectFrom || ls_Where
into pn_Result;
WHEN C_BANK_APPROVER THEN
execute immediate 'select count(*) ' || ls_SelectFrom || ls_Where
into pn_Result;
END CASE;
if lb_Debug then
PLSQL_LOG( 'CORPORATE.CARD_REQUEST_ADMIN.GET_CARD_REQUEST count: ' || pn_Result );
end if;
if pn_Result > 0 then
ls_Order_By := ' Order By RM.SUBMIT_DATE ';
if lb_Debug then
PLSQL_LOG( ls_Select || ls_SelectFrom || ls_Where || ls_Order_By );
end if;
CASE pn_Requestor_Or_Approver
WHEN C_CARD_REQUESTOR THEN
open pc_Cursor for ls_Select || ls_SelectFrom || ls_Where || ls_Order_By
using CST.C_CARD_REQUEST_ORG_APPROVE, CST.C_CARD_REQUEST_BANK_WITHDRAW,
CST.C_CARD_REQUEST_BANK_APPROVE, CST.C_CARD_REQUEST_AT_PROCESSOR,SYS_CONTEXT('Godot','user');
WHEN C_COMPANY_APPROVER THEN
open pc_Cursor for ls_Select || ls_SelectFrom || ls_Where || ls_Order_By
using CST.C_CARD_REQUEST_ORG_APPROVE, CST.C_CARD_REQUEST_BANK_WITHDRAW,
CST.C_CARD_REQUEST_BANK_APPROVE, CST.C_CARD_REQUEST_AT_PROCESSOR;
WHEN C_BANK_APPROVER THEN
open pc_Cursor for ls_Select || ls_SelectFrom || ls_Where || ls_Order_By
using CST.C_CARD_REQUEST_ORG_APPROVE, CST.C_CARD_REQUEST_BANK_WITHDRAW,
CST.C_CARD_REQUEST_BANK_APPROVE, CST.C_CARD_REQUEST_AT_PROCESSOR;
END CASE;
end if;
for i in pc_Cursor
loop
dbms_output.put_line(i.REQUESTOR_NAME);
end loop;
EXCEPTION
WHEN OTHERS THEN
CORPORATE.COMMON.EXCEPTION_LOG( 'Procedure: CORPORATE.CARD_REQUEST_ADMIN.GET_CARD_REQUEST ', SQLCODE, SQLERRM, null, FALSE );
pn_Result := SQLCODE;
END GET_CARD_REQUEST_SS;
<code> -
Calling server side procedures from forms
Hi
I am trying to add a server side procedure to a form. The procedure is held in a package which resides on a remote database and I have set-up database links to this database.
When I run the form, calling the procedure, the oracle forms runtime session closes without displaying any error messages.
I have successfully called the procedure from database triggers in different databases.
Does anyone know whats going on?
I am using forms 5.0 with a oracle 7.3 database
Thanks!!
nullCheck out the method:
LibraryObject.invokeServerMethod(String, Serializable)
I think this may be exactly what you're looking for.
Maybe you are looking for
-
Error in Managed System Configuration - Sol Man 7.1
Dear Experts, Whle configuring using solman_setup, I am getting below mentioned error in Managed System Configuaration: Cannot retrieve CIM Instances from CIM Class 'SAP_DiagnosticsRelevantSoftwareFeature'! Cannot retrieve all CIM Instances from CIM
-
Is there an app for "while you were out" messaging?
Is there an app for "while you were out" messages?
-
Can I use an unlocked iPhone in the US
Last year, I bought an unlocked iPhone, so I could use it in Brazil. This year I am moving to the States and would like to keep my phone - what should I do? Thanks!
-
Hi, I had deployed the fileupload application in weblogic & i am using apache server to access the URL.some times when i tried to upload a file, i'm getting below exception.. +"ERROR CommonsMultipartRequestHandler - Failed to parse multipart request+
-
Microsoft Office 2011 won't open on my Macbook Pro.
I have a Macbook Pro and I updated to OS X Yosemite (v. 10.10.1) and now that it's running that software, the Microsoft Office applications aren't opening. This is the problem details and system configuration: Process: Microsoft Word [9