Update user hook called procedure

i have user hook pakage calling the registered user hook procedure like this
XX_USER_HOOKS.CREATE_SIT_B(P_ID_FLEX_NUM => P_ID_FLEX_NUM
,P_PERSON_ID => P_PERSON_ID
,P_SEGMENT1 => P_SEGMENT1
,P_SEGMENT2 => P_SEGMENT2
,P_SEGMENT3 => P_SEGMENT3
,P_SEGMENT4 => P_SEGMENT4
,P_SEGMENT5 => P_SEGMENT5
,P_SEGMENT6 => P_SEGMENT6
,P_SEGMENT7 => P_SEGMENT7
,P_SEGMENT8 => P_SEGMENT8
,P_SEGMENT9 => P_SEGMENT9
,P_SEGMENT10 => P_SEGMENT10
,P_SEGMENT11 => P_SEGMENT11
,P_SEGMENT12 => P_SEGMENT12
,P_SEGMENT13 => P_SEGMENT13
,P_SEGMENT14 => P_SEGMENT14
,P_SEGMENT15 => P_SEGMENT15
,P_SEGMENT29 => P_SEGMENT29
i just want to add new parameter for it, do i need to re register or something from this type, or just add the new parameter line in the call procedure and recompile the package???

Hi,
Yes you are correct that there cannot be commit in hook procedures and that's the reason I told you to commit assuming that if you are executing the packages from TOAD/PL-SQL Dev to test the working of the functionality before deploying, and many times we do simple mistake of not committing and viewing the data on forms.
If you are getting the element entry created in the same month then there seems to be no reason why the element should not be visible on form. You can try doing a comparison of the element entries getting created from front end and the one which you are creating using hook. Create an element entry in the same month from front end and compare both the records from back-end to see if you are missing anything.
Thanks,
Sanjay

Similar Messages

  • Enabling User Hooks in HRMS 11.5.10.2?

    I'm trying to capture an update to PER_ALL_ASSIGNMENTS_F, using the row handler "After Update" User Hook, however the hook is not being called.
    I’ve created a custom package with a procedure that is called by the User Hook, having the parameters as listed when I run the script hrahkpar.sql. For testing purposes this custom procedure just adds a record to a debug table to show it has been called.
    CREATE OR REPLACE PACKAGE body APPS.CPW_UK_STAR_INT_PKG AS
    PROCEDURE log_text (p_text IN VARCHAR2)
    AS
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
    INSERT INTO CPW_TEST_HOOK (time_stamp
    , text )
    VALUES (SYSDATE
    , p_text);
    COMMIT;
    END;
    PROCEDURE PER_ALL_ASSIGNMENTS_F_AU (
    P_EFFECTIVE_DATE IN DATE
    ) IS
    BEGIN
    log_text (p_text => 'PER_ALL_ASSIGNMENTS_F_AU');
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END PER_ALL_ASSIGNMENTS_F_AU;
    END CPW_UK_STAR_INT_PKG;
    I’ve registered the package procedure using this call:
    Hr_Api_Hook_Call_Api.create_api_hook_call
    (p_validate => TRUE,
    p_effective_date => SYSDATE,
    p_api_hook_id => 2670, --per_all_assignments_f AU
    p_api_hook_call_type => 'PP', --Packaged Procedure
    p_sequence => l_sequence,
    p_enabled_flag => 'Y',
    p_call_package => 'CPW_UK_STAR_INT_PKG', -- Custom Package
    p_call_procedure => 'PER_ALL_ASSIGNMENTS_F_AU', -- Custom procedure
    p_api_hook_call_id => l_api_hook_call_id,
    p_object_version_number => l_object_version_number);
    I’ve executed the User Hook pre-processor program for the 'PER_ALL_ASSIGNMENTS_F' module.
    All these steps completed without error.
    To test this I used the template form PERWSQHM and changed the start_date of an assignment, and confirmed that the change was committed to the table. However no evidence of the hook firing!
    I’m guessing I’ve made a schoolboy error here; please can someone advise which steps I have missed or done wrongly? Alternatively is there a better way to debug and test this?
    Thanks
    Graham

    Ok, thanks. I had realized that the "Enter and Maintain" form does not use APIs, however the template forms do use APIs and it was these that I was using for my tests. I have proved that the API is being used but I still cannot see why the hook is not being executed despite the fact that I appear to have completed the required steps to enable them.
    What I am looking for here are really some troubleshooting tips :-)
    Thanks
    Graham

  • Call procedure while creating view in hana.

    Can we call procedure while creating a attribute view like
    CREATE VIEW "PAYROLLDBTEST"."@HourTransactionView"
    "DocEntry",
    "DocNum",
    "EmpID",
    "EmpCode",
    "FullName",
    "TableName",
    "TranName",
    "U_FromDate",
    "U_ToDate",
    "NoOfDays",
    "U_FromTime",
    "U_ToTime",
    "NoOfHours",
    "OvertimeHours",
    "UnpaidDays",
    "Weekends",
    "Holidays",
    "U_Remarks",
    "U_BatchNo",
    "ProjectCode"
    ) AS SELECT
      T0."DocEntry" AS DocEntry,
        T0."DocNum" AS DocNum,
       T0."U_EmpCode" AS EmpID,
    CALL PAYROLLDBTEST.GetEmpCodeFromEmployeeID('EmpID')  ,              (getting syntax error here).
        GetEmployeeFullName("@TRANSACTION_HOURS".U_EmpCode) AS FullName,
          T0."U_TransactionType" AS TranCode,
        GetHourTableName("U_TransactionType") AS TableName,
         GetHourTransactionName("U_TransactionType") AS TranName,
        T0."U_FromDate",
        T0. "U_ToDate",
          DAYS_BETWEEN("U_FromDate", "U_ToDate") + 1 AS NoOfDays,
          T0."U_FromTime" AS U_FromTime,
           T0."U_ToTime" AS U_ToTime,
        IFNULL("U_WorkHours", 0) AS NoOfHours,
         IFNULL("U_OvertimeHours", 0) AS OvertimeHours,
        IFNULL("U_PaidDays", 0) AS PaidDays,
         IFNULL("U_UnpaidDays", 0) AS UnpaidDays,
        IFNULL("U_WeekendsCount", 0) AS Weekends,
         IFNULL("U_HolidaysCount", 0) AS Holidays,
          T0."U_Remarks",
           T0."U_BatchNo",
        T0."U_ProjectCode" AS "ProjectCode"
        FROM
        "@TRANSACTION_HOURS" T0
        INNER JOIN
        "OHEM" T1
        ON
         T1."empID" = T0."U_EmpCode";

    Hello,
    The problem could be a SAPGUI related problem... Whats the current sapgui patch level ? Does it work when you try on another wokstation with the same user ?
    Could you please use SAPGUI 720 and update your patch level to 7 ? Then check the behaviour again.
    Best regards
    Rene

  • HR API User Hooks - Can I use to change a value in the table the API for?

    I am trying to initialize a descriptive flexfield on per_all_people_f. I originally tried doing the initialization using a “before row insert” database trigger directly on the table per_all_people_f. Seems to work great in the People form (PERWSHRG), but does not seem to work consistently when a new employee is entered through a template like Enter Employees (PERWSQHM).
    Does anyone know if you can use an API User Hook to initialize a value on one o the tables the API is inserting? For example, could I put a "Before Process" user hook on the "Create_ Employee" API to change the value of a descriptive flexfield?
    Any other good ideas?
    Currently I have a concurrent request that runs once every 30 minutes to default the descriptive flexfield. The delay is causing issues.

    In such cases you should write the code to default the values in the front end PUIs. As one person pointed out, User hooks are provided either to validate the already entered values, or to insert/update data in some custom tables but not for updating values in the same table where data is being inserted/updated.
    BTW for your information:-
    Person form (People Enter and Maintain) does not use APIs so anything written inside the user hook would be ignored by the application when this form is used. (The reason is this is one of the oldest form in HRMS, was created even before the concept of user hook came).
    Template form PERWSQHM uses APIs, so user hook is called when this form is used to create/update the data.
    Hope this is useful.

  • USER Hook for Changer Manager function

    Dear All,
    I need to know that is there any user hook for Manager Self Service -- Change Manager function for employee.
    If yes then please give me the module name/id for the user hook.
    If no then how can I set custom validations on this page.
    Regards.

    You should look for the update assignment api.
    select * from hr_api_modules
    where module_name like '%UPDATE%ASG%'
    Depending on the legislation, you will have different modules/packages/procedures.

  • API User Hook for Restricting Category Creation in a sepcific catalog

    Q: API User Hook for Restricting Category Creation in a sepcific catalog by a specific responsibility. I want to capture GO button process event?
    Hi All,
    Can anyone help me if anyone have used user hook for OLM? My requirement is to restrict course creation for the specific category... when we select category and select course and click on go button which process is calling? How can we identify the BP Package and Procedure name of that GO button?
    urgent reply shall be a great help.
    thank you.
    Regards,
    AD

    OK, I just tried to insert an element entry from the API and it works perfectly
    The problem seems to be coming from the form. Is the form not using an API?
    If this is the case, should I do a personalization and run a PL/SQL procedure each time a change is made?

  • Modifying/Updating User Defined Field in a Scheduled Task

    I've written a notification task to send an e-mail to a manager who has a contract employee with a contract that is about to expire.
    Once we isolate a user who has a contract about to expire, we send a notification to the manager. The date that the notification is sent out should be stored in the USR table in a user-defined field, "USR_UDF_LASTSENT."
    Updating this USR_UDF_LASTSENT field is where I'm having difficulty.
    I've tried using the UserManager in a couple of ways. Suppose I've isolated a single user using SearchCriteria and the UserManager and have a single User object called "currentUser." I want to store a Date object in the user defined field "USR_UDF_LASTSENT". Date today = new Date();
    I've tried: currentUser.setAttribute("USR_UDF_LASTSENT", today); //This will run without error, but when I check the DB there is no change to the attribute.
    With a defined instance of UserManager userManager, I've tried: userManager.modify("USR_UDF_LASTSENT", today, currentUser); //This errored out with this error - oracle.iam.identity.exception.NoSuchUserException: IAM-3054135:No user found for the criteria USR_UDF_LASTSENT-9/24/13 2:58 PM.:USR_UDF_LASTSENT:9/24/13 2:58 PM. It looks like it's doing a search rather than a modification.
    I've also tried using the entity manager in the following way:
    Date today = new Date();
    HashMap<String, Object> mapAttrs = new HashMap<String, Object>(); 
    mapAttrs.put("USR_UDF_LASTSENT", today); 
    EntityManager entMgr = Platform.getService(EntityManager.class); 
    entMgr.modifyEntity("User", currentUser.getEntityId(), mapAttrs);
    But it returns with this error: Failed: oracle.iam.platform.entitymgr.UnknownAttributeException: User : [USR_UDF_LASTSENT]
    Is my entityType, "User" inappropriate in this case? What should be used here?
    How can I Set or Update this user defined field from a scheduled task?

    Thanks guys. I did go to Identity System Administration console and chose 'Export' from under "System Managment" which I believe Kevin may have been hinting at. I got an xml export of the AttributeDefinitions for our user defined fields. In this file, there was a header for the attribute I was looking for:
    <AttributeDefinition repo-type="API" name="LastSent" subtype="User Metadata">
       <multiValued>
       <backendName>usr_udf_lastsent</backendName>
    I put the string "LastSent" in place of USR_UDF_LASTSENT in the EntityManager version of my attempt at this task. I believe this is what Kevin and delhi were getting at.
    This didn't work:
    Date today = new Date();
    HashMap<String, Object> mapAttrs = new HashMap<String, Object>(); 
    mapAttrs.put("USR_UDF_LASTSENT", today); 
    EntityManager entMgr = Platform.getService(EntityManager.class); 
    entMgr.modifyEntity("User", currentUser.getEntityId(), mapAttrs);
    But this did:
    Date today = new Date();
    HashMap<String, Object> mapAttrs = new HashMap<String, Object>(); 
    mapAttrs.put("LastSent", today); 
    EntityManager entMgr = Platform.getService(EntityManager.class); 
    entMgr.modifyEntity("User", currentUser.getEntityId(), mapAttrs);
    I wonder if currentUser.setAttribute("LastSent", today); would work... Hmm.

  • Dumb question about E messages generated in user exits called from dialogs

    After a user enters goods receipt info in MIGO and hits POST, there is a user exit (EXIT_SAPLIE01_007) which receives a copy of the goods receipt table (xmseg) from MIGO and lets you do whatever you want before the MIGO update task is called.  In other words, you're still in the MIGO dialog process.
    I have successfully used this exit before to pop an editable ALV that lets the user enter custom data per line item, and then store this data in memory so it can be accessed in MB_DOCUMENT_BADI or in the equivalent XMBC exit (enhancement MB_CF001).
    But here's my question.
    Suppose I generate an "E" message in EXIT_SAPLIE01_007. 
    Will this stop the MIGO "POST" so that the update task isn't called?
    And will the text of the "E" message be displayed at the bottom of the main MIGO screen (the one you hit "POST" from) ????
    Edited by: David Halitsky on Feb 21, 2008 9:03 PM
    Edited by: David Halitsky on Feb 21, 2008 9:04 PM

    Hi David,
    it seems that you will get it:
    E in Status bar
    +behaviour:     +
    PAI processing is terminated, and control returns to the current screen. All of the screen fields for which there is a FIELD or CHAIN statement are ready for input. The user must enter a new value. The system then restarts PAI processing for the screen using the new values. Error messages are not possible in POH or POV processing. Instead, a runtime error occurs.
    according to help [http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbaabc35c111d1829f0000e829fbfe/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/en/9f/dbaabc35c111d1829f0000e829fbfe/frameset.htm]
    best regards,
    Wojciech

  • Update user table from matrix

    Hi I've created a matrix in a new tab on the Item Master data form. It loads data from a user table called @Test. This table has 2 udf U_Model and U_Engine. The matrix uses a datatable to query the table. Is there a way to update the table? this is my code:
                   // Adding a Matrix item
                   oNewItem = oForm.Items.Add( "Matrix1", SAPbouiCOM.BoFormItemTypes.it_MATRIX );
                   oNewItem.Left = 5;
                   oNewItem.Width = 400;
                   oNewItem.Top = 200;
                   oNewItem.Height = 150;
                   oNewItem.FromPane = 8;
                   oNewItem.ToPane = 8;
                   oMatrix = ( ( SAPbouiCOM.Matrix )( oNewItem.Specific ) );
                   oColumns = oMatrix.Columns;
                   // Adding Culomn items to the matrix
                   oColumn = oColumns.Add( "#", SAPbouiCOM.BoFormItemTypes.it_EDIT );
                   oColumn.TitleObject.Caption = "#";
                   oColumn.Width = 30;
                   oColumn.Editable = false;
                oColumn = oColumns.Add("Code", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oColumn.TitleObject.Caption = "Code";
                oColumn.Width = 20;
                oColumn.Editable = true;
                oColumn = oColumns.Add("Name", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                oColumn.TitleObject.Caption = "Name";
                oColumn.Width = 20;
                oColumn.Editable = true;
                oColumn = oColumns.Add("Model", SAPbouiCOM.BoFormItemTypes.it_EDIT);
                   oColumn.TitleObject.Caption = "Model";
                   oColumn.Width = 20;
                   oColumn.Editable = true;
                   // Add a column for Name
                   oColumn = oColumns.Add( "Engine", SAPbouiCOM.BoFormItemTypes.it_COMBO_BOX );
                   oColumn.TitleObject.Caption = "Engine";
                   oColumn.Width = 20;
                //Add Valid Values
                oColumn.ValidValues.Add("10", "");
                oColumn.ValidValues.Add("12", "");
                oColumn.ValidValues.Add("32", "");
                oColumn.ValidValues.Add("42", "");
                oColumn.ValidValues.Add("52", "");
                oColumn.ValidValues.Add("62", "");
                dbDatasource = (oForm.DataSources.DBDataSources.Add("@Test"));
                DBTable = (oForm.DataSources.DataTables.Add("MyDataTable"));
                   oMatrix.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single;
    oItem = oForm.Items.Item("5");
                oEdit = ((SAPbouiCOM.EditText)(oItem.Specific));
                string item = oEdit.Value.ToString();
                   oForm.DataSources.DataTables.Item( 0 ).ExecuteQuery( "SELECT Code, Name, U_Model, U_Engine from [@Test] where U_ItemCd = '" + item +"' ");
      oColumn = oColumns.Item("Code");
                oColumn.DataBind.Bind("MyDataTable", "Code");
                oColumn = oColumns.Item("Name");
                oColumn.DataBind.Bind("MyDataTable", "Name");
                   oColumn = oColumns.Item( "Model" );
                   oColumn.DataBind.Bind("MyDataTable", "U_Model");
                oColumn = oColumns.Item("Engine"); 
                   oColumn.DataBind.Bind("MyDataTable", "U_Engine");
                        oMatrix.Clear();
                        oMatrix.AutoResizeColumns();
                        oMatrix.LoadFromDataSource();

    Hi Costas,
    You can use Matrix.FlushToDataSource() to save the data in the Matrix into the datasource.
    But if you want to update the data in the DB, you have to use DI API.
    Regards,
    Jay.

  • Call procedure within procedure

    Hai
    I have some question
    1)
    This below procedure create user at run time
    ============================================
    create or replace procedure new_u1( p_name in varchar2,
    p_pw in varchar2,
    p_def_tblspace in varchar2 default 'users' )
    as
    begin
    execute immediate 'create user ' || P_name || ' identified by ' ||
    p_pw || ' default tablespace ' || p_def_tblspace ||
    ' temporary tablespace temp';
    execute immediate 'grant create session to ' || p_name;
    end;
    This below procedure create tables at run time
    ==============================================
    create or replace procedure M2 (table_name varchar2) as
    cursor1 integer;
    begin
    cursor1 := dbms_sql.open_cursor;
    dbms_sql.parse(cursor1, 'DROP TABLE ' || table_name,
    dbms_sql.v7);
    dbms_sql.close_cursor(cursor1);
    end;
    I want ,when first procedure calls ,it calls second procedure and create tables in that schema (call procedure within procedure).How to do that?
    2)What is diffrenece between row and statement level trigger?how many types of triggers?
    3)what is mutating trigger or table?
    4)dbms_stats.gather_table_stats package it collects the statistics about the tables .I want statistics to be collected at every day 9am and 7pm how to do that?
    Thanks in advance
    Mohan

    You could use an expression like this, to generate the run times:
    SQL> create table times (dt date) ;
    Table created.
    SQL> BEGIN
      2      FOR idx IN 1 .. 24
      3      LOOP
      4          INSERT INTO times VALUES (trunc(SYSDATE) + (idx / 24));
      5          INSERT INTO times VALUES (trunc(SYSDATE) + (idx / 24) + (1 / (24 * 60)));
      6          INSERT INTO times VALUES (trunc(SYSDATE) + (idx / 24) + (59 / (24 * 60)));
      7      END LOOP;
      8  END;
      9  /
    PL/SQL procedure successfully completed.
    SQL>
    SQL> SELECT to_char(dt,
      2                 'dd-mon-yyyy hh:mi:ss AM'),
      3         to_char(decode(sign(to_number(to_char(dt,
      4                                               'hh24MI')) - 900),
      5                        -1,
      6                        trunc(dt) + (9 / 24),
      7                        0,
      8                        trunc(dt) + (9 / 24),
      9                        decode(sign(to_number(to_char(dt,
    10                                                      'hh24MI')) - 1900),
    11                               -1,
    12                               trunc(dt) + (19 / 24),
    13                               0,
    14                               trunc(dt) + (19 / 24),
    15                               trunc(dt) + 1 + (9 / 24))),
    16                 'dd-mon-yyyy hh:mi:ss AM')
    17  FROM   times
    18  ORDER  BY dt
    19  /
    TO_CHAR(DT,'DD-MON-YYYY TO_CHAR(DECODE(SIGN(TO_
    01-jan-2004 01:00:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 01:01:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 01:59:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 02:00:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 02:01:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 02:59:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 03:00:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 03:01:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 03:59:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 04:00:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 04:01:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 04:59:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 05:00:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 05:01:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 05:59:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 06:00:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 06:01:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 06:59:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 07:00:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 07:01:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 07:59:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 08:00:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 08:01:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 08:59:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 09:00:00 AM 01-jan-2004 09:00:00 AM
    01-jan-2004 09:01:00 AM 01-jan-2004 07:00:00 PM
    01-jan-2004 09:59:00 AM 01-jan-2004 07:00:00 PM
    01-jan-2004 10:00:00 AM 01-jan-2004 07:00:00 PM
    01-jan-2004 10:01:00 AM 01-jan-2004 07:00:00 PM
    01-jan-2004 10:59:00 AM 01-jan-2004 07:00:00 PM
    01-jan-2004 11:00:00 AM 01-jan-2004 07:00:00 PM
    01-jan-2004 11:01:00 AM 01-jan-2004 07:00:00 PM
    01-jan-2004 11:59:00 AM 01-jan-2004 07:00:00 PM
    01-jan-2004 12:00:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 12:01:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 12:59:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 01:00:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 01:01:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 01:59:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 02:00:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 02:01:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 02:59:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 03:00:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 03:01:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 03:59:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 04:00:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 04:01:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 04:59:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 05:00:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 05:01:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 05:59:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 06:00:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 06:01:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 06:59:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 07:00:00 PM 01-jan-2004 07:00:00 PM
    01-jan-2004 07:01:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 07:59:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 08:00:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 08:01:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 08:59:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 09:00:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 09:01:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 09:59:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 10:00:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 10:01:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 10:59:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 11:00:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 11:01:00 PM 02-jan-2004 09:00:00 AM
    01-jan-2004 11:59:00 PM 02-jan-2004 09:00:00 AM
    02-jan-2004 12:00:00 AM 02-jan-2004 09:00:00 AM
    02-jan-2004 12:01:00 AM 02-jan-2004 09:00:00 AM
    02-jan-2004 12:59:00 AM 02-jan-2004 09:00:00 AM
    72 rows selected.
    SQL>

  • Call procedure across schema

    I have oracle 8i
    i have multiple identical schema for different country.
    i write one procedure in one schema(country_1) and granted to all others for execute.
    now i am connected to country_2 which doesn't have procedure,
    and i am calling procedure of country_1(which has a procedure).
    upto this everything is fine
    but problem is i want to
    execute the procedure on the recently connected schema(country_2),it is executing on country_1(where actual procedure is )
    Thanks,
    prathesh
    ([email protected])

    You need to add AUTHID CURRENT_USER to your create procedure command.
    From the documentation
    invoker_rights_clause
    The invoker_rights_clause lets you specify whether the procedure executes with the privileges and in the schema of the user who owns it or with the privileges and in the schema of CURRENT_USER.
    This clause also determines how Oracle resolves external names in queries, DML operations, and dynamic SQL statements in the procedure.
    TTFN
    John

  • User Executes Stored Procedure That Executes sp_send_dbmail; receives email but also gets error Cannot alter the queue 'ExternalMailQueue', because it does not exist or you do not have permission.

    Using SQL Server 2012 SP1
    I have a user that is submitting a procedure that uses sp_send_dbmail.  I have also noticed that they have the following code in their procedure
    DECLARE @rc INT
    IF NOT EXISTS (SELECT * FROM msdb.sys.service_queues
    WHERE name = N'ExternalMailQueue' AND is_receive_enabled = 1)
    EXEC @rc = msdb.dbo.sysmail_start_sp
    The user submits the procedure and she gets the email but she also gets the following error message:
    Msg 15151, Level 16, State 1, Procedure sysmail_start_sp, Line 8
    Cannot alter the queue 'ExternalMailQueue', because it does not exist or you do not have permission.
    Mail (Id: 2402) queued.
    (1 row(s) affected)
    I have granted execute to sp_send_dbmail and sysmail_start_sp.  I have also granted select to service_queues.
    Does anyone have any solutions for the above error message?
    lcerni

    The contents of sysmail_start_sp is this:
    CREATE PROCEDURE sysmail_start_sp
    AS
        SET NOCOUNT ON
        DECLARE @rc INT
       DECLARE @localmessage nvarchar(255)
        ALTER QUEUE ExternalMailQueue WITH STATUS = ON
        SELECT @rc = @@ERROR
        IF(@rc = 0)
        BEGIN
          ALTER QUEUE ExternalMailQueue WITH ACTIVATION (STATUS = ON);
           SET @localmessage = FORMATMESSAGE(14639, SUSER_SNAME())
           exec msdb.dbo.sysmail_logmailevent_sp @event_type=1, @description=@localmessage
        END
    RETURN @rc
    The user get the error, because she does not have any permission on the queue in question. To be able to alter the queue, the following applies according to Books Online:
    Permission for altering a queue defaults to the owner of the queue, members of the db_ddladmin or db_owner fixed database roles, and members of the sysadmin fixed server role.
    Note that is would be db_ddladmin or db_owner in msdb. Now, supposedly the queue is already active, and in that case I think that it is sufficient that the user has VIEW DEFINITION on the view. This would permit her to see the row in sys.service_queues,
    why there would be no need to call sysmail_start_sp.
    Altertanively, change the check to:
    DECLARE @isenabled bit
    SELECT @isenabled = (SELECT is_receive_enabled FROM msdb.sys.service_queues
                   WHERE name = N'ExternalMailQueue')
    IF @isenabled = 0
       EXEC @rc = msdb.dbo.sysmail_start_sp
    The idea here is that, if the user has no permission to read the information in the DMV, @isenabled will be NULL, and you just pray and hope that the queue is up and running.
    I suspect that the reason this worked for you on SQL 2005 is that on that instance someone at some point in made all the required configurations for it to work, but all that is forgotten now. That happens to me too.
    If you really want the user to be able to start the queue, I have some better ideas than adding her to a role, but I skip the details for now.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Openscript response in SQL Call Procedure

    Hi,
    How do we get the response data from an SQL Call Procedure, in Openscript?
    The SQL Statement is "call pkg_aaa.aaa(?)".
    The Details view does not seem to give any results. The procedure is supposed to output a string.
    Regards,
    Axel
    Edited by: ao on 2011-jun-09 10:51

    Can you help, the solution please. Thanks.
    I have this script:
    utilities.getSQLService().callProcedure(null,"DESA3",
                        "Begin\n BMEP_EXECUTA_VALIDACION(?,?,?);\n End;",
                        utilities.parameters(SQLService.parameter("{{db.par1.10}}", SQLService.SQLParameterType.In),
                                  SQLService.parameter("{{db.par1.10}}", SQLService.SQLParameterType.In),
                             SQLService.parameter("abc",SQLService.SQLParameterType.Out)))
    Error when executing:
    Results 05-09-2012 12:26:04 AM     2,007               Failed     Failed to execute SQL statement: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Caused by: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Script BaseDeDatos1     2,007               Failed     Failed to execute SQL statement: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Caused by: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Initialize BaseDeDatos1     0,507               Passed          
    DefineDatabase: DESA3     0,001               Passed          
    Parameterize SQL: Begin
    BMEP_EXECUTA_VALIDACION('20','20',?);
    End;     0,001               Passed          
    Run BaseDeDatos1 - Iteration 1     1,325               Failed     Failed to execute SQL statement: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Caused by: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    GetNextDatabankRecord: par1     0,002               Passed     Data Used:[20]      
    Connect to Database: 'DESA3'     0,787               Passed          
    Call Procedure DESA3: 'Begin
    BMEP_EXECUTA_VALIDACION(?,?,?);
    End;'     0,25               Failed     Failed to execute SQL statement: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Caused by: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Data Used:20      
    Finish BaseDeDatos1     0,053               Passed          
    End Script BaseDeDatos1     2,007               Failed     Failed to execute SQL statement: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    Caused by: SQLException occured. ORA-06550: line 1, column 12:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare exit for goto if loop mod null pragma
    raise return select update while with <an identifier>
    <a double-quoted delimited-identifier> <a bind variable> <<
    close current delete fetch lock insert open rollback
    savepoint set sql execute commit forall merge pipe
    The symbol "" was ignored.
    ORA-06550: line 2, column 36:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    begin case declare end exception exit for goto if loop mod
    null pragma raise return select update while with
    <an identifier> <a double-quoted delimited-id
    I try, but :(
    Edited by: user2810993 on 05-sep-2012 6:03
    Edited by: user2810993 on 05-sep-2012 6:07
    Edited by: user2810993 on 05-sep-2012 6:07

  • Updating user table (type document) via api

    hi!
    i need to update an user table that is of type document.
    that table is also used as the client table in an udo.
    i have tried the following code, but that of course doesn't work as the table is not a plain table but is of document type:
      Dim objUserTable As SAPbobsCOM.UserTable
      Set objUserTable = objCom.UserTables.Item("MP_TABLE_LINE")
      If objUserTable.GetByKey(objMatrix.Columns.Item("U_MP_BEnt").Cells.Item(lngRow).Specific.Value) Then
          objUserTable.UserFields.Fields.Item("U_Qty").Value = _
               objUserTable.UserFields.Fields.Item("U_Qty").Value - dblDiff
          If Not objUserTable.Update() <> 0 Then
              Call objApp.SetStatusBarMessage(objCom.GetLastErrorDescription())
              Call objApp.MessageBox(objCom.GetLastErrorDescription())
          Else
              objMatrix.Columns.Item("U_MP_BQty").Cells.Item(lngRow).Specific.String = _
                   objMatrix.Columns.Item("11").Cells.Item(lngRow).Specific.String
          End If
      End If
      Set objUserTable = Nothing
    then i tried to use a dbdatasource which i would expect to work:
      Dim objDataSource As DBDataSource
      Set objDataSource = objForm.DataSources.DBDataSources.Item("@MP_TABLE_LINE")
      Dim objConditions As New SAPbouiCOM.Conditions
      Dim objCond As SAPbouiCOM.Condition
      <just setting up conditions here>
      Call objDataSource.Query(objConditions)
      Call objDataSource.SetValue("U_Qty", 0, objDataSource.GetValue("U_Qty", 0) - dblDiff)
    but this only results in an error code "-7006",  message:
    "Item - The item is not a user defined item"
    how can the update be done?
    regards,
       thomas

    Hi Thomas,
    U are using UserTabel Obejct , just try to Use UserTabelMD object
    i am sending to how to create the User Table,
    Hope it will help to
    oUTb = mobjCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oUserTables)
    If Not oUTb.GetByKey("SPH_FORMS") Then
       oUTb.TableName = "SPH_FORMS"
       oUTb.TableDescription = "Activity Forms"
       oUTb.TableType = SAPbobsCOM.BoUTBTableType.bott_MasterData
    If oUTb.Add <> 0 Then
        mobjCompany.GetLastError(lRet, sErrMsg)
    Else
       oUTb = Nothing
    end if
    be carefull before using MD object , bcoz at a time only one MD object should be in memory else it will give to Error
    Thanks
    Ankush Vachher

  • Error updating user-locale to US

    Using CME 3.3. 
    Cisco IOS Software, 2600 Software (C2691-IPVOICEK9-M), Version 12.4(25d)
    Attempting to update user-locale on 7912 phone via telephony-service command and get error of 
    cme_router(config-telephony)#user-locale US
    Updating CNF files
    %Error deleting flash:SEPDEFAULT.cnf (No such file or directory)
    %Error deleting flash:XMLDefault.cnf.xml (No such file or directory)CNF files update complete
    cme_router(config-telephony)#
    I do a cd flash: and run dir.
    Shows other files her but not 2 files mentioned above. 
    However it does show XMLDefault7912.cnf.xml with 786 bytes and crashinfo_20020301-022926 with 198274 bytes
    crashinfo_20020301-022926 is full of entries with each entry having a date of 10:00:42 GMT Fri Mar 1 2002 (which is the date the router was before I updated via clock set command)
    Any ideas are appreciated

    Hi Martin,
    Thanks for your response.
    Here is updated actioning details
    cme_router(config-telephony)#no create cnf-files
    CNF files deleted
    cme_router(config-telephony)#create cnf-files
    Creating CNF files
    %Error deleting flash:SEPDEFAULT.cnf (No such file or directory)
    %Error deleting flash:XMLDefault.cnf.xml (No such file or directory)CNF-FILES: Clock is not set or synchronized,
                    retaining old versionStamps
    cme_router(config-telephony)#
    cme_router#pwd
    flash:
    cme_router#dir
    Directory of flash:/
        1  -rw-    30172148                    <no date>  c2691-ipvoicek9-mz.124-25d.bin
        2  -rw-        4802  Feb 28 2002 15:17:15 -23:00  admin_user.html
        3  -rw-      657587  Feb 28 2002 15:17:57 -23:00  admin_user.js
        4  -rw-        1602  Feb 28 2002 15:19:02 -23:00  CiscoLogo.gif
        5  -rw-         953  Feb 28 2002 20:49:48 -23:00  Delete.gif
        6  -rw-       16344  Feb 28 2002 20:50:20 -23:00  dom.js
        7  -rw-         864  Feb 28 2002 20:50:54 -23:00  downarrow.gif
        8  -rw-        6146  Feb 28 2002 20:51:47 -23:00  ephone_admin.html
        9  -rw-        4658  Feb 28 2002 20:52:30 -23:00  logohome.gif
       10  -rw-        3724  Feb 28 2002 20:53:43 -23:00  normal_user.html
       11  -rw-       81443  Feb 28 2002 20:54:24 -23:00  normal_user.js
       12  -rw-        1347  Feb 28 2002 20:55:05 -23:00  Plus.gif
       13  -rw-         843  Feb 28 2002 20:55:44 -23:00  sxiconad.gif
       14  -rw-         174  Feb 28 2002 20:56:17 -23:00  Tab.gif
       15  -rw-        2431  Feb 28 2002 20:57:20 -23:00  telephony_service.html
       16  -rw-         870  Feb 28 2002 20:57:54 -23:00  uparrow.gif
       17  -rw-        9968  Feb 28 2002 20:58:56 -23:00  xml-test.html
       18  -rw-      341498                    <no date>  cp7912080004sccp080108a.sbin
       19  -rw-      340247                    <no date>  CP7912060000SCCP050124A.sbin
       23  -rw-         786                    <no date>  XMLDefault7912.cnf.xml
       26  -rw-      198274                    <no date>  crashinfo_20020301-022926
    32047100 bytes total (196248 bytes free)
    cme_router#
    As you can see. There is no file called SEPDEFAULT.cnf under this location. Unless its hidden or some other reason.
    BTW. I have tried to update routers clock setting by below method to no success. Each time I turn router off/on, it goes back to year 2002Step1: Router#config tStep2: Router(config)#clock timezone PST -8 00Step3: Router(config)#endStep4: Router#clock set 00:36:00 16 Nov 2013Step5: Router#sh clock detail
    00:36:24.083 PST Sat Nov 16 2013
    Time source is user configurationStep6: Router#clock updateStep7: Router#copy run start

Maybe you are looking for