- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: PL/SQL procedure dynamic execution
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2004 08:11 PM
тАО06-07-2004 08:11 PM
That's not stricly necessary in my case, but I was wondering how is it possible to execute a PL/SQL procedure given that this call will be dynamically built.
See the example below and the last 3 comments ...
Thank for you idea,
Nicolas
CREATE OR REPLACE FUNCTION rcp_sld_appli (app IN VARCHAR2 DEFAULT 'VIDE')
RETURN number
IS
ladate DATE;
appli VARCHAR2(3);
mois VARCHAR2(2);
proc VARCHAR2(25);
instruction VARCHAR2(100);
BEGIN
appli := upper(app);
DBMS_OUTPUT.ENABLE(100000);
/* Chosse wich procedure to call */
IF ( appli = 'CDE' ) THEN
proc := 'KAGRRST.P_NEW_MONTH_CDE';
ELSIF ( appli = 'GL' ) THEN
proc := 'KAGRRST.P_NEW_MONTH_GL';
END IF;
/* Choose the time period */
SELECT to_char(sysdate+15,'MM') INTO mois FROM DUAL;
instruction := proc||'('''||to_char(mois)||''')';
-- DBMS_SQL.EXECUTE instruction;
-- EXECUTE IMMEDIATE 'call instruction';
-- PLVdyn.PLSQL(instruction);
END;
/
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2004 08:34 PM
тАО06-07-2004 08:34 PM
Re: PL/SQL procedure dynamic execution
EXECUTE IMMEDIATE 'BEGIN '||instruction||'; END; ' ;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2004 10:52 PM
тАО06-07-2004 10:52 PM
Re: PL/SQL procedure dynamic execution
just a remark.
dbms_sql can
a) parse once
b) execute over and over and over
execute immediate cannot do that. it parse/executes each time.
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-07-2004 11:04 PM
тАО06-07-2004 11:04 PM
Re: PL/SQL procedure dynamic execution
in general, execute immediate is good for ONE TIME execution of a dynamic sql statement.
dbms_sql is good for REPEATED executions.
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2004 12:28 AM
тАО06-08-2004 12:28 AM
Re: PL/SQL procedure dynamic execution
Thanks for you comments.
The code is executed just once.
Furthermore, can you call a PL/SQL procedure using DBMS_SQL.EXECUTE ?
Can you provide an example ?
Cheers
Nicolas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2004 01:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-08-2004 01:44 AM
тАО06-08-2004 01:44 AM