Scope of local modules

Many articles concerning PL/SQL best practices promote the use of local modules for code clarity. I am wondering how this affects testability due to limited scope (we use utplsql.)
For example, if I write
PROCEDURE A
IS
PROCEDURE B...
PROCEDURE C...
BEGIN
// procedure A body
END A;
is there any way that I can expose or fully qualify B or C for testing, without moving them outside of A ?? As far as I can tell, the answer is no, but I'm wondering if someone out there knows a trick that I have overlooked.
Thanks for the help,
Mark

Hello
Well, I'm probably going to get slated for saying this but [opinion]I think the idea that local modules somehow improve code clarity is highly misguided. There are cases (very few I have come across) where they can be of use but in the long term I think they can easily lead to very poorly structured code and make it very easy for subsequent developers to take nasty little short cuts. I accept that virtually all program constructs can be abused, but I have found that local modules bring out some of the worst coding "practices" I have ever seen, and I am yet to see any benefit other than for anonymous pl/sql blocks, and very simple helper routines such as string formatters or expression generators.
Like all tools, they should be used when necessary, when they fit the problem at hand, and not applied as an over-all "best practice". I tend to be very sceptical of any one size fit's all approaches to development so maybe I'm slightly prejudiced.
The issue you have raised, to me at least, is one reason why you would not use local procs. If they are complex enough to require testing that requires them to be called in isolation, I think they should probably be separate.
[opinion]
HTH
David

