Create tables in procedure not working

Hey all, can't seem to figure this one out. I'm trying to create and load tables programmatically with no luck. I can create these tables one at a time with no problem. Any ideas?
SQL> create or replace procedure load_staging_tables as
  2  cursor c_tables is select table_name from all_tables where owner = 'JOHN_DOE' order by 1;
  3  begin
  4  for t in c_tables loop
  5   execute immediate 'CREATE TABLE pmonica1.ORI_' || t.table_name || ' as select * from JOHN_DOE.' || t.table_name;
  6  end loop;
  7  end;
  8  /
Procedure created.
SQL> exec load_staging_tables
BEGIN load_staging_tables; END;
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "PMONICA1.LOAD_STAGING_TABLES", line 5
ORA-06512: at line 1
SQL> disconnect
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - ProductionAs always, thanks!

The owner of this procedure (pmonica1?) needs the 'CREATE TABLE' privilege granted directly - not through a role. Roles are disabled by default in PL/SQL - that is why the table create works at a SQL> prompt but not in PL/SQL.

Similar Messages

  • Using EXECUTE IMMEDIATE with Create Table SQL Statement not working

    Hi ,
    I am all the privileges given from the SYSTEM user , but still i am not able to create a table under procedure . Please see these and advice.
    create or replace procedure sp_dummy as
    begin
    Execute Immediate 'Create table Dummy99_99 (Dummy_Field number)';
    end;
    even i tried this way also
    create or replace PROCEDURE clearing_Practise(p_file_id in varchar2, p_country in VARCHAR2,p_mapId in VARCHAR2)
    AUTHID CURRENT_USER AS
    strStatusCode VARCHAR2(6);
    BEGIN
    EXECUTE IMMEDIATE 'create table bonus(name varchar2(50))';
    commit;
    EXCEPTION
    WHEN OTHERS THEN
    dbms_output.put_line('ERROR Creating Table');
    END ;

    William Robertson wrote:
    Since the syntax is correct, my guess is you do not have CREATE TABLE system privilege granted directly to your account. A common scenario is that you have this privilege granted indirectly via a role, allowing you to create tables on the command line, but stored PL/SQL is stricter and requires a direct grant and therefore the procedure fails with 'insufficient privileges'.A bit like he's already been told on his first thread...
    Using of Execute Immediate in Oracle PLSQL
    Generally you would not create tables from stored PL/SQL. Also as you have found out, it's best not to hide exceptions with 'WHEN OTHERS THEN [some message which gives less detail than the one generated by Oracle]'.Again like he was told on the other thread.
    There's just no telling some people eh! :)

  • How enter the values in to table when create entries option is not working

    hi everyone,
         can u please tell me How enter the values in to table when create entries option is not working.
    it's urgent.
    thanking u all

    Hi Shree,
    how many entries u want to insert ,,
    is it a ztable or custom table ..
    just tell me ur clear requirement ..
    clarify the same ..
    if no options avaliable then if its less entries or some value u can do it through debugging ..
    if its bulk entries then u can write a program ..
    just let me know ..
    regards,
    VIjay

  • 'Create' Push button is not working in BDC and LSMW while uploading G/L master data

    Hello Experts:
    I am facing the following problem:
    While uploading G/L master data with the BDC program, 'create' push button is not working  even after executing following lines.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=ACC_CRE'.
    Create G/L account  screen is not coming in BDC. Please suggest me what to do.
    Thanks !!

    Re: 'Create' Push button is not working in BDC and LSMW while uploading G/L master data
    Re: 'Create' Push button is not working in BDC and LSMW while uploading G/L master data
    Hi Glen Anthony
    Thank you for the reply Glen Anthony please take a look at the following code.
    REPORT  ZFI_BDC_FS00
            NO STANDARD PAGE HEADING LINE-SIZE 255.
    *INCLUDE BDCRECX1.
    TYPES : BEGIN OF STR,
       BUKRS TYPE GLACCOUNT_SCREEN_KEY-BUKRS,        "Company Code
       SAKNR TYPE GLACCOUNT_SCREEN_KEY-SAKNR,        "G/L Account Number
       KTOKS TYPE GLACCOUNT_SCREEN_COA-KTOKS,        "G/L Account Group
       XPLACCT TYPE GLACCOUNT_SCREEN_COA-XPLACCT,    "P&L statement account
       XBILK TYPE GLACCOUNT_SCREEN_COA-XBILK,        "Indicator: Account is a balance sheet account?
       TXT20_ML TYPE GLACCOUNT_SCREEN_COA-TXT20_ML,  "G/L account short text
       TXT50_ML TYPE GLACCOUNT_SCREEN_COA-TXT50_ML,  "G/L account short text
       WAERS TYPE GLACCOUNT_SCREEN_CCODE-WAERS,      "Account currency
       XSALH TYPE GLACCOUNT_SCREEN_CCODE-XSALH,      "Indicator: Only Manage Balances in Local Currency
       MWSKZ TYPE GLACCOUNT_SCREEN_CCODE-MWSKZ,      "Tax Category in Account Master Record
       XMWNO TYPE GLACCOUNT_SCREEN_CCODE-XMWNO,      "Indicator: Tax code is not a required field
       MITKZ TYPE GLACCOUNT_SCREEN_CCODE-MITKZ,      "Account is reconciliation account
       XOPVW TYPE GLACCOUNT_SCREEN_CCODE-XOPVW,      "Indicator: Open item management?
       XKRES TYPE GLACCOUNT_SCREEN_CCODE-XKRES,      "Indicator: Can Line Items Be Displayed by Account?
       ZUAWA TYPE GLACCOUNT_SCREEN_CCODE-ZUAWA,      "Key for sorting according to assignment numbers
       FSTAG TYPE GLACCOUNT_SCREEN_CCODE-FSTAG,      "Field status group
       XINTB TYPE GLACCOUNT_SCREEN_CCODE-XINTB,      "Indicator: Is account only posted to automatically?
       END OF STR.
    DATA : ITAB TYPE TABLE OF STR WITH HEADER LINE,
            IT_BDCDATA TYPE TABLE OF BDCDATA WITH HEADER LINE,
            TXT(4096) TYPE C OCCURS 0,
            MSG TYPE STRING,
            COUNT(5) TYPE N.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
       PARAMETERS : MY_FILE TYPE RLGRAP-FILENAME.
    SELECTION-SCREEN : END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR MY_FILE.
    CALL FUNCTION 'F4_FILENAME'
      EXPORTING
        PROGRAM_NAME        = SYST-CPROG
        DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
      IMPORTING
        FILE_NAME           = MY_FILE
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
       EXPORTING
    *   I_FIELD_SEPERATOR          =
    *   I_LINE_HEADER              =
         I_TAB_RAW_DATA             = TXT
         I_FILENAME                 = MY_FILE
       TABLES
         I_TAB_CONVERTED_DATA       = ITAB[]
      EXCEPTIONS
        CONVERSION_FAILED          = 1
        OTHERS                     = 2
    IF SY-SUBRC <> 0.
    * IMPLEMENT SUITABLE ERROR HANDLING HERE
    ENDIF.
    START-OF-SELECTION.
    COUNT = 0.
    LOOP AT ITAB.
    *PERFORM OPEN_GROUP.
    REFRESH  IT_BDCDATA.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_KEY-BUKRS'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=ACC_CRE'.
    *PERFORM BDC_FIELD       USING 'BDC_CURSOR'
    *                              'GLACCOUNT_SCREEN_KEY-BUKRS'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_KEY-SAKNR'
                                   ITAB-SAKNR. "'5'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_KEY-BUKRS'
                                   ITAB-BUKRS. "'TATA'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=2102_GROUP'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_COA-KTOKS'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                   ITAB-KTOKS. "'GL'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                   ITAB-XPLACCT. "'X'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=2102_BS_PL'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_COA-XBILK'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                   ITAB-KTOKS. "'GL'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XPLACCT'
                                   ITAB-XPLACCT. "''.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XBILK'
                                   ITAB-XBILK. "'X'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=TAB02'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-KTOKS'
                                   ITAB-KTOKS. "'GL'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-XBILK'
                                   ITAB-XBILK. "'X'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_COA-TXT50_ML'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-TXT20_ML'
                                   ITAB-TXT20_ML. "'G/L ACCOUNT'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_COA-TXT50_ML'
                                   ITAB-TXT50_ML. "'G/L ACCOUNT'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=TAB03'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-WAERS'
                                   ITAB-WAERS. "'INR'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XSALH'
                                   ITAB-XSALH. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-MWSKZ'
                                   ITAB-MWSKZ. "'*'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XMWNO'
                                   ITAB-XMWNO. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-MITKZ'
                                   ITAB-MITKZ. "''.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_CCODE-ZUAWA'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XOPVW'
                                   ITAB-XOPVW. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XKRES'
                                   ITAB-XKRES. "'X'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-ZUAWA'
                                   ITAB-ZUAWA. "'1'.
    PERFORM BDC_DYNPRO      USING 'SAPLGL_ACCOUNT_MASTER_MAINTAIN' '2001'.
    PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                   '=SAVE'.
    PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                   'GLACCOUNT_SCREEN_CCODE-XINTB'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-FSTAG'
                                   ITAB-FSTAG. "'G019'.
    PERFORM BDC_FIELD       USING 'GLACCOUNT_SCREEN_CCODE-XINTB'
                                   ITAB-XINTB. "'X'.
    *PERFORM BDC_TRANSACTION USING 'FS00'.
    CALL TRANSACTION 'FS00' USING IT_BDCDATA MODE 'E' UPDATE 'S'.
    COUNT = COUNT + 1.
    *PERFORM CLOSE_GROUP.
    ENDLOOP.
    CONCATENATE COUNT ' RECORDS UPDATED SUCCESSFULLY' INTO MSG.
    MESSAGE MSG TYPE 'I'.
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
       CLEAR IT_BDCDATA.
       IT_BDCDATA-PROGRAM  = PROGRAM.
       IT_BDCDATA-DYNPRO   = DYNPRO.
       IT_BDCDATA-DYNBEGIN = 'X'.
       APPEND IT_BDCDATA.
    ENDFORM.
    *        INSERT FIELD                                                  *
    FORM BDC_FIELD USING FNAM FVAL.
    *  IF FVAL <> NODATA.
         CLEAR IT_BDCDATA.
         IT_BDCDATA-FNAM = FNAM.
         IT_BDCDATA-FVAL = FVAL.
         APPEND IT_BDCDATA.
    *  ENDIF.
    ENDFORM.

  • Table range is not working!!

    Hello all,
    I am using the JHeadstart 10.1.3 production (build 91) and JDeveloper 10.1.3
    I have a main group and 2 detail groups (nested) and regions on the main group. I tried to limit the number of rows by the "table rangë", by selecting it and putting the number of rows and its not showing on the page. I am getting the entire rows.
    any comments about it
    thanks
    san

    San,
    Hmm, very strange. Is this the only page where table range is not working? Can you try creating a new project from scratch and see whether it works correctly there?
    Steven Davelaar,
    JHeadstart Team.

  • How to create table using Procedure

    Hi,
    I want to create table using procedure .
    How to write procedure for the table creation?
    thanks in advance.

    Use dynamic sql or DBMS_UTILITY.EXEC_DDL_STATEMENT:
    SQL> desc tbl1
    ERROR:
    ORA-04043: object tbl1 does not exist
    SQL> begin
      2      execute immediate 'create table tbl1(x number)';
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL> desc tbl1
    Name                                      Null?    Type
    X                                                  NUMBER
    SQL> drop table tbl1
      2  /
    Table dropped.
    SQL> begin
      2      DBMS_UTILITY.EXEC_DDL_STATEMENT('create table tbl1(x number)');
      3  end;
      4  /
    PL/SQL procedure successfully completed.
    SQL> desc tbl1
    Name                                      Null?    Type
    X                                                  NUMBER
    SQL>  SY.

  • DB Adaptor import table option does not work with the AS400 DB

    1. The DB Adaptor import table option does not work with the IBM i-series(AS/400) tables(Both in ESB and BPEL).
    2. Also I was not able to import tables from multiple databases into
    the same BPEL project.

    Both of these issues work in preview version. My earlier posting was based on beta version testing.

  • Package with 2 procedures not working; Please help

    When I try to run the procedures that are in this package manually, each one seperately works. But when I put together these procedures in a package, the second procedure does not work or not updating the table. Any idea why this is creating a problem??
    PROCEDURE UPDATE_CS_ACTIVITY is the one in the below package that does not seems working .. but when i run the procedure manually it works fine.
    Any help in this regard is greatly appreciated...
    Thanx in advance
    Here is the Package code:
    CREATE OR REPLACE PACKAGE BODY UPDATE_ACTIVITY AS
    CSREWORK NUMBER(4);
    CSTRACKOUT NUMBER(4);
    STARTDATE VARCHAR2(20);
    ENDDATE VARCHAR2(20);
    PROCEDURE INSERTVALUES IS
    BEGIN
    DELETE FROM 2DAY_ACTIVITY;
    IF SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),12,2) > 18
    THEN
    STARTDATE := '18:30:00';
    INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSTRACKOUT)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'F';
    INSERT INTO WAFER_2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSREWORK)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'T';
    COMMIT;
    ELSE
    STARTDATE := '06:30:00';
    INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSTRACKOUT)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'F';
    INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSREWORK)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'T';
    COMMIT;
    END IF;
    END INSERTVALUES;
    PROCEDURE UPDATE_CS_ACTIVITY AS
    BEGIN
    INSERT INTO CS_ACTIVITY(STAGESTEPPROD, RESOURCES, CSTRACKOUT, CSREWORK) select MAX(stagestepprod),MAX(resources), max(cstrackout) ,max(csrework) from 2day_activity group by 2DAY_ACTIVITY.stagestepprod,2DAY_ACTIVITY.resources;
    COMMIT;
    END UPDATE_CS_ACTIVITY;
    END UPDATE_ACTIVITY;

    How do you know the procedure is not working?
    You have created a package that has two sub-programs (procedures).
    In order for the sub-programs to execute they must be called, individually.
    You just don't put sub-programs in a package and call the package expecting it to execute all of the sub-programs.

  • ODI Procedures not working after upgrading from 10G to 11G

    Hello Gurus,
    We have run into a scenario where the procedures in ODI are not working after we upgraded it from 10G to 11G (11.1.1.6). However we can make it to run if we create the procedure from scratch.
    Also we are having issues related to packages where in the packages were running before we applied the patch 11.1.1.6.3. And after applying the patches they are not running.
    Any help will be appreciated.
    Thanks

    If you want someone to help you, please be elaborate in the exact errors you are getting.
    A general statement would do nothing but guess work.
    What is the error that you get while executing the procedure.
    What are the exact issues that you get while executing packages ?

  • Table Maintenance(SM30) not working for a custom View..

    Hi,
    I have the below case which is not working at the moment.
    we have standard table T024 and the requirement is to update the table directly in production. To update the standard table i have created a custom maintenance view on this table and created a table maintenance generator for custom view.
    In maintenace status tab of view i have maintened below information:
    Access                                                 read, change, delete and insert
    Delivery class                                       A
    Data Browser/Table View Maint.         Display/ Maintenance allowed
    The table maintenace generator has been also created but when trying to modify it is giving below message
    "Client 210 has status 'not modifiable"
    We have two clients in dev server 200 -for development
                                                            210 - for development testing
    In development it is working but in development testing client and in quality it is not working.
    Can you please help me as to why we are getting the above message?
    Best Regards,
    Rajesh

    Hi Rajesh,
    That is coming because of the Table Maintainance Generator Settings. You have to chose no, or user, recording routine then system will not generate any request and you can update the data. This is actually a BASIS settings in SCC4, so that for customizing tables system should not generate any request.
    Thanks & Regards,
    Faheem.

  • Oracle Stored Procedure not working

    Hi Guy's,
    I want to connect directly from Visual Composer to Oracle Database 10.2.x.x using Oracle Stored Procedure and JDBC System to demonstrate how easy you can show data vith VC. So I have created a simple Oracle Stored Procedure, a JDBC System with a valid alias, User mapping (Portal User --> Oracle User).
    When I invoke the stored procedure I receive the following error: "Portal request Failed (Could not execute stored procedure)". The Stored Procedure is working fine in Oracle iSQL*Plus.
    Any idea's?
    Thanks,
    Ridouan

    Hi,
    did you use the portal JDBC as it is described here:
    <a href="https://wiki.sdn.sap.com/wiki/display/VC/Cannotseetables">https://wiki.sdn.sap.com/wiki/display/VC/Cannotseetables</a>
    Best Regards,
    Marcel

  • Table sort is not working for columns.

    Hi,
    I am using TableSort.java class. Followed https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/library/user-interface-technology/wd%20java/wdjava%20archive/developing%20with%20tables%20in%20web%20dynpro.pdf
    to create the action and assigned that to onSort event for the table. When I run, I see the ascending-descending icons besides the columns, but nothing happens when I click them. Here is the context.
    Context
    l
    l
    l ---User_Table
             > Email
             > Name
            |
             > Office
    Here Name is a custom string (last name, first name). Also office is a custom string (office1, office2, ...etc).
    Edited by: srinivas M on Feb 8, 2009 6:03 AM
    Edited by: srinivas M on Feb 8, 2009 6:03 AM

    Hi Srinivas,
      If you want to do an initial sort. You have to add the following method to the TableSorter class.
    public void initialSort(String columnId, IWDNode dataSource) {
              // find the things we need
              String direction = WDTableColumnSortDirection.UP;
              IWDTableColumn column = (IWDTableColumn) table.getView().getElement(columnId);
              NodeElementByAttributeComparator elementComparator = (NodeElementByAttributeComparator) comparatorForColumn.get(column);
              if (elementComparator == null){
                   //not a sortable column
                   column.setSortState(WDTableColumnSortDirection.NOT_SORTABLE);
                   return;
              // sorting
              elementComparator.setSortDirection(WDTableColumnSortDirection.valueOf(direction));
              dataSource.sortElements(elementComparator);
    In your wdDoModifyView() after initializing the tablesorter class you have to call the above method.
    if (firstTime) {
                IWDTable table = (IWDTable) view.getElement("Table");
                wdContext.currentContextElement().setTableSorter(
                   new TableSorter(table, wdThis.wdGetSortAction(), null));
                      wdContext.currentContextElement().getTableSorter().initialSort("Your Column ID", wdContext.nodeUser_Search_Results());
    Can you double check in your code if the table is bound to the node "User_Search_Results" and not "User_Table". If the table is bound to the "User_Table" then the sort will not work since in the code you are sorting the node "User_Search_Results".
    If you want to implement sort on only one column you can use the alternate constructor for the TableSorter class.
    TableSorter(IWDTable table, IWDAction sortAction, Map comparators, String[] sortableColumns)
    You have to give a String array of columns that need to be sort enabled.
    Regards,
    Sanyev

  • Create Type as Object not working in linux oracle 11g

    Pleae refer to the following simple create type as object statement.
    CREATE OR REPLACE TYPE EC_VIEWABLETYPES as object ( CASE_TYPE_ID NUMBER)
    It is working in oracle 11g and windows server 2008 environment.
    But it is not working in oracle 11g with linux environment.
    I am executing this statement as dynamic sql as follows
    CREATE OR REPLACE PROCEDURE TEMP_SP
    AS
    BEGIN
    DECLARE vcType VARCHAR2(30);
    BEGIN
    SELECT OBJECT_TYPE into vcType FROM USER_OBJECTS
    WHERE OBJECT_NAME='EC_VIEWABLETYPES' AND OBJECT_TYPE='TYPE';
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    EXECUTE IMMEDIATE 'CREATE OR REPLACE TYPE EC_VIEWABLETYPES as object ( CASE_TYPE_ID NUMBER) ';
    COMMIT;
    RETURN;
    END;
    END;
    exec TEMP_SP
    please let me know what i am missing ?

    And error is:ORA-00600: internal error code, arguments: [kothc_uc_md5:lxerr], [], [], [], [], [], [], [], [], [], [], []
    ORA-06512: at "ATIPAGENT.TEMP_SP", line 10
    ORA-01403: no data found
    ORA-06512: at line 1
    ..Query:exec TEMP_SP...Previous Query:CREATE OR REPLACE PROCEDURE TEMP_SP AS BEGIN DECLARE vcType VARCHAR2(30); BEGIN
    SELECT OBJECT_TYPE into vcType FROM USER_OBJECTS
    WHERE OBJECT_NAME='EC_VIEWABLETYPES' AND OBJECT_TYPE='TYPE'; EXCEPTION WHEN NO_DATA_FOUND THEN
    EXECUTE IMMEDIATE 'CREATE OR REPLACE TYPE EC_VIEWABLETYPES as object ( CASE_TYPE_ID NUMBER) ';
    COMMIT;
    RETURN;
    END;
    END;

  • Apex link (Created using href) is not working

    Hello All,
    1. I have created a click able on the APEX page for the attached link (stored in the oracle db table)
    Using below query
    SELECT '<a href="' ||'file:///'||Package.function(p_parameter)||'" target="_blank">'|| package.function (p_parameter_id )||'</a>'
    AS href
    FROM prag.t1, t2 
    WHERE    condition.t1 = condition.t2
    AND ID =p_id
    2. The attached link from the path are opening in a new window perfectly for me.
    \\sih82566\k1_ora$\K1IS\TEST1I\WORKDIR\Gaurav\146539_Scripts.SQL
    3. The attached link from the path such as
    C:\Documentss%20and%20Settings\gaurav\Desktop\f120.sql
    are not accessible to me. There is not any error message also on click on this link.
    Note:I am using using APEX in my citrix machine
    Thank you.
    Regards,
    Gaurav Nagpal.

    Hello Hari ,
    I was expecting suggestion from you and finally you replied  thanks a ton.
    For your first question :->
    I think the problem is with "citrix". Can you just run the application from your machine and see if you can access the file?
          Yes, I copied the link "  C:\Documentss%20and%20Settings\gaurav\Desktop\f120.sql "  and paste on IE its working perfectly.
    When you run browser from citrix, then C:\.. will refer to local drive of Citrix machine, not your local machine!
        Attached link  from  C:\. is not working (either I attach  link  from citrix machine or my local machine)
    It would be really very helpful if you can suggest me more in solving this issue.
    Thank you.
    Regards,
    Gaurav Nagpal.

  • Approval Procedure not working randomly on sales orders

    Hi Experts,
    We place approval procedure for 2 users in SAP B1 2007B pl15.
    Some SO does not pass approval procedure  and we cannot trace why. The are 2 set up for approval procedure 1 for within on below credit limit. The other one beyond credit limit.
    Does anyone have the same problem with Approval procedure?
    What do I need to check  to isolate the problem?
    Regards,
    Amy

    Hi Gordon,
    We tried to disable the SO query beyond credit limit in a test database to check if the approval procedure will run if there are no other queries checking the credit limit. Now we only have one query running- the SO within credit limit.
    We eliminated another possibility for the error. The error occurs for a newly created BP.  The approval procedure will not work in SO  is the first SO ever created in the system. All subsequent SO will go thru the approval procedure even if the SO, DN and Account balance is zero
    1)We also tried this query and diabled the SO Beyond Credit Limit
    SELECT DISTINCT 'TRUE' from DBO.ORDR T0 INNER JOIN DBO.OCRD T1 ON T0.CardCode=T1.CardCode Where T0.CardCode=$[$4.0.string] and T1.CreditLine >=(
    (case when T1.Balance = 0.00 then 0.00 else T1.Balance end) +
    (case when T1.OrdersBal = 0.00 then 0.00 else T1.OrdersBal end) +
    (case when T1.DNotesBal = 0.00 then 0.00 else T1.DNotesBal end) +
    +$[$29.0.number])
    2) We also tried the Deviation from credlit limit is less than .01. Still error.
    Is this a system error or error in the query?.
    Regards,
    Amy

Maybe you are looking for