ASSERTION_FAILED when filling dropdownbykey with sql queries

Hi everybody,
I'm new to WDA, and I am coding a new interface for transaction CBIH82 in EHS.
I am filling a dropdownbykey with a sql query, for the work area.
On the view, the dropdownbykey is populated, but when I click on a button, or when I launch an action, I have the error "ASSERTION_FAILED".
However, if I fill the dropdownbykey manually in the code, I got no error.
Error in IE :
The ASSERT condition was violated
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: IF_WDR_VIEW_ELEMENT_ADAPTER~SET_CONTENT of program /1WDA/LSTANDARD===============CP
Method: CONV_VIEW_INTO_VE_ADAPTER_TREE of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
Method: SET_CONTENT_BY_WINDOW of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
Method: RENDER_WINDOWS of program CL_WDR_CLIENT_SSR=============CP
Method: IF_WDR_RESPONSE_RENDERER~RENDER_VIEWS of program CL_WDR_CLIENT_SSR=============CP
Method: IF_WDR_RESPONSE_RENDERER~RENDER_USER_INTERFACE_UPDATES of program CL_WDR_CLIENT_SSR=============CP
Here is the dump :
27926     else.                                                                           
27927       IFUR_NW5_COMBOBOX~READONLY = wd_DROPDOWN_BY_KEY->vl_READ_ONLY.                
27928     endif.                                                                          
27929 *   >> UCA STANDARD|ABSTR_DROPDOWN_BY_KEY|READONLY                                  
27930     if M_PARENT_READONLY = abap_true or                                             
27931        mv_KEY_ATTR_INFO-is_read_only = abap_true.                                   
27932       IFUR_NW5_COMBOBOX~READONLY = abap_true.                                       
27933     endif.                                                                          
27934                                                                               
27935 *   >> property-UCA IFUR_NW5_COMBOBOX~REQUIRED                                      
27936 *   >> UCA STANDARD|DROPDOWN_BY_KEY|REQUIRED                                        
27937     if mv_WD_STATE = cl_wd_dropdown_by_idx=>e_state-required.                       
27938       IFUR_NW5_COMBOBOX~REQUIRED = abap_true.                                       
27939     else.                                                                           
27940       IFUR_NW5_COMBOBOX~REQUIRED = abap_false.                                      
27941     endif.                                                                          
27942                                                                               
27943 *   >> property-Property IFUR_NW5_COMBOBOX~USEDINSAPTABLE                           
27944     IFUR_NW5_COMBOBOX~USEDINSAPTABLE = /1WDA/VTABLE_CELL_EDITOR~mv_INSIDE_TABLE.    
27945                                                                               
27946 *   >> property-UCA mv_VALUE_SET                                                    
27947 *   >> UCA STANDARD|ABSTR_DROPDOWN_BY_KEY|VALUE_SET                                 
27948     data value_set_item type WDR_CONTEXT_ATTR_VALUE.        "#EC NEEDED             
27949     mv_VALUE_SET = mv_KEY_ATTR_INFO-value_set.                                      
27950     read table mv_VALUE_SET into value_set_item                                     
27951       with key value = mv_KEY_INTERNAL.                                             
27952     if sy-subrc = 0.                                                                
27953       IFUR_NW5_COMBOBOX~VALUE = cl_http_utility=>escape_html( value_set_item-text ).
27954     else.                                                                           
27955       " entry not found - only legal for "initial" value                            
>>>>>       assert mv_KEY_INTERNAL co ` 0`.                       "#EC NOTEXT             
27957       IFUR_NW5_COMBOBOX~VALUE = ''.                         "#EC NOTEXT             
27958     endif.                   
The error is at line 27956.                                                     
And here is my code to fill the dropdownbykey in my wddoinit of my view :
data:
    lieux_de_travail                    type string,
    description_lieux_travail           type string,
    table_record_number_travail         type TABLE OF string,
    table_lieux_travail_full            type TABLE OF string,
    lieux_travail_full                  type string,
    record_number_travail               type string,
    valeur_int                          type i VALUE 0,
    valeur_string                       type string.
SELECT RECNROOT FROM CCIHT_WAH INTO TABLE table_record_number_travail.
LOOP AT table_record_number_travail INTO record_number_travail.
  SELECT WANAM FROM CCIHT_WALD INTO description_lieux_travail WHERE RECNROOT = record_number_travail.
  ENDSELECT.
  SELECT WAID FROM CCIHT_WAH INTO lieux_de_travail WHERE RECNROOT = record_number_travail.
  ENDSELECT.
  IF NOT lieux_de_travail = 'ALOUETTE'.
    CONCATENATE lieux_de_travail description_lieux_travail INTO lieux_travail_full SEPARATED BY ' - '.
  ELSE.
    lieux_travail_full = lieux_de_travail.
  ENDIF.
INSERT lieux_travail_full INTO TABLE table_lieux_travail_full.
ENDLOOP.
data:     NODE_INFO type ref to IF_WD_CONTEXT_NODE_INFO,
          NODE_INFO_ACLOC type ref to IF_WD_CONTEXT_NODE_INFO.
NODE_INFO = WD_CONTEXT->GET_NODE_INFO( ).
NODE_INFO_ACLOC = NODE_INFO->GET_CHILD_NODE( 'INFO_ACLOC' ).
data:    LT_VALUESET type WDR_CONTEXT_ATTR_VALUE_LIST,
         L_VALUE type WDR_CONTEXT_ATTR_VALUE.