Similar Messages

  • "Local Module is not an executable or is a link" when starting Messaging Server

    "Local Module is not an executable or is a link" when starting Messaging Server
    <P>
    If you see error messages like this one when you try to start Netscape
    Messaging Server:<P>
    19971009095543:Dispatch:Notification:Local Module (Account-Handler) is
    not an executable or is a link.
    Module not loaded.
    Startup Problem:
    Module Error-Handler is required for proper operation.
    Netscape Messaging Server Exiting!
    You may have a file permissions problem. This can happen if you change
    the Unix account that Messaging Server runs as. Try changing the
    permissions on the "bin" directory in your Netscape server root to make
    sure that the current Messaging Server user account has access to it
    (try granting public read and execute permissions to that directory);
    this should solve the problem.<P>

    BombingParadise wrote:
    Found out I need the latest version. I try downloading the latest version before and it keeps giving me this error saying I need to retry later. I restart my computer and try it again but I'm still getting the error >:\No you don't, Minecraft is built for Java 6.
    Amazing how you can do something as difficult as mod a game not yet built to be modded and yet not even know the basics of the basics of the command prompt, nor have the capacity to research it apparently.

  • Local Module (Error-Handler) Failed the verify environment test

    When attempting to start the Messaging Server, the following error
    message occurs and the server fails to start:
    <P>
    19980226114147:Dispatch:Notification:Local Module (Error-Handler) Failed
    the verify environment test.
    <BR>Module not Loaded.
    <BR>Startup Problem:
    <BR>Module Error-Handler is required for proper operation.
    <BR>Netscape Messaging Server Exiting!
    <P>
    This problem can be caused by a corruption to the configuration file
    for the admin server that controls the Messaging server
    (install_dir/admin-serv/ns-admin.conf).
    Specifically, if the
    <B>Port</B> setting is missing, the above-mentioned error will occur.
    <P>
    Add a valid <B>Port</B> setting to the
    ns-admin.conf file and
    rerun the /etc/NscpMail start command.

    Is anyone having any idea about it...

  • Scope order: local vs argument

    Hi,
    According to http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec09af4 -7fdf.html, LOCAL variables take precedence to ARGUMENTS variables.  However, when I access an unscoped variable in a CFC function that is available in both LOCAL and ARGUMENTS, I get back the ARGUMENTS scope.  Why is that?  I am using CF 9,0,0,251028.
    <cfcomponent>
        <cffunction name="testFunction" access="public" returntype="string">
            <cfargument name="x" default="argument">
            <cfset LOCAL.x = "local">
            <cfreturn x />
        </cffunction>
    </cfcomponent>
    <cfset obj = createObject( "component", "component.Test" )>
    <cfoutput>#obj.testFunction("argument")#</cfoutput>
    The output I get back is "argument" instead of "local".
    The other thing that I find weird is that if I replace
    <cfset LOCAL.x = "local">
    with
    <cfset var x = "var">
    I get the error message "X is already defined in argument scope".

    Hmm, I have never heard of the "local" scope. Are you sure the doc is not referring to <cfset var x = "local" /> as being a local variable? Try changing your example to the following:
        <cffunction name="testFunction" access="public" returntype="string">
            <cfargument name="x" default="argument" />
            <cfset var x = "local" />
            <cfreturn x />
        </cffunction>

  • Cannot find scope's local variable

    I am doing the soa tutorial. In the step of 5.11.5 Task 5: Reference the RequriesApprovalRule Dictionary in the BPEL Designer, I cannot find the variable of IorderApproved when I add "assign output facts" in the business rule activity.
    A local variable named "lOrderApproved" was defined in the scope Scope_CheckApprovalLimit. According to the tutorial, I create the business rule and refered it in BPEL.
    However, in the step of Assign Input Facts, I cannot see the lOrderApproved under the Scope_CheckApprovalLimit.

    There are lot of sequence of steps in this tutorial. If you miss something you cannot proceed further. I would redo from first step.
    post here in the BPEL forum
    BPEL

  • ESS/MSS Scope for all Modules

    Dear All,
    My Client is implementing all the following modules: OM; PA; Time; Payroll; Comepnsation Mgmt.; Training & Event Mgmt; Personnel Development; Recruitment.
    Now they want to go for ESS & MSS also. I have rough idea of ESS & MSS functionalities but not aware what all functionalities it give with respect to these modules.
    I need to give the scope/efforts along with the timelines.
    Kindly help me in understanding the functionalities of ESS/MSS related to above mentioned modules.
    If you have any document, kindly share.
    Regards,
    -Tina

    Hi Tina,
    Check the below link you will get full details about functionalities of ESS/MSS
    https://websmp107.sap-ag.de/~form/sapnet?_SHORTKEY=01100035870000698507&
    and
    http://help.sap.com/erp2005_ehp_05/helpdata/en/14/60cd56b1514ae5aa811d2aa4a59de3/frameset.htm
    and
    https://websmp204.sap-ag.de/erp-ehp
    With Regards
    Seranjeeve Kumar

  • Scope of Func module???

    Hi guys
    Customer using Func group ZXXXXX, and using BDCRECXY include inside funcgroup
    to access for Func modules.
    In func module Z_XXXX_PLAN, PERFORM BDC_TRANSACTION statement is
    called and "Call transaction CJ30" is used under Subroutine "BDC_TRANSACTION"
    inside the BDCRECXY
    How to make sure that This Func module is calling include BDCRECXY using BDC_TRANSACTION Subroutine.
    In the where used list for BDCRECXY program,it listed only 2 other programs(Func module) LZPS00010U14 and LF040TOP.
    How to make believe that BDC_TRANSACTION is calling BDCRECXY include?
    Regards
    jaichan

    Hi Sreenivas,
    Thanks for your reply.
    Anyother way do we have to findout without working on editor?
    Because I dont have Test data as well as System in front of me.
    regards
    Jaichan

  • Inter module call ( no ear )

    I have an appli say A containing EJB A, and a standalone module say MB containing EJB B.
    MB is deployed standalone ( not in an ear).
    I do not succeed to call EJB B from EJB A.
    there is an ejb-ref in the module of A with an ejb-link to ejb B but when I deploy I get : Error: Unresolved : Test9
    I alse have tried this syntax :
    <ejb-link>moduleName#Test9<ejb-link>
    I also get an error saying it could not find the module.
    Any idea ?
    thanks
    Michel

    I suppose you're trying to access the EJB's using "Local Interfaces". If this is the case your problem is due to the scope of every module, I mean MA can only see the LocalInterfaces of its EJB container, so it won't see any Local Interfaces from MB.
    If you put this two modules in a single EAR you can use local references from MA to MB adding the MB jar file to the classpath of MA (using the "manifest" archive of the jar file).
    I hope this helps you.

  • ModuleData.getPrincipalData returns null in the adapter module development

    Hi gurus,
    i am doing a test on the adapter module development following an article written by William Li:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0ac06cf-6ee2-2c10-df98-e17430ca5949?QuickLink=index&overridelayout=true
    my problem is after the EJB has been deployed, it seems that the return of inputModuleData.getPrincipalData() is always null which makes the program can not get the xml payload from the framework.
    the main process of the example has been simplified like this:
         public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {
              Object           obj = null;
              try {
              obj = inputModuleData.getPrincipalData();
              Message     msg1 = (Message) obj;          
                    XMLPayload xmlpayload = msg1.getDocument();}          
              catch (Exception e) {
                   ModuleException me = new ModuleException(e);
                   throw me;
              return inputModuleData;
    after deployed, i get the following error in the adapter monitor of RWB: (my JNDI is testtest)
    17.02.2012 17:13:44.643 Information Send binary file  "test8.xml" from FTP server "10.18.48.150:/encrypt_test/", size 206 bytes with QoS EO
    17.02.2012 17:13:44.644 Information MP: processing local module localejbs/CallSapAdapter
    17.02.2012 17:13:44.644 Information Application attempting to send an XI message asynchronously using connection File_http://sap.com/xi/XI/System
    17.02.2012 17:13:44.645 Information Trying to put the message into the send queue
    17.02.2012 17:13:44.648 Information MP: processing local module localejbs/testtest
    17.02.2012 17:13:44.648 Error MP: exception caught with cause java.lang.NullPointerException: while trying to invoke the method com.sap.engine.interfaces.messaging.api.Message.getDocument() of an object loaded from local variable 'msg1'
    whereas if the code has been changed like this:
         public ModuleData process(ModuleContext moduleContext, ModuleData inputModuleData) throws ModuleException {
              Object           obj = null;
              try {
                   obj = inputModuleData.getPrincipalData();
                   Message     msg1 = (Message) obj;     
                   if (obj != null )
                        XMLPayload xmlpayload = msg1.getDocument();
              catch (Exception e) {
                   ModuleException me = new ModuleException(e);
                   throw me;
              return inputModuleData;
    the file can be read by the file adapter.
    i just quite confused that why the return of the getPrincipalData() is null? where is the problem? thanks
    Edited by: Stephen Xue on Feb 17, 2012 5:22 AM

    I'm gonna reply to myself here. I changed the processing sequence of the adapter modules in the  in the FileSender channel so that my module comes first then CallSapAdapter. Then getPrincipalData() contains the message.
    Hope this helps someone else.

  • Mail adapter and MessageTransformBean module configuration issue

    Hi All,
    I am trying to use module configuration in Receiver Mail adapter. Below is my configuration. (We are using SAP PI 7.11)
    Parameter/General tab:
    Message Protocol : XIPAYLOAD
    Use Mail package option is selected.
    Content Encoding = none
    Module tab:
    Processing Sequnce:
    AF_Modules/MessageTransformBean  : XSLT
    sap.com/com.sap.aii.adapter.mail.app/XIMailAdapterBean : mail
    Module Configuration:
    XSLT    Transform.Class                        com.sap.aii.af.sdk.xi.adapter.XSLTConversion
    XSLT    Conversion.XSLTFileName     /tmp/GL_POST_RESPONSE_EMAIL.xsl
    XSL works outside of PI . However, when i test with a message, I am seeing following errors in Runtime workbench:
    Please let me know what could be wrong in the above configuration
    23.03.2011 15:24:39 Information MP: processing local module localejbs/AF_Modules/MessageTransformBean
    23.03.2011 15:24:39 Information Transform: using Transform.Class: com.sap.aii.af.sdk.xi.adapter.XSLTConversion
    23.03.2011 15:24:39 Error Transform: Transformer Conversion1.0.0610 Error initializing XSLT Mode:; caused by javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
    23.03.2011 15:24:39 Information Transform: transforming the payload ...
    23.03.2011 15:24:39 Error Transform: failed to execute the transformation: com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Error converting Message; nested exception caused by: java.lang.NullPointerException: while trying to invoke the method javax.xml.transform.Templates.newTransformer() of an object loaded from local variable templates
    23.03.2011 15:24:39 Error MP: exception caught with cause com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Error converting Message; nested exception caused by: java.lang.NullPointerException: while trying to invoke the method javax.xml.transform.Templates.newTransformer() of an object loaded from local variable 'templates'
    23.03.2011 15:24:39 Error Adapter Framework caught exception: Error converting Message
    23.03.2011 15:24:39 Error Delivering the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.sdk.xi.adapter.trans.TransformException: Error converting Message; nested exception caused by: java.lang.NullPointerException: while trying to invoke the method javax.xml.transform.Templates.newTransformer() of an object loaded from local variable 'templates'.

    Hi All,
    Issue has been resolved. There was some minor issue in the XSL. The XSL Stylus studio was not reporting this as an error. However PI's XSL engine was reporting that error. This error message was not showing up in runtime workbench. However, when i looked at the default trace, there were few more errors. After fixing the XSL, I am able to received the email
    Thanks
    -Pradeep

  • Error while Using RequestResponseBean Module

    hi All,
    I am trying to use RequestResponseBean Module in one of the scenario as given in these links:
    http://wiki.sdn.sap.com/wiki/display/XI/UsingRequestResponseBeanModuleinFILE+Adapter
    http://wiki.sdn.sap.com/wiki/display/XI/File-RFC-File(Without%20BPM)
    But i am getting below error in MDT of sender File channel.
    2010-04-16 15:55:45 Information MP: processing local module localejbs/AF_Modules/ResponseOnewayBean
    2010-04-16 15:55:45 Information The message status was set to DLVD.
    2010-04-16 15:55:47 Error MP: exception caught with cause com.sap.engine.services.rmi_p4.exception.P4BaseRuntimeException: I/O operation failed : java.io.NotSerializableException: com.sap.engine.services.ts.jta.impl.TransactionImpl :
    2010-04-16 15:55:47 Error File processing failed with com.sap.engine.services.rmi_p4.exception.P4BaseRuntimeException: I/O operation failed : java.io.NotSerializableException: com.sap.engine.services.ts.jta.impl.TransactionImpl :
    I am working on PI EHP1.
    Please help me in resolving this issue.
    Thanks,
    Mayank

    Mayank,
    Using Request Response bean had some problems when used in PI 7.1, I don't whether it is still in Ehp1 as well but we could use the RequestResponse bean by implementing OSS note 1261159.
    Below forum should be helpful
    [File-RFC-File Synchronous scenario error;
    Thanks,
    Amit

  • OPI2 EDIFACT adapter - Module Exception Error

    Hi,
    We are on pI 7.0. Deployed open source custom EDI adapter (OPI2).
    Scenario: IDOC - - - xi -- - EDIFACT
    When I executed the scenario, I get the following error in comm channel monitoring.
    2010-10-14 14:19:52 Success Message successfully received by messaging system. Profile: XI URL: http://xidev:50000/MessagingSystem/receive/AFW/XI Credential (User): PIISUSER
    2010-10-14 14:19:52 Success Using connection EDIFACT_http://cbsgmbh.com/xi/EDIFACT/Adapter. Trying to put the message into the receive queue.
    2010-10-14 14:19:52 Success Message successfully put into the queue.
    2010-10-14 14:19:52 Success The message was successfully retrieved from the receive queue.
    2010-10-14 14:19:52 Success The message status set to DLNG.
    2010-10-14 14:19:52 Success Delivering to channel: CC_EDIFACT_Orders_recv
    2010-10-14 14:19:52 Success MP: Entering module processor
    2010-10-14 14:19:52 Success MP: Processing local module localejbs/opi2/edifact/CryptModule
    2010-10-14 14:19:52 Error MP: Exception caught with cause com.sap.aii.af.mp.module.ModuleException caused by: java.lang.NullPointerException
    2010-10-14 14:19:52 Error Exception caught by adapter framework: null
    Please help,
    mk

    Hi,
    I have removed "CRYPT" module from communication channel modules list since I am not using any encryption at this time. However, I get different error as below.
    MP: Exception caught with cause com.sap.aii.af.mp.module.ModuleException: Configuration lookup failed caused by: com.sap.aii.af.mp.module.ModuleException: Address normalization (alternativeID) is not defined for : agency = UNB  ZZZ  117, schema = UNBID, partyId = EDI_ATMEL
    Note: I have maintained AS2 ZZZ 117, AS2ID in both sender party & receiver party identifiers. Also, I have referred sender party and sender business system in receiver agreement header mapping.
    Please help,
    MK

  • Local procedures: in the documentation [FOUND!]

    Within a procedure or function, you can declare local procs/functions. These have to be declared after all the other variables, cursors, etc.
    However, I'm struggling to find where it states this in the oracle documentation (although I found a comment in Steve Feuerstein's Oracle PL/SQL Programming)! Can anyone with better oracle-documentation-fu than me find it - or confirm that it's not there?
    (This came about because one of my colleagues raised an issue with declaring a local procedure before the variable declarations, and I wanted to point them to a link in the docs which tells them about where they should declare it.)

    heh, no didn't think of subprograms either. Subprocedures Sub procedure (did you know there's a procedure called Sub?!), sub module, local procedure, local module... etc
    My oracle-documentation-fu severely lacking today! Thankfully, its working for others *{:-D                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • Module on N7K suddenly restarted

    Hi Guys,
    One of the module in cisco nexus 7010 suddenly restarted,
    2014 Nov 21 11:47:39 WIB MASTER %MODULE-2-MOD_NOT_ALIVE: Module 3 not responding... resetting (Serial number: JAF1612ASPA)
    2014 Nov 21 11:47:50 WIB MASTER %PLATFORM-2-MOD_DETECT: Module 3 detected (Serial number JAF1612ASPA) Module-Type 10/100/1000 Mbps Ethernet XL Module Model N7K-
    M148GT-11L
    2014 Nov 21 11:47:50 WIB MASTER %PLATFORM-2-MOD_PWRUP: Module 3 powered up (Serial number JAF1612ASPA)
    2014 Nov 21 11:47:50 WIB MASTER %PLATFORM-5-MOD_STATUS: Module 3 current-status is MOD_STATUS_POWERED_UP
    2014 Nov 21 11:50:04 WIB MASTER %PLATFORM-5-MOD_STATUS: Module 3 current-status is MOD_STATUS_ONLINE/OK
    2014 Nov 21 11:50:04 WIB MASTER %MODULE-5-MOD_OK: Module 3 is online (Serial number: JAF1612ASPA)
    2014 Nov 21 11:50:03 WIB MASTER %SYSMGR-SLOT3-5-MODULE_ONLINE: System Manager has received notification of local module becoming online.
    2014 Nov 21 11:51:49 WIB MASTER %BIOS_DAEMON-SLOT3-5-BIOS_DAEMON_LC_PRI_BOOT:  System booted from Primary BIOS Flash
    Please tell me what is the root cause which made the problem occurred.
    Thank you 
    Best regards,
    hery

    Hello Hery,
    Generally, supervisor probe all the linecard by using hearbeat messages. Due to some reason supervisor did not hear any keepalive reply from any linecard then supervisor reset that linecard to recovery .
    2014 Nov 21 11:47:39 WIB MASTER %MODULE-2-MOD_NOT_ALIVE: Module 3 not responding... resetting (Serial number: JAF1612ASPA)
    From the above log, it looks like same thing happened in your case also . This is due to  multiple reason , But most of the time EOBC congestion, EOBC drop or bad fabric connection . This could be either hardware issue or transit issue.
    you can set diag level complete and reset the linecard once . After reseat (physical reseat- means remove the Linecard and insert it back) if you see any diagnostic failure or crash again then you need to replace the card otherwise its transit issue .
    HTH
    Regards,
    VS.Suresh.
    *Plz rate the usefull posts.

  • Flex 4 Modules and Stylesheets

    I am having trouble using stylesheets in a module, in particular with class styles (i.e. ".myStyle"). They are not loading at compile time. My module is:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Module xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx"
               xmlns:views="com.fosrias.portal.views.*"
               xmlns:maps="com.fosrias.portal.maps.control.*"
               layout="absolute">
        <fx:Style source="../assets/styles/main.css"/>     
        <views:PortalUI left="0" top="0" right="0" bottom="0"/>
    </mx:Module>
    Any my main.css contains
    mx|SomeComponent {
         etc.
    .myStyle {
         etc.
    The type style mx|Component loads, but the class style .myStyle does not. Should this work, or do I have to compile my styles to a swf and load them a runtime? Thanks

    So, the component's (which is a UIComponent subclass in the module) styleManager.ModuleFactory is the top-level application (ii.e. app embedding the module) system manager. Not, the local modul's systemManager.
    Chokes, means returns null on the getStyleDeclaration call.
    However, per the documentation here :
    http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-799a.html
    Using styles with modules
    When you set styles on modules, the style properties are set on the local StyleManager. Each module has its own instance of the IStyleManager2 class. This means that each module can load its own set of styles, and its styles do not necessarily affect the styles of other modules.
    After an application finishes loading a module, the module’s styles are merged with the styles of the application. The module’s StyleManager walks the chain of parent modules and applications, up to the top-level StyleManager, and merges its styles with those set on the StyleManagers above it.
    Thus, it seems the styles should merge and thus be accessible by the top-level system manager, no?
    That being said, if not, how do you actually locate the the local system manager instance to use it? Or can't you?
    Thanks.
    Mark

Maybe you are looking for

  • How to install Photoshop on Windows Vista ??

    How do I install Photoshop on Windows Vista ???

  • About Tranport Request Odrer.

    Hi All, I need to transport my request to quality and production ,what order i have to follow.. Here i have following objects:Cube update rule,data source cube,Function modules(User exit variables which is used in Multi Planning area),basic planing a

  • CS5 illustrator paint bucket ?

    I can't seem to locate the paint bucket for the live paint feature. Does anyone know where it is? It is not part of the tools like in CS3...

  • Change the owner of the job

    Hi Gurus, Can anybody please tell me how we can change the user name of the job. I had created a job in sm36, but everytime it runs, it shows my user name which we want to avoid, therefore can anybody suggest how we can change the job user name to BA

  • Lotus integration

    Hi, We need to integrate Lotus Domino with our NW04SP09. I found some documents regarding to Exchange integration but no useful documents about Lotus integration. Is there any document, how-to guide, presentation about this issue? Thanks in advance