function (value = > parameter) problem...

I created the example function:
< em > < color = "#808080" > create or replace function ttt (number of p) return number
is
Start
return p + 1;
end;
< / police > < /em >
< p >
< color = "#000000" > and I wonder why
< / make >
< em > < color = "#999999" > start
dbms_output.put_line (ttt (p = & gt; 2));
end; < / make >
< /em >
works, but

< color = "#999999" > < em > select ttt (p = & gt; 2) twice; < /em >
< / make >
doesn't work.

Can someone explain to me?

Pawel
< /p >

Hello

See this link [http://decipherinfosys.wordpress.com/2008/03/04/using-named-notations-in-functions-in-oracle-11g/] I think it could be useful.

Kind regards

Tags: Database

Similar Questions

  • Overload function "value data" problem on DataGrid Renderer button

    Hi all, I hope it is something simple.

    I have a class that extends the mx.controls.Button mx.core.IDataRenderer and implements.  I need to set the icon of the button whenever the Data property has the value of the data grid.  My problem is that my set/get overloaded function of data are never called (I reinforced with the debugging code).  Instead the set/get in Container.as functions (3.4 the Flex SDK kit) called.

    Here's the Basic code:

    exportButtonRenderer.as
    package controls
    {
    import flash.events.Event;
    import flash.events.MouseEvent;

    Import mx.controls.Button;
    Import mx.core.IDataRenderer;
    Import mx.controls.dataGridClasses.DataGridListData;
    Import mx.controls.listClasses.BaseListData;
    Import mx.events.FlexEvent;
    Import mx.controls.Alert;

    Import model.descriptors.compDescriptor;
    Import events.exportClickedEvent;

    public class exportButtonRenderer extends button implements IDataRenderer
    {
    Embed your icons
    [(Embed(source='/assets/icons/export.png')]
    [Bindable]
    public static var imageExport: Class;

    [(Embed(source='/assets/icons/blank.png')]
    [Bindable]
    public static var imageBlank: Class;

    public void exportButtonRenderer()
    {
    Super();
    }

    private var _listData:DataGridListData;
    override public function get listData (): BaseListData
    {
    Return _listData;
    }

    override public function set listData(value:BaseListData):void
    {
    _listData = DataGridListData (value);
    }

    private var _data:Object;
    public override function get data (): Object
    {
    return _data;
    }

    override public function set data(value:Object):void
    {
    _data = value;
    }

    override the clickHandler(event:MouseEvent):void function
    {

    super.clickHandler (event);
    }
    }
    }

    Now I know that I am using the Flexlib TreeGrid and not a standard DataGrid but when I trace through all the code all code firing the set/get functions is in any case the DataGrid control.

    Here is the my def grid in my main application mxml:

    Header 1
    < flexlib:TreeGrid
    ID = "MKTXGrid".
    dragEnabled = 'false' sortableColumns = 'false' showRoot = "false".
    (disclosureClosedIcon="@Embed(source='/assets/icons/arrow_right.png')".
    (disclosureOpenIcon="@Embed(source='/assets/icons/arrow_down.png')".
    (folderOpenIcon="@Embed(source='/assets/icons/psd.png')".
    (folderClosedIcon="@Embed(source='/assets/icons/psd.png')".
    Click = "MKTXGrid_clickHandler (Event)" "
    doubleClickEnabled = "true" doubleClick = "MKTXGrid_doubleClickHandler (event)" left = "0" right = "0" top = low "0" = "16" > "

    < flexlib:columns >
    < flexlib:TreeGridColumn dataField = "Name" headerText = "Name" minWidth = "200" width = "200" editable = "true" / >
    < mx:DataGridColumn dataField = 'ExportName"headerText ="Export Name"/ >
    < mx:DataGridColumn dataField = "Export" headerText = "Export" width = "50" minWidth = "20" resizable = "false" >
    < mx:itemRenderer >
    < mx:Component >
    < mx:Box horizontalAlign = "center" width = "100%" verticalScrollPolicy = "off" horizontalScrollPolicy = "off" >

    (< contrôles: exportButtonRenderer label = «Exporter» icon="@Embed(source='assets/icons/export.png')" width = "12" height = "12" useHandCursor = "true" >
    < controls: Click >
    <! [CDATA]
    Import events.exportClickedEvent;
    var e:exportClickedEvent = new exportClickedEvent();
    e.itemData = data;
    dispatchEvent (e);
    []] >
    < / controls: Click >
    < / controls: exportButtonRenderer >
    < / mx:Box >
    < / mx:Component >
    < / mx:itemRenderer >
    < / mx:DataGridColumn >
    < / flexlib:columns >
    < / flexlib:TreeGrid >


    Nothing too special happens.

    I know it can be done, I've seen examples in the SDK:

    http://opensource.Adobe.com/svn/opensource/Durango/trunk/ExternalFlexTools/com/dougmccune/ containers/accordionClasses/AccordionHeader.as

    Either incidentally, I reinforced with the code in the TreeGridItemRenderer class in Flexlib which works correctly and the class def starts like this:

    TreeGridItemRenderer.as
    import flash.display.DisplayObject;
    to import flash.display.InteractiveObject;
    import flash.display.Shape;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    to import flash.geom.Point;
    import flash.geom.Rectangle;

    Import flexlib.controls.TreeGrid;

    Import mx.controls.Image;
    Import mx.controls.dataGridClasses.DataGridListData;
    Import mx.controls.listClasses.BaseListData;
    Import mx.controls.listClasses.IDropInListItemRenderer;
    Import mx.controls.listClasses.IListItemRenderer;
    Import mx.core.IDataRenderer;
    Import mx.core.IFlexDisplayObject;
    Import mx.core.IToolTip;
    Import mx.core.SpriteAsset;
    Import mx.core.UIComponent;
    Import mx.core.UITextField;
    Import mx.events.FlexEvent;
    Import mx.events.ToolTipEvent;
    Import mx.events.TreeEvent;
    Import mx.managers.ILayoutManagerClient;
    Import mx.styles.IStyleClient;

    SerializableAttribute public class TreeGridItemRenderer extends UIComponent
    implements IDataRenderer,
    IDropInListItemRenderer,
    ILayoutManagerClient,
    IListItemRenderer
    {
    ...

    Any help would be great!

    It's because you put your component in a box.  The DataGrid control is affecting .data property of the box and without code is on your component.  You shouldn't really need box.  You can override updateDisplayList to Center your button instead.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • multi value parameter

    Hello

    I have a little problem. I want to spend a muliti value parameter in an Oracle application.
    Actually, I can pass a parameter, but if I chose two value I got an error like: ORA-00933: not correctly completed SQL command
    And if no value is selected, I want to show all values but get the same problem.

    so here's my request:

    SELECT distinct VTMM_PERSON. LASTNAME,
    VTMM_PERSON. FRSTNAME,
    VTMM_STAFF. RELPARENT,
    VTMM_PERSON. REVNAME,
    VTMM_STAFF. ASGNROLE

    TO THINK. VTMM_STAFF,
    THINK. VTMM_PERSON

    WHERE VTMM_PERSON. REVNAME = VTMM_STAFF. RELCHILD
    and VTMM_STAFF. RELPARENT =: RELPARENT--> I have a LOV and a parameter attached to it.
    and VTMM_STAFF. ASGNROLE =: ASGNROLE--> I have a LOV and a parameter attached to it.

    So, I want to choose two values by parameters or if nothing is selected I want to display all values.

    Hope someone can help me.
    Kind regards

    Arnaud

    Hello

    I guess it is a continuation of the question about BI Publisher? So then if you use this SQL:

    SELECT distinct VTMM_PERSON. LASTNAME,
    VTMM_PERSON. FRSTNAME,
    VTMM_STAFF. RELPARENT,
    VTMM_PERSON. REVNAME,
    VTMM_STAFF. ASGNROLE
    TO THINK. VTMM_STAFF,
    THINK. VTMM_PERSON
    WHERE VTMM_PERSON. REVNAME = VTMM_STAFF. RELCHILD
    and VTMM_STAFF. RELPARENT IN (: RELPARENT)
    and VTMM_STAFF. ASGNROLE IN (: ASGNROLE)

    Notice the change in the where statement. You can now change the settings that you created in BI Publisher in "All the values passed" instead of "Value NULL passed" where select all is selected. You can also change the setting of multiple selection if you want people to be able to make multiple choices from the LOV.

    This should get what you want.

    Kind regards

    Matt

  • My system restore function has a problem, error: AppName: rstrui.exe AppVer.5.1.2600.5512 ModName: c:\windows\system32\srrstr.dll

    original title: my system restore function has a problem

    my system restore function has a problem

    error signature

    AppName: rstrui.exe AppVer.5.1.2600.5512 ModName: c:\windows\system32\srrstr.dll
    ModVer.5.1.2600.5512 offset 00009836

    What can I do to recover my system restore feature?

    I was going to do an installation of hotfix os from the orignal disc but got waring the operating system installed is newer than the one on the disk (I have installed the latest service packs)

    Hello

    1 did you changes to the software to the computer?
    2. what happens when you try to use the system restore? You get the error message?

    You get this error message if you already have a newer version of the operating system and then if you try to install an older version on it.

    Method 1.
    Temporarily disable the security software installed on the computer and check if the problem persists.
    Important note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.
     
    Method 2.
    Please check if you are facing the same question when working in safe mode.
    a. restart your computer.
    b. when the computer starts, you will see your computer hardware are listed. When you see this information tap the F8 on your keyboard key repeatedly until you are presented with the screen Windows XP Advanced Startup Options.
    c. using the arrow keys, select the desired option of Mode without failure.
    d. press the Enter key on your keyboard to start in safe mode of Windows XP.
    e. when Windows starts, try using System Restore and verify.
     
    Hopt this helps.

  • perform an immediate function with parameter out

    How to perform a function with parameter in the statement immediately execute?
    declare
       vRunFunctie   varchar2(100) := 'startfunction';
       vParmIn1      varchar2(100) := 'AAA';
       vParmIn2      varchar2(100) := 'HHH';
       vParmOut1     number;
       vParmOut2     varchar2(100);
    begin
       --
       execute immediate 'select '||vRunFunctie||'('''||vParmIn1||''','''||vParmIn2||''',:vParmOut2) from dual' into vParmOut1 using vParmOut2;
       --
       dbms_output.put_line('vParmOut1['||vParmOut1||']');
       dbms_output.put_line('vParmOut2['||vParmOut2||']');
    end;
    /
    error: ORA-06572 startfunction function has arguments

    the statement looks like this in pl/sql:
    vParmOut1 := startfunction(vParmIn1, vParmIn2, vParmOut2);
    --vParmOut1 := startfunction('AAA', 'HHH', vParmOut2);
    Thank you.
    L.

    Update:
    You are not using bind variables with your dynamic code. That is a major mistake and the #1 reason for poor database performance.
    It is a fundamental flaw in programming to design a function that includes output parameters. This is simply and plainly wrong.
    Output parameters are also not supported by the SQL language - it does not support "procedure" like code units and call methods. 
    I know that the function should not have out parameters. But its programmed that way already...

    You try something like

    declare
       vRunFunctie   varchar2(100) := 'startfunction';
       vParmIn1      varchar2(100) := 'AAA';
       vParmIn2      varchar2(100) := 'HHH';
       vParmOut1     number;
       vParmOut2     varchar2(100);
    begin
       --
       execute immediate 'begin :x := ' || vRunFunctie || '( :p1,  :p2, :vParmOut2 ); end;' using out vParmOut1, vParmIn1, vParmIn2, out vParmOut2;
       --
       dbms_output.put_line('vParmOut1['||vParmOut1||']');
       dbms_output.put_line('vParmOut2['||vParmOut2||']');
    end;
    / 
    
  • function nvl value null problem

    Hello

    I have a table named "SAL" with two columns "NAME" and "SALARY".
    Column 'NAME' got the varchar2 data type and column "SALARY" has got the number data type.

    Here is the command

    Select nvl(salary,0) from sal where name = "steve";

    Now if the table got an entry where name is steve, and the salary is null then it will return 0 because of the nvl function.

    But if he has no entry with the name steve the result is null.

    I want to if there is even no entry named steve in the table, the result should be 0 instead of null. What will be the command?

    Gul says:
    Hello thanks for your response. It solved my problem. Another question is what do I do if want to put the results of this command

    Select count (*) case when 0 then 0 max (salary) to another end wage
    by sal where name = "Steve";

    You can use NVL

    select nvl(max(salary),0) salary
    from sal where name = 'Steve';
    

    in a variable. How can do us?

    In PL/SQL?

    declare
      ln_sal sal.salary%type;
    begin
      ......
      select nvl(max(salary),0)
      into ln_sal
      from sal where name = 'Steve';
      .....
    end;
    

    Published by: JAC on 19 Sep 2012 09:16
    Assuming that there are no null values in the column SALARY...

  • Index value of parameter problem on ComboBox

    I'm running into a problem with the definition of the index on a drop-down list box. I'll try to give as much detail as possible. From what I can tell, it must work and do, but only for a single item. If anyone can suggest another group to publish on, let me know. I can't find a solution anywhere.

    I have the following code to display a combobox control. The figures are from a configuration XML file. The combobox itself works very well and in fact shows all the data from the XML configuration file.

    < mx:HBox >
    < mx:Label text = 'Status' width = "55" / >
    < mx:ComboBox id = "uxstatus" dataProvider = "{_xmlVulnStatus}" = 'status' labelField / >
    < / mx:HBox >

    The part of the XML config file that is used to populate the combobox control.

    < mainconfig >
    < vulnstatus >
    < status > Open < / status >
    < status > current < / status >
    < status > Closed < / status >
    < / vulnstatus >
    < / mainconfig >

    Now, when a user selects an item in a separate DataGrid, on change, I have run the following function. The function reads the data, analysis and compares the value of "status" of the info of datagrid with the options of 'status' in the configuration XML file. When it matches, it sets the combobox's index number so that it shows the right data. My problem is the function below.

    public void parseMSVulnStatus(evt:Event):void {}
    var xmlMSV:XML = XML (msdetailed.selectedItem); the host of dataProvider item
    trace ("status Vuln MS =" + xmlMSV.status);
    for (var MSVi:Number = 0; MSVi < _xmlVulnStatus.length (); MSVi++) {//loop over the in the dataProvider}
    var sDataValueCurMSV:String is _xmlVulnStatus [MSVi] .valueOf ();. get the current value of the item.data
    If (sDataValueCurMSV == xmlMSV.status) {//compare desired value current value of the item.data
    mx.controls.Alert.show ("match found - status Vuln MS =" + xmlMSV.status + "and MSVi ="+ MSVi ");
    msstatus.selectedIndex = MSVi; the value of the seletedIndex from the drop-down list box
    }
    else {msstatus.selectedIndex = - 1}
    }
    If (msdetailed.selectedItem.falsepos == 'Y') {msfalsepos.selected = true ;}
    }

    The problem. If the value of the data grid is 'Closed', it shows the index as being '2' and sets the index of the combobox in a proper way and shows 'closed '. The alert box is displayed (for testing) to display the values.

    If the value of the data grid is "Open" or "Ongoing", it shows the appropriate index as being equal to 0 or 1, respectively and shows the alert box. However, it seems that the drop-down list, the value - 1. I checked that data are set correctly in the database (which is what fills the datagrid control).

    Any ideas on that? According to my alert box, it seems that the data are properly seen and he knows how to set the index of the combobox... it simply not happen (unless it is 'closed').

    Thanks in advance.

    Chris

    It seems you need to add a break to your loop when he finds a positive match. This would explain why it works for the last item in your xml file, but fails for others.

    msstatus.selectedIndex = MSVi; the value of the seletedIndex from the drop-down list box
    break;

    Vygo

  • Passing parameter to the function header javascript problem

    Hi - I'm trying to pass a string to a javascript function. The javascript function is called an onchange
    event in the attributes of a page element HTML form elements. The call looks like this:

    OnChange = 'lookupObjTypeID ("P3_OBJECTTYPE_NAME")'; (Yes, I want to pass the name of the element, not its value)

    The JavaScript looks like this:

    < script LANGUAGE = "JavaScript" src = "http://www.json.org/json.js" > < / script >
    < script type = "text/javascript" >

    function lookupObjTypeID (source_item_name) {}

    Alert ("running javascript");
    Alert (' name of the Source element: ' | source_item_name);
    }
    < /script >

    The first alert prints the message; the second alert but the source_item_name is null.

    Everything I've seen, this is the right syntax. What's not?

    Thank you
    Carol

    Carol

    Is the in js concatenation operator ' + '. Then

    Alert (' name of the Source element: "+ source_item_name);

    should work.

    CITY

  • Parameter problem library persistence using associations

    Hello

    I have recently begun to use the Cairngorm persistence library and ran into a problem with the settings sometimes doesn't work does not correctly when you are using associations.  I use the library of persistence 0.10, 3.5 Flex and AIR 2.0.

    The problem seems to be related to parameter names, and I was able to get around by renaming some of my settings.  I write about this here to try to determine the cause (and if it's a bug, hopefully get it fixed).

    Here's a simplified example where I see the problem.

    I create two classes, ObjectAssociatedWithPath and access path:

    package
    {
        public class Path
        {
            [Id]
            [Mapped]
            public var pathId:int;
    
            [Mapped]
            public var path:String = "C:/";
    
            public function Path()
            {
            }
        }
    }
    

    package
    {
        public class ObjectAssociatedWithPath
        {
            [Id]
            [Mapped]
            public var objectId:int;
    
            [Association]
            public var path:Path;
    
            public function ObjectAssociatedWithPath()
            {
            }
        }
    }
    

    In my SqlMap, I have statements to create and insert elements into an array of path and a table OBJECTASSOCIATEDWITHPATH:

    <grammar:Create id="createPathTable">
         CREATE TABLE IF NOT EXISTS PATH( PATHID INTEGER PRIMARY KEY, PATH TEXT )
    </grammar:Create>
    
    <grammar:Create id="createObjectAssociatedWithPathTable">
         CREATE TABLE IF NOT EXISTS OBJECTASSOCIATEDWITHPATH( OBJECTID INTEGER PRIMARY KEY, PATHID INTEGER )
    </grammar:Create>
    
    <grammar:Insert id="insertPath" type="{ Path }">
         INSERT INTO PATH ( PATH ) VALUES ( :path )
    </grammar:Insert>
    
    <grammar:Insert id="insertObjectAssociatedWithPath" type="{ ObjectAssociatedWithPath }">
         INSERT INTO OBJECTASSOCIATEDWITHPATH ( PATHID ) VALUES ( :pathId )
    </grammar:Insert>
    

    Finally, I have a function that creates the tables and inserts an object in each of them:

    private function parameterTest():void
    {
         var sqlSession:ISqlSession = persistenceClient.createSqlSession();
    
         sqlSession.beginTransaction();
    
         sqlSession.create("createPathTable", new CreateResponder(resultHandler, faultHandler));
         sqlSession.create("createObjectAssociatedWithPathTable", new CreateResponder(resultHandler, faultHandler));
    
         var path:Path = new Path();
         var objectAssociatedWithPath:ObjectAssociatedWithPath = new ObjectAssociatedWithPath();
         objectAssociatedWithPath.path = path;
    
         sqlSession.insertItem("insertPath", path, new InsertResponder(insertResultHandler, faultHandler));
         sqlSession.insertItem("insertObjectAssociatedWithPath", objectAssociatedWithPath, new InsertResponder(insertResultHandler, faultHandler));
    
         sqlSession.commitTransaction(new CommitTransactionResponder(resultHandler, faultHandler));
    }
    
    private function resultHandler():void
    {
    }
    
    private function insertResultHandler(rowId:Number, rowsAffected:Number):void
    {
    }
    
    private function faultHandler(error:SQLError):void
    {
         var errorMessage:String = "Message: " + error.message + "\nOperation: " + error.operation + "\nDetails: " + error.details;
         Alert.show(errorMessage);
    }
    

    When I run this function, I get the following error:

    Mismatch in parameter count. Found 1 in SQL specified and 2 value(s) set in parameters property.
    Expecting values for ':pathId'
    

    When attempting to execute the instruction at 'insertObjectAssociatedWithPath '.  If I rename "pathId' to 'thePathId' property, or specify a different setting for this property, i.e., name

            [Id]
            [Mapped(parameter="thePathId")]
            public var pathId:int;
    

    It seems to work correctly.

    For the association of the way, I think the constructor parameter to add pathId AND path to the settings property, even if I'm only using the pathId parameter.

    Anyone have any idea why this is happening?

    Thank you

    Jay

    This is caused by the hasNamedParameter @ NamedParameterBuilder function that checks for the existence of the already added parameters.

    You have already added the 'path' parameter in your mapping, unfortunatelly hasNamedParameter() checks if sqlStatement.text.indexOf (parameter) >-1

    and because *: pathId *.indexOf(":path") >-1 the pathId is omitted.

  • URL parameter problem

    Hello

    I'm new to the development of blackberry applications. I try to access a Web service, I can access using the http connection. When passing a parameter in the URL includes only one word then it works fine and answers correctly, but when I pass the same variable with a different value that contains several words separated by space, then it generates an error. I tried to pass the same URL in the browser, but the browser gives me good performance.

    I believe strongly that there is a problem when the parameter is sent. Please help me

    Thanks in advance

    If you only want to add parameters using percent encoding:

    http://en.Wikipedia.org/wiki/percent-encoding

  • Data parameter problem

    Hello

    I am facing a problem with the parameter Data;

    I can't able to query the data for different dates in the range, but I am able to query the data for the same date in the range.

    Select the statement-

    Select RCT.GL_DATE in the RCT RA_CUST_TRX_LINE_GL_DIST_ALL

    where TO_CHAR (TRUNC (RCT.GL_DATE), 'DD-MON-YY')

    between TO_CHAR (TRUNC (TO_DATE(:P_GL_DATE_LOW)), 'DD-MON-YY')

    AND TO_CHAR (TRUNC (TO_DATE(:P_GL_DATE_HIGH)), 'DD-MON-YY');

    I am able to get the data for the date range - 05-JAN-2015/05-JAN-2015, 07-JAN-2015/07-JAN-2015 and so on...

    I'm not able to get the data for the date range - 05-JAN-2015/07-JAN-2015, 07-JAN-2015/09-JAN-2015 and so on...

    Can someone help me on this issue.

    Thanks in advance!

    Dilip Manon

    As John pointed out, use the date data type to compare dates:

    Select RCT.GL_DATE in the RCT RA_CUST_TRX_LINE_GL_DIST_ALL

    where RCT.GL_DATE

    (between TO_DATE(:P_GL_DATE_LOW)), 'DD-MON-YYYY')

    (AND TO_DATE(:P_GL_DATE_HIGH)), 'DD-MON-YYYY');

    Using TO_CHAR to compare dates, not only do you risk to make mistake and forget certain values, but also in this case stop you an index on GL_DATE may be used.

  • Function Get-dvPgFreePort problem

    Hello:

    I use LucD function, "Get-dvPgFreePort", and it works 99% of the time.  However, 1% I get the following error:

    Get-view: could not validate the argument on the parameter "VIObject". The argument is null, empty, or an element of the collection argument contains a null value. Provide a collection that does not contain

    null values and then try the command again.

    Online: 13 tank: 10

    + Get-view $pg. ExtensionData.Vm | %{

    +          ~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo: InvalidData: (:)) [Get-view], ParameterBindingValidationException)

    + FullyQualifiedErrorId: ParameterArgumentValidationError, VMware.VimAutomation.ViCore.Cmdlets.Commands.DotNetInterop.GetVIView

    Any way around this?

    Thank you...

    Charles

    I updated the function to avoid the mistake to trade with no connected VM.

    Can you give him another chance?

  • How to perform a function with parameter date as input?

    Hello
    I have a function named fun1 (v_fun in date), including the date as an input parameter, and it returns a number. I created the function successfully. But I couldn't run this function in sqlplus. How to move the dates? Can someone help me in this regard.

    Hello

    V11081985 wrote:
    Hello
    I have a function named fun1 (v_fun in date), including the date as an input parameter, and it returns a number. I created the function successfully. But I couldn't run this function in sqlplus.

    It is difficult for me to say what you're doing wrong when I don't know what you're doing. After a full test script that people can run to recreate the problem and test their ideas. Include a definition of function, CREATE TABLE and INSERT statements for one of your own tables (if necessary) and the results you want from this data, as well as your query.

    How to move the dates? Can someone help me in this regard.

    You can call the function like this:

    SELECT  fun1 (hiredate)  AS fun1_results
    FROM    scott.emp
    ;
    
  • Excution of function in the problem of the adf?

    My problem description:
    ADF: Add this JSF error message: the number of parameter names does not match that of the registered
     am code
        public String checkthis(String p_us, String p_pwd)
     {
            
            CallableStatement cs=null;
    
            try{
    
            cs=getDBTransaction().createCallableStatement("begin ? := FUNC_GET_SH(?,?); end;",0);
    
            cs.registerOutParameter(1, Types.VARCHAR);
    
            cs.setInt(p_us, 2);
            
            cs.setInt(p_pwd,3 );
    
            cs.executeUpdate();
    
           return cs.getString(1);
    
           }catch(SQLException e){
    
            throw new JboException(e);
    
            } 
             
       }
     ora db 10g code
    CREATE OR REPLACE FUNCTION "FUNC_GT_SH"("P_USERNAME" IN VARCHAR2,  "P_PASSWORD" IN VARCHAR2) RETURN VARCHAR2    IS
    BEGIN
    
        RETURN DBMS_OBFUSCATION_TOOLKIT.MD5(
          input_string => UPPER(p_username) || '/' || UPPER(p_password));
    
    END;
    /
    above method am exposed as a button in the user interface. while hitting the error recovery
    <Utils> <buildFacesMessage> ADF: Adding the following JSF error message: The number of parameter names does not match the number of registered praremeters
    java.sql.SQLException: The number of parameter names does not match the number of registered praremeters
         at oracle.jdbc.driver.OracleSql.setNamedParameters(OracleSql.java:216)
         at oracle.jdbc.driver.OracleCallableStatement.executeUpdate(OracleCallableStatement.java:9319)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1508)
         at com.rits.suplr.model.servicesAM.SupplierAMImpl.checkLogin(SupplierAMImpl.java:1294)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:648)
         at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:2142)
         at oracle.adf.model.bc4j.DCJboDataControl.invokeMethod(DCJboDataControl.java:3063)
         at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:261)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1635)
         at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2149)
         at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:740)
         at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
         at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)
         at com.rits.suplr.view.backing.login.OnDialogAction(login.java:59)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1300)
         at oracle.adf.view.rich.component.UIXDialog.broadcast(UIXDialog.java:97)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
         at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
         at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:902)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:313)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:186)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:205)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
         at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
         at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
         at java.security.AccessController.doPrivileged(Native Method)
         at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
         at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
         at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
         at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
         at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:136)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    jdev11.1.1.5.0 - BC.

    How can solve this problem.

    Nothing to do with the ADF, but with proper use of JDBC

        public String checkthis(String p_us, String p_pwd)
     {
    
            CallableStatement cs=null;
    
            try{
    
            cs=getDBTransaction().createCallableStatement("begin ? := FUNC_GET_SH(?,?); end;",0);
    
            cs.registerOutParameter(1, Types.VARCHAR);
    
            cs.setString(2, p_us);
    
            cs.setString(3, p_pwd);
    
            cs.executeUpdate();
    
           return cs.getString(1);
    
           }catch(SQLException e){
    
            throw new JboException(e);
    
            } 
    
       }
    
  • Parameter problem (Date)

    Hi experts
    I use developer and oracle 10 g database
    work on oracle RBA ERP R12

    My problem in date

    If I have a transaction July 31, 2010, but it doesnot show when I gave my parameter as values

    : P_DATE_FROM = JULY 1, 2010
    : P_DATE_TO = JULY 31, 2010

    If the passage of a parameter value as this

    : P_DATE_FROM = JULY 1, 2010
    : P_DATE_TO = AUGUST 1, 2010

    July 31, 2010 transaction then shows...

    my code
    SELECT MMT.TRANSACTION_DATE,
         TRIM('-' FROM (ACC.SEGMENT1 || '-' || ACC.SEGMENT2 || '-' || ACC.SEGMENT3 || '-' ||
         ACC.SEGMENT4 || '-' || ACC.SEGMENT5 || '-' || ACC.SEGMENT6 || '-' ||
         ACC.SEGMENT7 || '-' || ACC.SEGMENT8 || '-' || ACC.SEGMENT9 || '-' ||
         ACC.SEGMENT10 || '-' || ACC.SEGMENT11 || '-' || ACC.SEGMENT12)) ACCOUNT_CODE,
         APPS.GL_FLEXFIELDS_PKG.GET_CONCAT_DESCRIPTION(ACC.CHART_OF_ACCOUNTS_ID, ACC.CODE_COMBINATION_ID, 'Y') ACCOUNT_DESCRIPTION,
         MCB.SEGMENT1 || '-' || MCB.SEGMENT2 || '-' || MCB.SEGMENT3 ITEM_CATEGORY,
         MSIB.SEGMENT2 ITEM_CODE, MSIB.DESCRIPTION ITEM_DESCRIPTION, 
         SUM(MMT.TRANSACTION_QUANTITY) PRIMARY_QUANTITY,
         SUM(NVL(ACC.ACCOUNTED_DR, 0) - NVL(ACC.ACCOUNTED_CR, 0)) AMOUNT
    FROM 
         (
              SELECT SOURCE_ID_INT_1, ENTITY_ID
              FROM XLA_TRANSACTION_ENTITIES_UPG 
              WHERE APPLICATION_ID IN (555, 707)
              AND ENTITY_CODE IN ('MTL_ACCOUNTING_EVENTS', 'INVENTORY')
         ) XTE, 
         (
              SELECT EVENT_ID, AE_HEADER_ID
              FROM XLA_AE_HEADERS
              WHERE EVENT_TYPE_CODE IN 
                   ('MISC_RECEIPT', 'MISC_ISSUE', 'MOVE_ORDER_ISSUE', 'MOVE_ORDER_XFER', 'MISC_RCPT', 'MOVE_ORDER_TXFR')
         ) XAH, 
         (
              SELECT XAL.CODE_COMBINATION_ID, XAL.AE_HEADER_ID, GCC.CHART_OF_ACCOUNTS_ID,
              XAL.ACCOUNTED_DR, XAL.ACCOUNTED_CR,
              GCC.SEGMENT1, GCC.SEGMENT2, GCC.SEGMENT3, GCC.SEGMENT4, GCC.SEGMENT5, 
              GCC.SEGMENT6, GCC.SEGMENT7, GCC.SEGMENT8, GCC.SEGMENT9, GCC.SEGMENT10, 
              GCC.SEGMENT11, GCC.SEGMENT12, GCC.SEGMENT13, GCC.SEGMENT14, GCC.SEGMENT15
              FROM XLA_AE_LINES XAL, GL_CODE_COMBINATIONS GCC
              WHERE GCC.CODE_COMBINATION_ID = XAL.CODE_COMBINATION_ID
              AND NVL(GCC.SEGMENT1, '%') BETWEEN NVL(:P_SEG1_FROM, NVL(GCC.SEGMENT1, '%')) 
                  AND NVL(:P_SEG1_TO, NVL(GCC.SEGMENT1, '%'))
              AND NVL(GCC.SEGMENT2, '%') BETWEEN NVL(:P_SEG2_FROM, NVL(GCC.SEGMENT2, '%')) 
                  AND NVL(:P_SEG2_TO, NVL(GCC.SEGMENT2, '%'))
              AND NVL(GCC.SEGMENT3, '%') BETWEEN NVL(:P_SEG3_FROM, NVL(GCC.SEGMENT3, '%')) 
                  AND NVL(:P_SEG3_TO, NVL(GCC.SEGMENT3, '%'))
              AND NVL(GCC.SEGMENT4, '%') BETWEEN NVL(:P_SEG4_FROM, NVL(GCC.SEGMENT4, '%')) 
                  AND NVL(:P_SEG4_TO, NVL(GCC.SEGMENT4, '%'))
              AND NVL(GCC.SEGMENT5, '%') BETWEEN NVL(:P_SEG5_FROM, NVL(GCC.SEGMENT5, '%')) 
                  AND NVL(:P_SEG5_TO, NVL(GCC.SEGMENT5, '%'))
              AND NVL(GCC.SEGMENT6, '%') BETWEEN NVL(:P_SEG6_FROM, NVL(GCC.SEGMENT6, '%')) 
                  AND NVL(:P_SEG6_TO, NVL(GCC.SEGMENT6, '%'))
              AND NVL(GCC.SEGMENT7, '%') BETWEEN NVL(:P_SEG7_FROM, NVL(GCC.SEGMENT7, '%')) 
                  AND NVL(:P_SEG7_TO, NVL(GCC.SEGMENT7, '%'))
              AND NVL(GCC.SEGMENT8, '%') BETWEEN NVL(:P_SEG8_FROM, NVL(GCC.SEGMENT8, '%')) 
                  AND NVL(:P_SEG8_TO, NVL(GCC.SEGMENT8, '%'))
              AND NVL(GCC.SEGMENT9, '%') BETWEEN NVL(:P_SEG9_FROM, NVL(GCC.SEGMENT9, '%')) 
                  AND NVL(:P_SEG9_TO, NVL(GCC.SEGMENT9, '%'))
              AND NVL(GCC.SEGMENT10, '%') BETWEEN NVL(:P_SEG10_FROM, NVL(GCC.SEGMENT10, '%')) 
                  AND NVL(:P_SEG10_TO, NVL(GCC.SEGMENT10, '%'))
              /*AND NVL(GCC.SEGMENT11, '%') BETWEEN NVL(:P_SEG11_FROM, NVL(GCC.SEGMENT11, '%')) 
                  AND NVL(:P_SEG11_TO, NVL(GCC.SEGMENT11, '%'))
              AND NVL(GCC.SEGMENT12, '%') BETWEEN NVL(:P_SEG12_FROM, NVL(GCC.SEGMENT12, '%')) 
                  AND NVL(:P_SEG12_TO, NVL(GCC.SEGMENT12, '%'))
              AND NVL(GCC.SEGMENT13, '%') BETWEEN NVL(:P_SEG13_FROM, NVL(GCC.SEGMENT13, '%')) 
                  AND NVL(:P_SEG13_TO, NVL(GCC.SEGMENT13, '%'))
              AND NVL(GCC.SEGMENT14, '%') BETWEEN NVL(:P_SEG14_FROM, NVL(GCC.SEGMENT14, '%')) 
                  AND NVL(:P_SEG14_TO, NVL(GCC.SEGMENT14, '%'))
              AND NVL(GCC.SEGMENT15, '%') BETWEEN NVL(:P_SEG15_FROM, NVL(GCC.SEGMENT15, '%')) 
                  AND NVL(:P_SEG15_TO, NVL(GCC.SEGMENT15, '%'))*/
         ) ACC,
         MTL_MATERIAL_TRANSACTIONS MMT, XLA_EVENTS XE, MTL_SYSTEM_ITEMS_B MSIB, 
         MTL_ITEM_CATEGORIES MIC, MTL_CATEGORIES_B MCB, MTL_CATEGORY_SETS MCS
    WHERE 
         XTE.SOURCE_ID_INT_1 = MMT.TRANSACTION_ID
         AND XTE.ENTITY_ID = XE.ENTITY_ID
         AND XE.EVENT_ID = XAH.EVENT_ID
         AND XAH.AE_HEADER_ID = ACC.AE_HEADER_ID
         AND MMT.INVENTORY_ITEM_ID = MSIB.INVENTORY_ITEM_ID
         AND MMT.ORGANIZATION_ID = MSIB.ORGANIZATION_ID
         AND MMT.INVENTORY_ITEM_ID = MIC.INVENTORY_ITEM_ID
         AND MMT.ORGANIZATION_ID = MIC.ORGANIZATION_ID
         AND MIC.CATEGORY_ID = MCB.CATEGORY_ID
         AND MIC.CATEGORY_SET_ID = MCS.CATEGORY_SET_ID
         AND UPPER(MCS.CATEGORY_SET_NAME) LIKE '%IIL%INVENTORY%'
         AND MMT.TRANSACTION_DATE BETWEEN NVL(:P_DATE_FROM, '01-JAN-1000') AND NVL(:P_DATE_TO, '31-DEC-4712')
         --AND NVL(MSIB.SEGMENT2, '%%') BETWEEN NVL(:P_ITEM_FROM, NVL(MSIB.SEGMENT2, '%%')) 
         --     AND NVL(:P_ITEM_TO, NVL(MSIB.SEGMENT2, '%%'))
    GROUP BY MMT.TRANSACTION_DATE,
         TRIM('-' FROM (ACC.SEGMENT1 || '-' || ACC.SEGMENT2 || '-' || ACC.SEGMENT3 || '-' ||
         ACC.SEGMENT4 || '-' || ACC.SEGMENT5 || '-' || ACC.SEGMENT6 || '-' ||
         ACC.SEGMENT7 || '-' || ACC.SEGMENT8 || '-' || ACC.SEGMENT9 || '-' ||
         ACC.SEGMENT10 || '-' || ACC.SEGMENT11 || '-' || ACC.SEGMENT12)),
         APPS.GL_FLEXFIELDS_PKG.GET_CONCAT_DESCRIPTION(ACC.CHART_OF_ACCOUNTS_ID, ACC.CODE_COMBINATION_ID, 'Y'),
         MCB.SEGMENT1 || '-' || MCB.SEGMENT2 || '-' || MCB.SEGMENT3,
         MSIB.SEGMENT2, MSIB.DESCRIPTION--, MMT.TRANSACTION_QUANTITY

    If you're dealing with dates, treat them as dates and not as strings.

    for example

    this:

         AND MMT.TRANSACTION_DATE BETWEEN NVL(:P_DATE_FROM, '01-JAN-1000') AND NVL(:P_DATE_TO, '31-DEC-4712')
    

    should be this:

         AND MMT.TRANSACTION_DATE BETWEEN NVL(to_date(':P_DATE_FROM','DD-MON-YYYY'), to_date('01-JAN-1000','DD-MON-YYYY')) AND NVL(to_date(':P_DATE_TO','DD-MON-YYYY'), to_date('31-DEC-4712','DD-MON-YYYY'))
    

Maybe you are looking for