valeur_int = 0.
LOOP AT table_lieux_travail_full INTO L_VALUE-TEXT.
  ADD 1 TO valeur_int.
  MOVE valeur_int to valeur_string.
  L_VALUE-VALUE = valeur_string.
  INSERT L_VALUE into table LT_VALUESET.
ENDLOOP.
CLEAR valeur_int.
NODE_INFO_ACLOC->SET_ATTRIBUTE_VALUE_SET(
     NAME = 'LIEUX'
     VALUE_SET = LT_VALUESET ).
The values are stored in the context node "INFO_ACLOC", and cardinality 1.1/0.1, in LIEUX of type String.
Anybody had this error before?
Thank you!
Brad

Hi Thomas,
thank you, that was it.
I had a conversion of int to string, and the resulting string was not good.
It looked like as a number in the debug mode, but not in the hexadecimal value.
I did not saw it, because I'm beginning to learn abap too.
Brad

Similar Messages

  • Generate ER Diagram with Sql Queries ?

    Hi Expertie,
    I am new to Oracle Sql Developer Data Modeler.
    I am having doubt in Oracle Sql Developer Data Modeler. Can we create ER Diagram with sql queries ?
    Ex: select Ename, EAge, Eemail, ESalary, DDept, Dname, Estatus from Emp E join Dept D on E.EmpId = D.Empid
          Where EAge in (20, 25, 30, 35)
    Please provide me the answer and suggestion. It will be greatful for me.
    Thanks & Regards
    Bhaskar

    Yes, you can engineer your physical model to a logical one, then you'll have an ERD as well. It's a right-click on the model I believe.
    To be more specific, if you relational model is loaded, you can use the button in the toolbar that looks like a double-blue-arrow, or you can mouse-right-click on your relational model in the tree. This will engineer your model to a logical one. You'll then have your ERD.
    Edited by: Jeff Smith SQLDev PM on Apr 29, 2013 9:53 AM

  • Links with sql queries to practice

    Hi all,
    Can someone give me the links with sql queries for practice to preparing for OCP
    Thanks
    Shekar.

    Hi,
    Can u repost?? as its very difficult to understand ur problem.
    Vasu Natari.

  • Looking for a SQL report guru to help me with SQL queries

    As an independent consultant, I sometimes need to build custom SSRS reports.  I need someone I can reach out to when SQL queries become complex.  There is such a query now.
    Thanks.
    Richgar
    612-207-8347

    Thanks, Visakh,
    I'm trying to determine which resources did not fill out a timesheet.  The result of this query is missing just a few names and I can't find the reason.  I'm thinking of a web meeting looking at real data is necessary and will be glad to pay
    for the help.
    SELECT       
    ResourceName, ResourceIsGeneric, ResourceType, RBS, ResourceIsActive
    FROM           
    MSP_EpmResource_UserView
    WHERE       
    (ResourceName NOT IN
    (SELECT DISTINCT MSP_EpmResource_UserView_1.ResourceName
    FROM           
    MSP_EpmResource_UserView AS MSP_EpmResource_UserView_1 INNER JOIN
    MSP_TimesheetLine_UserView ON MSP_EpmResource_UserView_1.ResourceUID = MSP_TimesheetLine_UserView.ResourceUID INNER JOIN
    MSP_Timesheet ON MSP_TimesheetLine_UserView.TimesheetUID = MSP_Timesheet.TimesheetUID
    WHERE        (MSP_EpmResource_UserView_1.ResourceType = 2) AND (MSP_EpmResource_UserView_1.ResourceIsActive = 1) AND (MSP_EpmResource_UserView_1.RBS IS NOT NULL) AND
    (CONVERT(varchar, MSP_TimesheetLine_UserView.PeriodStartDate, 101) IN (@Period_Start_Date)) AND (MSP_EpmResource_UserView_1.RBS IN (@RBS)))) AND (ResourceIsGeneric = 0) AND
    (ResourceType = 2) AND (RBS IN (@RBS)) AND (ResourceIsActive = 1)

  • Statement terminator problems when exporting data with SQL Developer 3.2

    I've ran across what appears to be a bug with SQL Developer 3.2.20.09. If someone can let me know if this is indeed a bug, or just something I need to configure differently, please let me know.
    The problem is related to exporting a database as a SQL script, and terminator characters at the end of "create" statements, especially when columns have comments, and problems that occur when using SQLPlus to run the export script to create the tables. With the old SQL Developer 1.5.4, with the "Terminator" and "Pretty Print" options checked, statements like the following are generated:
    -- DDL for Type NUM_ARRAY
    CREATE OR REPLACE TYPE "NUM_ARRAY"
    IS TABLE OF NUMBER(20)
    -- DDL for Sequence MYTABLE_SEQ
    CREATE SEQUENCE "MYTABLE_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
    -- DDL for Table MYTABLE
    CREATE TABLE "MYTABLE"
    (     "MYTABLE_ID" NUMBER,
         "COL2" NUMBER,
         "COL3" NUMBER
    -- DDL for Table ANOTHERTABLE
    CREATE TABLE "ANOTHERTABLE"
    (     "ANOTHERTABLE_ID" NUMBER,
         "COL2" VARCHAR2(1024),
         "COL3" VARCHAR2(1024)
    COMMENT ON COLUMN "ANOTHERTABLE"."ANOTHERTABLE_ID" IS 'This is a comment.';
    When I then run the script using SQLPlus, everything works fine. However, with SQL Developer 3.2.20.09, with the same options enabled, the same statements are generated like this:
    -- DDL for Type NUM_ARRAY
    CREATE OR REPLACE TYPE "NUM_ARRAY"
    IS TABLE OF NUMBER(20)
    -- DDL for Sequence MYTABLE_SEQ
    CREATE SEQUENCE "MYTABLE_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE ;
    -- DDL for Table MYTABLE
    CREATE TABLE "MYTABLE"
    (     "MYTABLE_ID" NUMBER,
         "COL2" NUMBER,
         "COL3" NUMBER
    -- DDL for Table ANOTHERTABLE
    CREATE TABLE "ANOTHERTABLE"
    (     "ANOTHERTABLE_ID" NUMBER,
         "COL2" VARCHAR2(1024),
         "COL3" VARCHAR2(1024)
    COMMENT ON COLUMN "ANOTHERTABLE"."ANOTHERTABLE_ID" IS 'This is a comment.';
    Notice all of the extra slashes in there. If a slash is not used as a statement terminator, SQLPlus treats slashes as a command to repeat the last SQL statement, which causes many errors about tables or sequences already existing. So, I tried removing the "Terminator" flag from the export options. This lead to statements that looked a bit more promising:
    -- DDL for Type NUM_ARRAY
    CREATE OR REPLACE TYPE "NUM_ARRAY"
    IS TABLE OF NUMBER(20)
    -- DDL for Sequence MYTABLE_SEQ
    CREATE SEQUENCE "MYTABLE_SEQ" MINVALUE 1 MAXVALUE 999999999999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE
    -- DDL for Table MYTABLE
    CREATE TABLE "MYTABLE"
    (     "MYTABLE_ID" NUMBER,
         "COL2" NUMBER,
         "COL3" NUMBER
    -- DDL for Table ANOTHERTABLE
    CREATE TABLE "ANOTHERTABLE"
    (     "ANOTHERTABLE_ID" NUMBER,
         "COL2" VARCHAR2(1024),
         "COL3" VARCHAR2(1024)
    COMMENT ON COLUMN "ANOTHERTABLE"."ANOTHERTABLE_ID" IS 'This is a comment.'
    The big problem, though, is in the statement for the table with a comment. Notice that there are two statements, but there is not a semicolon after either of them. This unfortunately causes the "COMMENT" statement to be appended to the "CREATE TABLE" statement before being executed, which causes the table to not be created (which causes even more errors later on when the script attempts to populate the table with data).
    So, it would appear that this is a bug, but I'm not sure. Is there a way I can configure the export options to make SQL Developer export these statements like it used to in older versions?
    Thanks,
    -Bill

    >
    So, it would appear that this is a bug, but I'm not sure.
    >
    That would be a bug. Thanks for reporting it and providing the detailed example.
    >
    Is there a way I can configure the export options to make SQL Developer export these statements like it used to in older versions?
    >
    No.
    Leave the thread open. One of the developers for sql developer should be monitoring the forum and can provide more information.

  • Help with SQL queries following migration

    Hi there,
    I have just migrated from MS SQL Server database to Oracle 10g database using the Oracle SQL Developer.
    My application is using JDBC to access the database, and there are heaps of SQL statements that need to be verified and tested. I've found a number of SQL compatibility issues from my testing of the Oracle database and I hope you can help me the following.
    1. Case sensitivity
    Is it possible to not enforce case sensitivity (by default) when performing a select query?
    If this is not possible, all the SQL statements will need to be changed to evaluate column based on uppercase.
    2. Trailing white space
    Is it possible to not evaluate trailing white space (by default) when performing a select query?
    For example, suppose a table column studentNo has trailing spaces (after database migration), e.g. 'A182D '
    when performing query - select * from student where studentNo = 'A182D'
    no results can be found
    3. Issue with Where condition containing with '' = ''
    There are quite a number of SQL statements with Where condition containing '' = ''.
    For example, the following SQL query doesn't return any results even though there are matching suburb that starts with 'ST'. These types of queries are mostly used in dynamic generated queries.
    select * from Address where (suburb like 'ST%') and ('' = '' or country = '')
    Any help or advice will be greatly appreciated.
    Regards,
    Jason Gordon

    As justin mentioned setting those NLS parameters will make oracle not to use your regular index. for that you must create a function based index. See example below.
    SQL> create index t_idx on t (name)
      2  /
    Index created.
    SQL> exec dbms_stats.gather_table_stats(user,'T',cascade=>true)
    PL/SQL procedure successfully completed.
    SQL> explain plan for
      2  select * from t where name = 'karthick'
      3  /
    Explained.
    SQL> select * from table(dbms_xplan.display)
      2  /
    PLAN_TABLE_OUTPUT
    Plan hash value: 2946670127
    | Id  | Operation        | Name  | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT |       |     1 |     9 |     1   (0)| 00:00:01 |
    |*  1 |  INDEX RANGE SCAN| T_IDX |     1 |     9 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - access("NAME"='karthick')
    13 rows selected.
    SQL> delete from plan_table
      2  /
    2 rows deleted.
    SQL> alter session set NLS_COMP=ANSI;
    Session altered.
    SQL> alter session set NLS_SORT=BINARY_CI;
    Session altered.
    SQL> explain plan for
      2  select * from t where name = 'karthick'
      3  /
    Explained.
    SQL> select * from table(dbms_xplan.display)
      2  /
    PLAN_TABLE_OUTPUT
    Plan hash value: 1601196873
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |     9 |     5   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| T    |     1 |     9 |     5   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    PLAN_TABLE_OUTPUT
       1 - filter(NLSSORT("NAME",'nls_sort=''BINARY_CI''')=HEXTORAW('6B61727
                  46869636B00') )
    14 rows selected.
    SQL> create index t_idx_1 on t(NLSSORT(name,'NLS_SORT=BINARY_CI'))
      2  /
    Index created.
    SQL> exec dbms_stats.gather_table_stats(user,'T',cascade=>true)
    PL/SQL procedure successfully completed.
    SQL> /
    create index t_idx_1 on t(NLSSORT(name,'NLS_SORT=BINARY_CI'))
    ERROR at line 1:
    ORA-00955: name is already used by an existing object
    SQL> delete from plan_table
      2  /
    2 rows deleted.
    SQL> explain plan for
      2  select * from t where name = 'karthick'
      3  /
    Explained.
    SQL> select * from table(dbms_xplan.display)
      2  /
    PLAN_TABLE_OUTPUT
    Plan hash value: 2580036035
    | Id  | Operation                   | Name    | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |         |     3 |    27 |     2   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| T       |     3 |    27 |     2   (0)| 00:00:01 |
    |*  2 |   INDEX RANGE SCAN          | T_IDX_1 |     3 |       |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access(NLSSORT("NAME",'nls_sort=''BINARY_CI''')=HEXTORAW('6B6172746869636B00') )Thanks,
    Karthick.

  • Segmentation fault when enabling replication with SQL API

    Hi,
    I've compiled BDB 5.3.21 on Ubuntu 11.04 (x86) with the following configure options:
    ../dist/configure enable-sql enable-sql_compat enable-debug enable-tcl --with-tcl=/usr/lib
    I was able to follow the Replication Usage Examples given in "Getting Started with the SQL APIs" to set up a set of replicated master/client databases.
    However, after I exited out of the dbsql session that started replication on the master database and re-opened the master database with dbsql, executing "pragma replication_initial_master=ON;" followed by "pragma replication=ON;" led to a segmentation fault. gdb showed that the segmentation fault occurred at:
    dbsql> pragma replication=ON;
    Program received signal SIGSEGV, Segmentation fault.
    0x0032d42b in __env_ref_get (dbenv=0x8056ad8, countp=0xbfffd498)
    at ../src/env/env_region.c:772
    772          renv = infop->primary;
    (gdb) list
    767          REGENV *renv;
    768          REGINFO *infop;
    769     
    770          env = dbenv->env;
    771          infop = env->reginfo;
    772          renv = infop->primary;
    773          *countp = renv->refcnt;
    774          return (0);
    775     }
    776     
    (gdb)
    Does anybody know of a solution to this or could this be a bug? Thanks in advance.
    P.S. here's a stack trace:
    (gdb) bt
    #0 0x0032d42b in __env_ref_get (dbenv=0x8056ad8, countp=0xbfffd498)
    at ../src/env/env_region.c:772
    #1 0x001786fc in hasDatabaseConnections (p=0x8056708)
    at ../lang/sql/generated/sqlite3.c:44420
    #2 0x00178a11 in bdbsqlPragmaStartReplication (pParse=0x80648e0,
    pDb=0x80561cc) at ../lang/sql/generated/sqlite3.c:44533
    #3 0x001797f5 in bdbsqlPragma (pParse=0x80648e0,
    zLeft=0x8062e20 "replication", zRight=0x8062dc0 "ON", iDb=0)
    at ../lang/sql/generated/sqlite3.c:44812
    #4 0x001c215d in sqlite3Pragma (pParse=0x80648e0, pId1=0x8064b60,
    pId2=0x8064b70, pValue=0x8064b90, minusFlag=0)
    at ../lang/sql/generated/sqlite3.c:78941
    #5 0x001e5c83 in yy_reduce (yypParser=0x8064b20, yyruleno=256)
    at ../lang/sql/generated/sqlite3.c:96668
    #6 0x001e6761 in sqlite3Parser (yyp=0x8064b20, yymajor=1, yyminor=...,
    pParse=0x80648e0) at ../lang/sql/generated/sqlite3.c:97051
    #7 0x001e7537 in sqlite3RunParser (pParse=0x80648e0,
    zSql=0x80648b8 "pragma replication=ON;", pzErrMsg=0xbfffdba0)
    at ../lang/sql/generated/sqlite3.c:97877
    #8 0x001c730e in sqlite3Prepare (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;", nBytes=-1, saveSqlFlag=1,
    ---Type <return> to continue, or q <return> to quit---
    pReprepare=0x0, ppStmt=0xbfffdc8c, pzTail=0xbfffdc88)
    at ../lang/sql/generated/sqlite3.c:80736
    #9 0x001c7739 in sqlite3LockAndPrepare (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;", nBytes=-1, saveSqlFlag=1,
    pOld=0x0, ppStmt=0xbfffdc8c, pzTail=0xbfffdc88)
    at ../lang/sql/generated/sqlite3.c:80828
    #10 0x001c7a5e in sqlite3_prepare_v2 (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;", nBytes=-1, ppStmt=0xbfffdc8c,
    pzTail=0xbfffdc88) at ../lang/sql/generated/sqlite3.c:80903
    #11 0x0804baf6 in shell_exec (db=0x8056010,
    zSql=0x80648b8 "pragma replication=ON;",
    xCallback=0x804a3c4 <shell_callback>, pArg=0xbfffde14, pzErrMsg=0xbfffdcfc)
    at ../lang/sql/sqlite/src/shell.c:1092
    #12 0x0805030e in process_input (p=0xbfffde14, in=0x0)
    at ../lang/sql/sqlite/src/shell.c:2515
    #13 0x08051453 in main (argc=2, argv=0xbffff3f4)
    at ../lang/sql/sqlite/src/shell.c:2946
    -Irving
    Edited by: snowcrash on Jan 15, 2013 2:16 PM

    Thank you for reporting this. I have been able to reproduce this crash in-house.
    You need to specify the replication_initial_master and replication pragmas as part of initially creating your SQL database. The replication_initial_master pragma is not used or needed after the initial database creation at the initial master site. The replication=on pragma is a persistent setting that we remember internally the first time you specify it. This means that after specifying replication=on for the first time on a site, we will automatically restart replication for you in future dbsql sessions when we open the underlying Berkeley DB environment.
    This gives you a very simple workaround: don't respecify replication=on when you reenter dbsql.
    Of course, we shouldn't be crashing on an unnecessary pragma. I have added this to our list of fixes to consider for the future.
    Thanks,
    Paula Bingham
    Oracle

  • Constraints are missing when using unload with SQL Developer 3.0.03 .

    The following message appears in the output file and no constraints are included.
    Unable to render CONSTRAINT DDL for object *** with DBMS_METADATA attempting internal generator.

    First of all - there is no SQL Tab available (unlike earlier versions of SQL Developer)
    Here are the results of the requested selects:
    1 - select * from all_objects where object_name = 'LOC_CONTACTS' and owner ='PRO';
    PRO LOC_CONTACTS 31282 31282 TABLE 03-MAR-11 03-MAR-11 2011-03-03:17:31:39 VALID N Y N
    2 - select * from all_constraints where table_name = 'LOC_CONTACTS' and owner = 'PRO';
    (Same result as select * from all_constraints where table_name = 'LOC_CONTACTS' )
    PRO     SYS_C003305     C     LOC_CONTACTS     "LOC_NUM" IS NOT NULL                    ENABLED     NOT DEFERRABLE     IMMEDIATE     VALIDATED     GENERATED NAME               03-MAR-11                    
    PRO     SYS_C003306     C     LOC_CONTACTS     "LITEM_NUM" IS NOT NULL                    ENABLED     NOT DEFERRABLE     IMMEDIATE     VALIDATED     GENERATED NAME               03-MAR-11                    
    PRO     SYS_C003307     C     LOC_CONTACTS     "TITLE" IS NOT NULL                    ENABLED     NOT DEFERRABLE     IMMEDIATE     VALIDATED     GENERATED NAME               03-MAR-11                    
    PRO     SYS_C003308     C     LOC_CONTACTS     "FIRST_NAME" IS NOT NULL                    ENABLED     NOT DEFERRABLE     IMMEDIATE     VALIDATED     GENERATED NAME               03-MAR-11                    
    PRO     SYS_C003309     C     LOC_CONTACTS     "SURNAME" IS NOT NULL                    ENABLED     NOT DEFERRABLE     IMMEDIATE     VALIDATED     GENERATED NAME               03-MAR-11                    
    PRO     SYS_C003310     C     LOC_CONTACTS     "POSITION" IS NOT NULL                    ENABLED     NOT DEFERRABLE     IMMEDIATE     VALIDATED     GENERATED NAME               03-MAR-11                    
    PRO     SYS_C003311     C     LOC_CONTACTS     "USER_NAME" IS NOT NULL                    ENABLED     NOT DEFERRABLE     IMMEDIATE     VALIDATED     GENERATED NAME               03-MAR-11                    
    PRO     SYS_C003312     C     LOC_CONTACTS     "LANGUAGE" IS NOT NULL                    ENABLED     NOT DEFERRABLE     IMMEDIATE     VALIDATED     GENERATED NAME               03-MAR-11                    
    PRO     SYS_C003313     C     LOC_CONTACTS     "ACTIVE" IS NOT NULL                    ENABLED     NOT DEFERRABLE     IMMEDIATE     VALIDATED     GENERATED NAME               03-MAR-11                    
    PRO     SYS_C003314     C     LOC_CONTACTS     "POST_TO_SUN" IS NOT NULL                    ENABLED     NOT DEFERRABLE     IMMEDIATE     VALIDATED     GENERATED NAME               03-MAR-11
    Edited by: user470293 on 22-Mar-2011 02:04
    Edited by: user470293 on 22-Mar-2011 02:04

  • How to crete CFL with SQL queries

    Hi, First create the srf which has two buttons- Choose and Cancel code for creating the grid :- you have to pass the SQL query as a paramter in the below function .In query you choose as many as fields from the table ,at run time columns will automatically created corresponds to your query. private bool CreateGrid(string sSQL) { try { SAPbouiCOM.Item oItem; oItem = oform.Items.Add("Grid", SAPbouiCOM.BoFormItemTypes.it_GRID); oItem.Left = 7; oItem.Width = 387; oItem.Top = 47; oItem.Height = 188; oform.DataSources.DataTables.Add("dtLookUpTable"); oDataTable = oform.DataSources.DataTables.Item("dtLookUpTable"); oDataTable.Clear(); oDataTable.ExecuteQuery(sSQL); oGrid = (SAPbouiCOM.Grid)oItem.Specific; oGrid.SelectionMode = SAPbouiCOM.BoMatrixSelect.ms_Single ; oGrid.DataTable = oDataTable; if(oGrid.Rows.Count > 0) { oGrid.Rows.SelectedRows.Add(0); } for (int iColCounter = 0; iColCounter < oGrid.Columns.Count; iColCounter+) { oGrid.Columns.Item(iColCounter).Width = 50; oGrid.Columns.Item(iColCounter).Editable = false; } oGrid.AutoResizeColumns(); return true; } catch(Exception ex) { oform.Freeze(false); throw ex; } } -
    choose the value on pressing the button 'Choose' protected override void ITEMPRESS_AFTERACTION(ref SAPbouiCOM.ItemEvent pVal, out bool BubbleEvent, SAPbouiCOM.Application oSboApplication, SAPbobsCOM.Company oCompany) { BubbleEvent = true; if (pVal.ItemUID == "choosebuttonuid") { if (oGrid.Rows.SelectedRows.Count > 0) { SAPbouiCOM.DataTable oReturnTable = null; oform.DataSources.DataTables.Add("dtReturnTable"); oReturnTable = oform.DataSources.DataTables.Item("dtReturnTable"); oReturnTable.CopyFrom(oDataTable); for (int iRowIndex = 0; iRowIndex < oReturnTable.Rows.Count; iRowIndex) oReturnTable.Rows.Remove(iRowIndex); int iRow = oGrid.GetDataTableRowIndex(oGrid.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_RowOrder)); oReturnTable.Rows.Add(1); //for (int iColIndex = 0; iColIndex < oReturnTable.Columns.Count; iColIndex+) // oReturnTable.SetValue(iColIndex, 0, oDataTable.GetValue(iColIndex, iRow)); oReturnTable.SetValue(0, 0, oDataTable.GetValue(0, iRow )); oReturnTable.SetValue(1, 0, oDataTable.GetValue(1, iRow)); SBOAppAddOn.mLookupForms.Remove(oform.UniqueID.ToString()); then u have to send the oReturnTable with parentuid( issue for production) to the baseform. example-> SendData(oReturnTable, strParentFormUID, oSboApplication, oCompany); oform.Close(); } } } More:- You have to include the Doubleclick faclity on the grid You have to include the find functionality also.

    Hi,
    Can u repost?? as its very difficult to understand ur problem.
    Vasu Natari.

  • JComboBox or JList with SQL queries. Best practises.

    Hi!
    I'm wondering what you do in the following situation, providing you develop a hotel reservation application and you have a form where you enter room details: room number, number of rooms, description and type (JComboBox).
    So when executing an INSERT query what do you usually do? Do you store ID's of types or execute addtion SELECT query to get the if of the selected type?

    Thank you very much! I like your approach, but what if I should fill in a form automatically? I mean I have a section in my application where you can edit rooms, you choose a room from a JList and fter clicking on a particular room, the fields of the form get entered and if I have a JComboBox there what should I do?
    I use this approach:
    <code>
    public void valueChanged ( ListSelectionEvent e )
    Item item = ( Item ) lRooms.getSelectedValue();
    try {
    Db db = new Db ();
    ResultSet rs = db.executeQuery ( "SELECT * FROM rooms " +
    "WHERE id = " + item.getId () );
    rs.next ();
    pRoomsEdit.this.id = rs.getInt ( "id" );
    tfNo.setText ( item.getName () );
    ComboBoxModel cbm = cbType.getModel ();
    ResultSet rsType = db.executeQuery ( "SELECT name FROM types " +
    "WHERE id = " + rs.getString ( "type" ) );
    rsType.next ();
    cbm.setSelectedItem ( new Item ( rs.getInt ( "id" ), rsType.getString ( "name" ) ) );
    tfRoomNum.setText ( rs.getString ( "roomNum" ) );
    taDesc.setText ( rs.getString ( "description" ) );
    catch ( SQLException se ) {
    se.printStackTrace ();
    </code>

  • Can I get metadata with SQL queries ??

    Can I get relationships between tables in MS Access using SQL statements ??

    Actually, you might be able to get what you need out of DatabaseMetaData class.
    DatabaseMetaData meta = connection.getMetaData();perhaps using:
    public ResultSet getCrossReference(String primaryCatalog,
                                       String primarySchema,
                                       String primaryTable,
                                       String foreignCatalog,
                                       String foreignSchema,
                                       String foreignTable)
                                throws SQLException
    Retrieves a description of the foreign key columns in the given foreign key table that reference the primary key columns of the given primary key table (describe how one table imports another's key). This should normally return a single foreign key/primary key pair because most tables import a foreign key from a table only once. They are ordered by FKTABLE_CAT, FKTABLE_SCHEM, FKTABLE_NAME, and KEY_SEQ.

  • SQL Queries, filter with multiple radio Buttons

    I am trying to figure out how to filter my datagridview with SQL queries so that both of them have to be met for data to show up not just one.
    My datagridview is bound to an Access Database.
    I basically would want it filtered by 'Width' and 'Wood Type'
    I have radio buttons in group boxes so a width and wood can be selected. However only one Query is applied at a time.

    Public Class Form1
    Private Sub StickersBindingNavigatorSaveItem_Click(sender As Object, e As EventArgs)
    Me.Validate()
    Me.StickersBindingSource.EndEdit()
    Me.TableAdapterManager.UpdateAll(Me.TestDataSet)
    End Sub
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    'TODO: This line of code loads data into the 'TestDataSet.Stickers' table. You can move, or remove it, as needed.
    Me.StickersTableAdapter.Fill(Me.TestDataSet.Stickers)
    AcceptButton = Button1
    End Sub
    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
    End Sub
    Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
    Try
    Me.StickersTableAdapter.Wood_Oak(Me.TestDataSet.Stickers)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try
    End Sub
    Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
    Try
    Me.StickersTableAdapter.Wood_Walnut(Me.TestDataSet.Stickers)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try
    End Sub
    Private Sub RadioButton3_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton3.CheckedChanged
    Try
    Me.StickersTableAdapter.Width14(Me.TestDataSet.Stickers)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try
    End Sub
    Private Sub RadioButton4_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton4.CheckedChanged
    Try
    Me.StickersTableAdapter.Width18(Me.TestDataSet.Stickers)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try
    End Sub
    Private Sub TextBox1_TextChanged(sender As Object, e As EventArgs) Handles TextBox1.TextChanged
    If RadioButton5.Checked = True Then
    If TextBox1.Text = "" Then
    Else
    Me.StickersBindingSource.Filter = "Width LIKE '" & TextBox1.Text & "%'"
    DataGridView1.Refresh()
    End If
    ElseIf RadioButton6.Checked = True Then
    If TextBox1.Text = "" Then
    Else
    Me.StickersBindingSource.Filter = "[Wood Type] LIKE '" & TextBox1.Text & "%'"
    DataGridView1.Refresh()
    End If
    ElseIf RadioButton5.Checked = False And RadioButton6.Checked = False Then
    MsgBox("Please Select a Search Criteria")
    End If
    End Sub
    Private Sub TextBox2_TextChanged(sender As Object, e As EventArgs) Handles TextBox2.TextChanged
    Try
    Me.StickersTableAdapter.SearchWood(Me.TestDataSet.Stickers)
    Catch ex As System.Exception
    System.Windows.Forms.MessageBox.Show(ex.Message)
    End Try
    End Sub
    End Class

  • Recursive Java programming method for executing recursive SQL queries

    Anybody has a Java/JDBC example method to execute recursive SQL queries and print results? The method has to work for any number of queries and levels and the first query passes the parameter to the second query.
    Edited by: user4316962 on Jun 12, 2011 1:59 PM

    user4316962 wrote:
    Guys, the problem what I am trying to solve is much more complex and I don’t think SQL level recursion is enough. I am looking for Java solution with SQL queries in it to make it more flexible and DB independent.
    If you want to do recursion in SQL then it has nothing to do with Java.
    And if you want to do recursion in Java then the idiom itself has nothing to do with SQL.
    Other than that you have provided enough detail for anyone to even guess at what you are asking.
    As a start I am not even sure that you understand what recursion is nor how JDBC works. (But it could be that you are using the terms to mean something else.)
    And looking at your original post it could be nothing more than that you are looking for a design pattern - perhaps the interpreter.

  • UD Connect with SQL Sever 2008

    Hi,
    I created a ud connect for connect with SQL Server 2008 but not working. Message: UDCADAPTERROR::RSSDK|100| Unable to connect to destination.
    When I try with SQL Server 2005 work very well.
    For both I used Microsoft SQL Server JDBC Driver 2.0.
    Someone has an idea.....
    Thanks!
    Fernanda.

    Hi,
    I used Microsoft SQL Server 2005 JDBC Driver 1.2 with HotFix JDBC Driver 1.2.
    "The customer needs to use our JDBC driver 1.2 in the state of hotfix 12. The customer shall go to the SAP Service Market Place. They shall read OSS note #639702. In that OSS note (SAPu2019s flavor of our KBAs), they find the location for the hotfixed JDBC driver on the SAP Market Place and the exact way how to replace the origin DataDirect driver SAP delivered for a while."
    Good Luck!
    Best Regards,
    Fernanda.

  • Problem occured when create a tree table for master-detail view objects using SQL queries?

    I am programming a tree table for master-detail view objects using SQL queries and these 2 view objects are not simple singel tables queries, and 2 complex SQL are prepared for master and view objects. see below:
    1. Master View object (key attribute is SourceBlock and some varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK,                   
            sum(                   
             case when cntr_list.cntr_size_q = '20'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr20 ,                   
            sum(                   
             case when cntr_list.cntr_size_q = '40'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr40 ,                   
             sum(                   
             case when cntr_list.cntr_size_q = '45'                   
                  then cntr_list.cntr_qty                   
                  else 0 end ) as cntr45                    
    FROM (       
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,       
               scn.CNTR_SIZE_Q,        
               count(scn.CNTR_SIZE_Q) AS cntr_qty        
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2       
        WHERE       
        scm.cmr_n = scn.cmr_n             
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                 
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                 
        AND scm.shift_mode_c = :ShiftModeCode                           
        AND scm.end_terminal_c = :TerminalCode      
        AND scm.start_terminal_c = yb1.terminal_c                  
        AND scm.start_block_n = yb1.block_n                  
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                  
        AND scm.end_terminal_c = yb2.terminal_c                  
        AND scm.end_block_n = yb2.block_n                  
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n           
        AND scn.status_c not in (1, 11)             
        AND scn.shift_type_c = 'V'             
        AND scn.source_c = 'S'       
        GROUP BY yb1.BLOCK_M, scn.CNTR_SIZE_Q       
    ) cntr_list       
    GROUP BY cntr_list.SOURCE_BLOCK
    2. Detail View object (key attributes are SourceBlock and EndBlock and same varaible bindings are used for this view object.)
    SELECT  cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK,                
            sum(                     
             case when cntr_list.cntr_size_q = '20'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr20 ,                     
            sum(                     
             case when cntr_list.cntr_size_q = '40'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr40 ,                     
             sum(                     
             case when cntr_list.cntr_size_q = '45'                     
                  then cntr_list.cntr_qty                     
                  else 0 end ) as cntr45                      
    FROM (         
        SELECT yb1.BLOCK_M as SOURCE_BLOCK,     
               yb2.BLOCK_M as END_BLOCK,  
               scn.CNTR_SIZE_Q,          
               count(scn.CNTR_SIZE_Q) AS cntr_qty          
        FROM  SHIFT_CMR scm, SHIFT_CNTR scn, YARD_BLOCK yb1, YARD_BLOCK yb2         
        WHERE         
        scm.cmr_n = scn.cmr_n               
        AND (scm.plan_start_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS')                   
        OR scm.plan_end_dt BETWEEN to_date(:DateFrom,'YYYY/MM/DD HH24:MI:SS') AND to_date(:DateTo,'YYYY/MM/DD HH24:MI:SS'))                   
        AND scm.shift_mode_c = :ShiftModeCode                             
        AND scm.end_terminal_c = :TerminalCode        
        AND scm.start_terminal_c = yb1.terminal_c                    
        AND scm.start_block_n = yb1.block_n                    
        AND substr(scn.start_location_c,(instr(scn.start_location_c,',',1,5)+1),instr(scn.start_location_c,',',1,6)-(instr(scn.start_location_c,',',1,5)+1)) BETWEEN yb1.slot_from_n AND yb1.slot_to_n                    
        AND scm.end_terminal_c = yb2.terminal_c                    
        AND scm.end_block_n = yb2.block_n                    
        AND substr(scn.end_location_c,(instr(scn.end_location_c,',',1,5)+1),instr(scn.end_location_c,',',1,6)-(instr(scn.end_location_c,',',1,5)+1)) BETWEEN yb2.slot_from_n AND yb2.slot_to_n             
        AND scn.status_c not in (1, 11)               
        AND scn.shift_type_c = 'V'               
        AND scn.source_c = 'S'         
        GROUP BY yb1.BLOCK_M, yb2.BLOCK_M, scn.CNTR_SIZE_Q         
    ) cntr_list         
    GROUP BY cntr_list.SOURCE_BLOCK, cntr_list.END_BLOCK
    3. I create a view link to create master-detail relationship for these 2 view objects.
    masterview.SourceBlock (1)->detailview.SourceBlock (*).
    4. I create a tree table using these 2 view objects with master-detail relationship.
    When I set default value for variable bindings of these 2 view objects and the matching records exist, tree table can work well. I can expand the master row to display detail row in UI.
    But I need to pass in dymamic parameter value for variable bindings of these 2 view objects, tree table cannnot work again. when I expand the master row and no detail row are displayed in UI.
    I am sure that I pass in correct parameter value for master/detail view objects and matching records exist.
    Managed Bean:
            DCIteratorBinding dc = (DCIteratorBinding)evaluteEL("#{bindings.MasterView1Iterator}");
            ViewObject vo = dc.getViewObject();
            System.out.println("Before MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            System.out.println("Before MasterView1Iterator ShiftModeCode="+ vo.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo.executeQuery();
            System.out.println("MasterView1Iterator vo.getEstimatedRowCount()="+ vo.getEstimatedRowCount());
            DCIteratorBinding dc1 = (DCIteratorBinding)evaluteEL("#{bindings.DetailView1Iterator}");
            ViewObject vo1 = dc1.getViewObject();
            System.out.println("Before DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
            System.out.println("Before DetailView1Iterator ShiftModeCode="+ vo1.ensureVariableManager().getVariableValue("ShiftModeCode"));
            vo1.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
            vo1.ensureVariableManager().setVariableValue("DateTo", dateTo);
            vo1.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
            vo1.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
            vo1.executeQuery();
            System.out.println("after DetailView1Iterator vo1.getEstimatedRowCount()="+ vo1.getEstimatedRowCount());
    5.  What's wrong in my implementation?  I don't have no problem to implement such a tree table if using simple master-detail tables view object, but now I have to use such 2 view objects using complex SQL for my requirement and variable bindings are necessary for detail view object although I also think a bit strange by myself.

    Hi Frank,
    Thank you and it can work.
    public void setLowHighSalaryRangeForDetailEmployeesAccessorViewObject(Number lowSalary,
                                                                              Number highSalary) {
            Row r = getCurrentRow();
            if (r != null) {
                RowSet rs = (RowSet)r.getAttribute("EmpView");
                if (rs != null) {
                    ViewObject accessorVO = rs.getViewObject();
                    accessorVO.setNamedWhereClauseParam("LowSalary", lowSalary);
                    accessorVO.setNamedWhereClauseParam("HighSalary", highSalary);
                executeQuery();
    but I have a quesiton in this way. in code snippet, it is first getting current row of current master VO to determine if update variables value of detail VO. in my case, current row is possibly null after executeQuery() of master VO and  I have to change current row manually like below.
    any idea?
                DCIteratorBinding dc = (DCIteratorBinding)ADFUtil.evaluateEL("#{bindings.SSForecastSourceBlockView1Iterator}");
                ViewObject vo = dc.getViewObject();           
                vo.ensureVariableManager().setVariableValue("DateFrom", dateFrom);
                vo.ensureVariableManager().setVariableValue("DateTo", dateTo);
                vo.ensureVariableManager().setVariableValue("ShiftModeCode", shiftModeC);
                vo.ensureVariableManager().setVariableValue("TerminalCode", terminalCode);
                vo.executeQuery();
                vo.setCurrentRowAtRangeIndex(0);
                ((SSForecastSourceBlockViewImpl)vo).synchornizeAccessorVOVariableValues();

Maybe you are looking for