How to assign store proc parameter to other parameter memebers?

i really do not want to decalare t_param2 and check if default value is null of param2 then assign param1 to it. Any way i can achieve the following without declaring temp variables.?????
create or replace procedure Proc1( param1 varchar2, param2 varchar2 := param1)
IS
BEGIN
null;
END;
show errors
1/54 PLS-00227: subprogram 'in' formal PARAM1 is not yet denotable
0/0 PL/SQL: Compilation unit analysis terminated

I think this is one of the solution...
CREATE OR REPLACE PROCEDURE proc1 (param1 VARCHAR2, param2 VARCHAR2)
IS
---p2 VARCHAR2(100);
procedure p1(param1 varchar2, param2 varchar2)
IS
BEGIN
DBMS_OUTPUT.PUT_LINE('param1-->'||param1||' param2 -->'||param2);
END;
BEGIN
p1(param1,nvl(param2,param1));
dbms_output.put_line(param1||':'||param2);
END proc1;
show errors;
set serveroutput on
exec proc1('A', 'B');
set serveroutput on
exec proc1('A', null);

Similar Messages

  • DropDown List Problem for Dynamic Store Proc Parameter in SAP B1 8.8

    I am working with the crystal report 2008 in SAP B1 8.8 and the report is used the Store Proc for retrieving data. As i need to show a list of Documnet No (DOCNUM) from Sales Order (ORDR) and Purchase Order (OPOR) for the users to select, i use the Dynamic Parameter as for the Store Proc parameter (@Contno), However, the drop down list can be shown fine in Crystal Report, but cant be shown in "Report Selection Criteria" while opening the Crystal Report through SAP B1.
    Therefore, can anyone tell me how to add the dynamic drop down list (cause the documnet no list will be changed very frequently) in the  SAP B1 8.8  "Report Selection Criteria" screen.
    Thanks!!

    Classic Crystal Reports and Classic SAP connectivity questions
    Classic Crystal Reports and Classic SAP connectivity questions

  • How to copy store proc from one schema to another

    Hi I have store proc. and I want to copy that store proc from schema DATAMART_ADMIN to QAI_ADMIN ?
    Can someone let me know how to do that ?
    Thanks
    Jay

    Why would you want to copy the procedure? Why not create a synonym in the target schema that points at the source schema?
    If you do need to copy the procedure, you would have to take your CREATE PROCEDURE script and run it in the new schema. Ideally, this would come out of your version control system. Otherwise, any GUI should be able to generate a CREATE PROCEDURE script for you as will the DBMS_METADATA package.
    Justin

  • How to assign ODI Proc out parameter value to an ODI variable

    hi,
    Can someone kindly help me on assigning ODI Procedure's output parametr to an ODI variable.
    My ODI Proc is:
    proc p_name (e_code varchar2(100), o_num number(50))
    is
    type tab_e is table of xxx%rowtype index by varchar2(100);
    l_tab_type tab_e;
    begin
    select e_no into o_num from xxx where e_name=e_code;
    next 2 steps to populate table type variable
    Step1
    step28/
    end;
    i want to store the value of o_num in an ODI variable so that I can use that in a ODi package to evaluate its value and change the flow.
    Now i tried to include the above code in ODi proc , but its showing error while executing it .
    'Invalid SQL statement'.
    Kindly advice or help on this issue.
    Thanks,
    Hema

    Hellow,
    I am new to ODI.
    I ahve a data base query which returns more than one rows. Each row has more than one column.I wanted to assign these values to a variable . Finally this varibale values i wanted to write into a file in a package. What steps i need to follow to achieve this.
    Regards,
    Ranjan
    Edited by: user12112389 on Jul 16, 2012 2:55 PM

  • How should I store files (nef, dng, other)?

    As a new user of CS5, I would like to know how most experts save images.  Right now, I load nef (Nikon raw)  images from the camera to my Windows PC using "get photos from camera" in Bridge.  I then edit some images using Camera Raw and (sometimes) using Photoshop with layers. I also add metadata of my own.   I would like to have one file for each image if possible.  I just do not like to have  a lot of different versions hanging around.  I am not concerned about backup because I backup the entire PC daily.  I do want to preserve all potentially useful data from the camera though.  When needed, I use Save to create jpegs for external use, e.g. for Shutterfly or (using different settings) for Web use.  I usually save these separate from the original nef files and their companion files.  When a file has been edited only by Camera Raw, I notice that it remains a nef file.  When it is edited by Photoshop, it gains a companion psd file, and when metadata is added it gains a companion xmp file.  I keep these nef files and their companion psd and xmp files toegether in the same folder sorted such that the three are adjacent.  Is this the best way to store these images? 
    Incidentally, the Photoshop Essentials course from Lynda.com and the Adobe Help documentation do not cover the above companion files adequately in my view.  Can you comment on this point?
    Jim Mullen
    Tahoe City, CA

    Since you asked how others do it, I'll describe what I do:
    I save all my original files by Year \ Month \ Occasion on my computer on a 2 TB RAID 0 - based hard drive partition.  These include raw images, JPEG images, and scans (saved as .PSD files).  All are online (about half a terabyte of data total) so I can easily access what I need when I need it.
    I back these files up to two different external USB MyBook drives in two different parts of my house, as well as to DVD (more recently blu-ray DVD for the added storage).  I do incremental backups that ever-accumulate, so I'm protected from accidental erasure, as well as full system image backups that can be used to completely restore each of my entire systems.
    I never overwrite my original files, and I even go so far as avoiding using Camera Raw to open JPEGs because it will write metadata back into JPEG files.  And I never write any editing products back into my original photo folders.  This helps avoid accidents.  Photoshop CS5 now actually has a setting one can configure that will instruct it to remember a different default for Saves as for Opens.  I like that.
    Usually, for most uses, I just reprocess my original file if I want a print, or to use a copy online, etc.
    For complex Photoshop projects, I save PSD files in separate folders from my original photo files, named for the project.
    Regarding making backups, I suggest this mantra:  "Don't invite disaster, but there's nothing wrong with preparing for it."
    Hope this helps!
    -Noel

  • HT1349 How do I store my photos on my iPad storage in stead of iCloud?

    I have 64 gb.  How do I store my photos and other download videos and music in it instead of iCloud 5.0  gb?

    Note that none of your Photos or downloaded videos are stored in your iCloud 5GB.
    Photos take with the iPad are temporarily put into Photo Stream in yoru iCloud(if enabled) but they are deleted after 30 days.

  • How to assign Values to nested table and pass as parameter to procedure?

    How to assign Values to nested table and pass as parameter to procedure?
    Below is the Object and its type
    create or replace type test_object1 as object
    val1 varchar2(50),
    val2 varchar2(50),
         val3 varchar2(50)
    create or replace type test_type1 is table of test_object1;
    create or replace type test_object2 as object
    val1 varchar2(50),
    val2 varchar2(50),
         val3 varchar2(50)
    create or replace type test_type2 is table of test_object2;
    GRANT ALL ON test_object1 TO PUBLIC;
    GRANT ALL ON test_type1 TO PUBLIC;
    GRANT ALL ON test_object2 TO PUBLIC;
    GRANT ALL ON test_type2 TO PUBLIC;
    here is the table made of object type:
    create table test_object_tpe
    sl_num NUMBER,
    description VARCHAR2(100),
    main_val1 test_type1,
    main_val2 test_type2
    NESTED TABLE main_val1 STORE AS tot1
    NESTED TABLE main_val2 STORE AS tot2;
    here is the procedure which inserts values into nested table:
    PROCEDURE INSERT_TEST_DATA(sl_num IN NUMBER,
    description IN VARCHAR2,
    p_main_val1 IN test_type1,
    p_main_val2 IN test_type2
    IS
    BEGIN
    FOR rec in p_main_val1.first..p_main_val1.last
    LOOP
    INSERT INTO xxdl.test_object_tpe
    sl_num,
    description,
    main_val1,
    main_val2
    VALUES
    sl_num
    ,description
    ,test_type1 (test_object1(
    p_main_val1(rec).val1,
                                       p_main_val1(rec).val2,
    p_main_val1(rec).val3
    ,test_type2 (test_object2( p_main_val2(rec).val1,
                        p_main_val2(rec).val2,
                        p_main_val2(rec).val3
    END LOOP;
    commit;
    END INSERT_TEST_DATA;
    here is the anonymoys block which assigns values to the object type and pass values into the procedure:
    set serveroutput on;
    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1(1).val1 := 'testx1';
    inval1(1).val2 := 'testx2';
    inval1(1).val3 := 'testx3';
    inval2(1).val1 := 'testy1';
    inval2(1).val2 := 'testy2';
    inval2(1).val3 := 'testy3';
    CSI_PKG.INSERT_TEST_DATA(sl_num => p_sl_num,
    description => p_description,
    p_main_val1 => inval1,
    p_main_val2 => inval2
    end;
    Can anybody correct me.
    Thanks,
    Lavan

    Thanks for posting the DDL and sample code but whenever you post provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    >
    How to assign Values to nested table and pass as parameter to procedure?
    >
    Well you are doing almost everything wrong that could be done wrong.
    Here is code that works to insert data into your table (the procedure isn't even needed).
    declare
    p_sl_num NUMBER := 1001;
    p_description VARCHAR2(50) := 'Testing Val1';
    inval1 test_type1 := test_type1();
    inval2 test_type2 := test_type2();
    begin
    inval1.extend();
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');
    inval2.extend();
    inval2(1) := test_object2('testy1', 'testy2', 'testy3');
    INSERT INTO test_object_tpe
    sl_num,
    description,
    main_val1,
    main_val2
    VALUES
    (p_sl_num, p_description, inval1, inval2);
    commit;
    end;
    /See Example 5-15 Referencing a Nested Table Element in Chap 5 Using PL/SQL Collections and Records in the PL/SQL doc
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/collections.htm#CJABEBEA
    1. You don't even need the procedure since all it does is a simple INSERT into the table which you can do directly (see my code above)
    inval1(1).val1 := 'testx1';There is no element one (1) of 'inval1' since you haven't created any elements yet. You need to EXTEND the collection to add an element
    inval1.extend();And then there is an empty element but 'inval1' is a container for objects of type 'test_object1' not for scalars like 'val1', 'val2', and 'val3'.
    So you can't do
    inval1(1).val1 := 'testx1';You have to create an instance of 'test_object1'
    inval1(1) := test_object1('testx1', 'testx2', 'testx3');And so on for the other collection
    You don't need the procedure (as my sample code shows) but once you populate the variables properly it will work.

  • How to send sortorder info to Store Proc

    Hi
    I have a Store Proc in SQL Server
    Now i want to give the Sort Order dynamically for this Store
    Proc.
    When i am trying to send the SortOrder, in the query it is
    saying that i cant give the parameter.
    It is forcing me to give field names directly.
    i cant able to give the Order by dynamically.
    how can i do this.?
    i need to change the Order By dynamically in Store Proc.
    i can send the paramter to Store Proc, but its not accespting
    in the query.

    Try this stored procedure.
    CREATE PROCEDURE [dbo].[myProcedure]
    @OrderParam VARCHAR(20)
    AS
    Declare @sQuery as VARCHAR(100)
    SET @sQuery = 'select * from myTable order by ' +
    CAST(@OrderParam AS VARCHAR(15))
    EXEC(@sQuery)
    GO
    Thanks
    Sankalan
    (www.mindfiresolutions.com)

  • How to assign values to the parameter

    I have write a procedure in procedure builder like this:
    PROCEDURE "GETMCTOREPORT" (
    p_logname IN VARCHAR2,
    p_mysql IN VARCHAR2,
    p_opyear IN VARCHAR2,
    p_exrate IN VARCHAR2,
    p_flag IN OUT VARCHAR2)
    but I don't know how to run this procedure, espically how to declare a variable and then assign to last parameter, in the procedure builder environment.
    Anyone helps me,Thanks
    PL/SQL>

    Have a look at JDeveloper and it's PL/SQL development capabilities. You can write a PL/SQL procedure click run and a window will popup letting you fill values for the parameters. And you can even debug the procedure.
    For more info:
    http://otn.oracle.com/products/jdev/htdocs/database/db_overview.html

  • How to assign a value to a parameter {?MyParam} dynamically?

    How to assign a value to a parameter {?MyParam} dynamically?
    Example:
      {?One_Or_Two}  <- my first parameter
      {?MyParam}       <- My second parameter
    The Code:
    If ( {?One_Or_Two} = 'One'  then
        {?MyParam}  = 'One' ;
    else 
        {?MyParam}  = 'Two' ; 
    (THIS IS NOT WORKING FOR ME!  ANYONE KNOW WHY?)
      IT NEVER ASSIGN THE VALUE?
    My Command query looks like:
    SELECT * FROM MyTable
        WHERE MyTable.MyColumn = {?MyParam}
    THANKS

    Hi Joseph,
    I'm a bit unclear as to what you are doing and from what I see you're running in circles. 
    Your Command query is looking for a field that is equal to {?MyParam}. 
    Now you want to take {?MyParam} in the report and change the value after you've set it. 
    Parameters cannot be set from the Command, you can format it and manipulate it but they cannot be set except from the parameters window or from a front-end. 
    Thanks,
    Brian

  • HT201272 I purchased a ringtone from itunes store on my I phone 5 but cannot find how to assign it to my ringtone

    I purchased a ringtone from itunes store on my iphone5 but cannot find how to assign it as my ringtone. Can anyone offer suggestions please

    Help again! lol
    tonight I tried to download a ringtone to my iPhone 5.  Picked out the one I wanted, clicked on "buy" and was asked for my p/w & if I wanted to assign it to a contact.  Yes, entered correct p/w & yes.  NO DOWNLOAD - it doesn't show up in my Ringtones under "Sounds" or "Text Tones" and a search of my phone doesn't show it.  So, even though my balance was subtracted the cost, I tried again....still doesn't show up on the phone OR in iTunes on my iMac or iPad - and I was charged for it again!!   ETA: It doesn't even show up in recent purchases.?!?
    iMatch is turned on in all devices and I noticed that in iTunes on my iMac, there is NO tab for "Ringtones" or "Tones" in the top menu across my iTunes screen....however, in my library on the Mac there IS a line item for ringtones, but it's empty when I click on it.  This is the 2nd ringtone I've purchased that doesn't show up; thrtefore I cannot use either one but have been charged for both...GRRR
    I also noticed tonight that a lot of my options in my Library on the Mac are "grayed out" so I can't even get into them. Yes, I'm signed in & all devices are
    authorized.  Can't even sync my iPhone & yes I checked that it's marked on both devices.  *sigh*
    What do I need to do?  The closest Apple store is over an hour away from me.  Should I reset iTunes or the iPhone (or both)?  Not really what I want to do on my long weekend now that I'm finally down to 2 jobs 6 days a week!
    TIA for any help anyone can give me!
    (BTW, it turned out the other ringtone I'd purchased on 12/1/11 was no longer available (3rd ringtone - actually 1st so the ones in this question are #'s 2 & 3), and Apple was kind enough to give me some free songs.)

  • How to assign task to others with an attachment?

    Hi All,
    How to assign task to other with an attachment and field values in the actual InfoPath form?
    In detail, If a InfoPath form has submitted then task should be assigned to a person with an attachment and some field values which are present in InfoPath form.
    How to achieve this scenario?
    Thanks in advance!

    What you describe is a simple approval workflow. SharePoint comes with approval workflows out of the box. 
    When a task is created to approve an item, it does not need to have the attachment that is already in the item. The task will contain a link to the item that needs to be approved, so there is no need to duplicate the file attachment. 
    You may want to read a bit more about the out of the box approval workflows in SharePoint. Start here:  
    Understand approval workflows in SharePoint 2010
    cheers, teylyn

  • How to assign Tasks to other users using Exchange Web Service.

    How to assign Tasks to other users using Exchange Web Service.
    Any workaround also would help

    Hi Glen,
    I am trying to use ExtendedPropertyType and put in UpdaterItemType as in this code as below. Although it is not updating the Owner
    field.
    I have tried it both by Propertyname and PropertyID. Although new custom property's canbe
    added but to change an existing one like 'Owner' ? Would this be the right method.
    2. And Is ProprertyID a fixed value as 0x811f or does it need to be calculated.
    3. Is 'Owner' the right propertname for assigning a task ?
    Thanks a lot.
    Please see code below for reference.
     PathToExtendedFieldType pathExtended = new PathToExtendedFieldType();
                //pathExtended.DistinguishedPropertySetId = DistinguishedPropertySetType.PublicStrings;
                pathExtended.DistinguishedPropertySetId = DistinguishedPropertySetType.Task;
                pathExtended.DistinguishedPropertySetIdSpecified = true;
                pathExtended.PropertyId = 0x811f;
                pathExtended.PropertyIdSpecified = true;
                //pathExtended.PropertyName = "Owner";
                pathExtended.PropertyType = MapiPropertyTypeType.String;
                ciSetAT.ExtendedProperty = new ExtendedPropertyType[1];
                ciSetAT.ExtendedProperty[0] = new ExtendedPropertyType();
                ciSetAT.ExtendedProperty[0].ExtendedFieldURI = pathExtended;
                ciSetAT.ExtendedProperty[0].Item = "[email protected]";
                SetItemFieldType set1 = new SetItemFieldType();
                set1.Item = pathExtended;
                set1.Item1 = ciSetAT;
                UpdateItemType request = new UpdateItemType();
                request.ItemChanges = new ItemChangeType[1] { new ItemChangeType() };
                request.ItemChanges[0].Item = itemId;
                request.ItemChanges[0].Updates = new ItemChangeDescriptionType[2];
                request.ItemChanges[0].Updates[0] = setstart;
                request.ItemChanges[0].Updates[1] = set1;

  • How to insert past record after updating the master table in history table through store PROC

    Master Table
    Party Status
    A Active
    B Inactive
    C Active
    D Inactive
    Duplicate Table
    Party Status
    A Active
    B Active
    C Active
    D Inactive
    Updated Master Table
    Party Status
    A Active
    B Active
    C Active
    D Inactive
    Party History Table
    B Inactive
    I have two table one master and another duplicate I need to update master table based on duplicate table insert the record which updated into Party history table as shown above. need help to write store proc.

    Check MERGE syntax in BOL (example D). There should be a sample with output, e.g.
    insert into PartyHistory (Party, [Status])
    select Party, [Status] FROM
    (MERGE Master M using Duplicate D on M.[Party]=D.[Party]AND M.[Status]<>D.[Status]
    WHEN MATCHED THEN UPDATE
    SET [Status] = D.[Status]
    OUTPUT Deleted.[Party], Deleted.[Status], $Action) AS Changes (Party, [Status], Action) WHERE Action = 'UPDATE'
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • When I play in the search bar in the app store, facebook, safari or other application closes, how do I fix this?

    when I play in the search bar in the app store, facebook, safari or other application closes, how do I fix this?

    Have you tried restarting or resetting your iPad?
    Restart: Press On/Off button until the Slide to Power Off slider appears, select Slide to Power Off and, after the iPad shuts down, then press the On/Off button until the Apple logo appears.
    Reset: Press the Home and On/Off buttons at the same time and hold them until the Apple logo appears (about 10 seconds). Ignore the "Slide to power off"

Maybe you are looking for