Context Type Vector
Hi,
I would like to Consume a Web Service through WD, The return type of the service is Vector and I would like to display result in Table so I have to bind this return type to Table UI.
I have tried to make a Web Service model and mapped it to Controller Context then to View Context but when I try to bind the Table UI to return type value attribute is enabled. I do not know how can I changed the return type so that I can bind it to TextView in Table cell editor.
Is there any one who can help me in this case?
Thanks
Regards
Yasir Noman
Let us conside you are storing employee objects in a vector.
for(int i=0;i<Vector.size();i++)
Employee emp=(Employee) Vector.get(i);
IPrivateView.ITableNodeElement ele=wdContext.createTableNodeELement();
ele.set<<Attrib1>(emp.get<<Attrib1>>);
ele.set<<Attrib2>(emp.get<<Attrib2>>);
wdContext.nodeTableNode().addElement(ele);
Regards, Anilkumar
Similar Messages
-
Creating CTXSYS.CONTEXT type index for orddoc
Hi,
We tried to create a index for a orddoc datatype , the syntax used was as below
CREATE INDEX CIX_DLX_ASSET1 ON DLX_ASSET(TEXT_ASSET.source.localdata) INDEXTYPE IS CTXSYS.CONTEXT;
where DLX_ASSET is the table name and TEXT_ASSET is of the type Orddoc.
When we tried to create the index we are getting the below error message
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at "CTXSYS.DRUE", line 157
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 204
But the index is being created but it is not proper and contain query doesnot work properly on it
However we were able to create an index for TEXT_ASSET.comments as below
CREATE INDEX CIX_TBL_ASSET1 ON TBL_ASSET(TEXT_ASSET.comments) INDEXTYPE IS CTXSYS.CONTEXT;
The step we had followed are as below
Granted required permission to the User owning the index.
GRANT CTXAPP to User
GRANT EXECUTE ON CTX_CLS TO User;
GRANT EXECUTE ON CTX_DDL TO User;
GRANT EXECUTE ON CTX_DOC TO User;
GRANT EXECUTE ON CTX_OUTPUT TO User;
GRANT EXECUTE ON CTX_QUERY TO User;
GRANT EXECUTE ON CTX_REPORT TO User;
GRANT EXECUTE ON CTX_THES TO User;
All the package of the ctxsys is complied
The ctxsrv has been stared as below
ctxsrv -user ctxsys/ctxsys
and is up and runing.Dear
Here are the error explanations;
ORA-06502: PL/SQL: numeric or value error string
Cause: An arithmetic, numeric, string, conversion, or constraint error occurred. For example, this error occurs if an attempt is made to assign the value NULL to a variable declared NOT NULL, or if an attempt is made to assign an integer larger than 99 to a variable declared NUMBER(2).
Action: Change the data, how it is manipulated, or how it is declared so that values do not violate constraints.
ORA-29855:
error occurred in the execution of ODCIINDEXCREATE routine
Cause: Failed to successfully execute the ODCIIndexCreate routine.
Action: Check to see if the routine has been coded correctly.Ogan -
Context Type Search returning wrong results with "ME" in the SEARCH
CREATE TABLE "TEST"
id NUMBER(19) NOT NULL,
"TESTDATA" CLOB NOT NULL ENABLE
CREATE INDEX IX_testdata ON test (testdata) INDEXTYPE IS CTXSYS.CONTEXT ONLINE
PARAMETERS ('TRANSACTIONAL MEMORY 500M SYNC(ON COMMIT) section group ctxsys.xmlpathgroup')
PARALLEL 4
insert into test values (1, '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user>
<givenname>victor</fn>
<surname>frandenstein</sn>
</user>
select * from TEST
where
contains(testdata,
'me inpath(/user/givenname) &(victor inpath(/user/givenname))') > 0
This should not result in any results but it does show the record out.
What is it we have to do deal with the word "ME". It works fine for any other values.Since "me" is a default stopword, searching for "me" and "Victor" is like just searching for "Victor", so it returns the row with "Victor" in it. If you want to be able to search for "me", then you need to either remove "me" from your existing ctxsys.default_stoplist using ctx_ddl.remove_stopword or specify another stoplist during index creation that does not contain me or an empty stoplist. You will need to drop and recreate your index after changing or modifying stoplists in order for the changes to take effect. Please see the demonstration below. I have added a couple of rows so that it is clearer what is and is not returned. You can check the token_text column of your dr$...$i index to see what it is tokenized, indexed, and searchable.
SCOTT@10gXE> -- test environment:
SCOTT@10gXE> CREATE TABLE "TEST"
2 (
3 id NUMBER(19) NOT NULL,
4 "TESTDATA" CLOB NOT NULL ENABLE
5 )
6 /
Table created.
SCOTT@10gXE> insert into test values (1, '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <user>
3 <givenname>victor</fn>
4 <surname>frandenstein</sn>
5 </user>
6 ')
7 /
1 row created.
SCOTT@10gXE> insert into test values (2, '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <user>
3 <givenname>me victor</fn>
4 <surname>frandenstein</sn>
5 </user>
6 ')
7 /
1 row created.
SCOTT@10gXE> insert into test values (3, '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2 <user>
3 <givenname>naren</fn>
4 <surname>frandenstein</sn>
5 </user>
6 ')
7 /
1 row created.
SCOTT@10gXE> exec ctx_ddl.create_section_group ('xmlpathgroup', 'PATH_SECTION_GROUP')
PL/SQL procedure successfully completed.
SCOTT@10gXE> -- reproduction:
SCOTT@10gXE> CREATE INDEX IX_testdata ON test (testdata) INDEXTYPE IS CTXSYS.CONTEXT
2 PARAMETERS
3 ('TRANSACTIONAL MEMORY 500M
4 SYNC(ON COMMIT)
5 section group xmlpathgroup')
6 PARALLEL 4
7 /
Index created.
SCOTT@10gXE> SELECT token_text FROM dr$ix_testdata$i
2 /
TOKEN_TEXT
FRANDENSTEIN
NAREN
VICTOR
givenname
surname
user
6 rows selected.
SCOTT@10gXE> select * from TEST
2 where
3 contains(testdata,
4 'me inpath(/user/givenname) &(victor inpath(/user/givenname))') > 0
5 /
ID
TESTDATA
1
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user>
<givenname>victor</fn>
<surname>frandenstein</sn>
</user>
2
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user>
<givenname>me victor</fn>
<surname>frandenstein</sn>
</user>
SCOTT@10gXE> -- solution:
SCOTT@10gXE> drop index ix_testdata
2 /
Index dropped.
SCOTT@10gXE> CREATE INDEX IX_testdata ON test (testdata) INDEXTYPE IS CTXSYS.CONTEXT
2 PARAMETERS
3 ('TRANSACTIONAL MEMORY 500M
4 SYNC(ON COMMIT)
5 section group xmlpathgroup
6 stoplist ctxsys.empty_stoplist')
7 PARALLEL 4
8 /
Index created.
SCOTT@10gXE> SELECT token_text FROM dr$ix_testdata$i
2 /
TOKEN_TEXT
FRANDENSTEIN
ME
NAREN
VICTOR
givenname
surname
user
7 rows selected.
SCOTT@10gXE> select * from TEST
2 where
3 contains(testdata,
4 'me inpath(/user/givenname) &(victor inpath(/user/givenname))') > 0
5 /
ID
TESTDATA
2
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<user>
<givenname>me victor</fn>
<surname>frandenstein</sn>
</user>
SCOTT@10gXE> -
Hello everybody,
I have from time to time to create Intermedia or Oracle text indexes in Oracle databes, most 10g ones.
Today I did it in a Oracle 10g under Linux RHEL 5, with this few usual commands:
1) connect SYS/**** as SYSDBA;
2) CREATE TABLESPACE "DRSYS" LOGGING DATAFILE '/path_to_index_files/drsys.ora' SIZE 25M REUSE AUTOEXTEND ON NEXT 1280K MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO;
3) @$ORACLE_HOME/ctx/admin/catctx.sql ctxsys DRSYS TEMP NOLOCK
4) connect ctxsys/ctxsys;
5) @$ORACLE_HOME/ctx/admin/defaults/drdeff.sql;
6) connect sa/*****;
7) CREATE INDEX pj_index ON sa.tpiecejointe(pjcontenu) INDEXTYPE IS ctxsys.context parameters ('sync (every "SYSDATE+12/24")');
My issue occured at the 7th step:
CREATE INDEX pj_index ON sa.tpiecejointe(pjcontenu) INDEXTYPE IS ctxsys.context parameters ('sync (every "SYSDATE+12/24")')
ERROR at line 1:
ORA-29855: error occurred in the execution of ODCIINDEXCREATE routine
ORA-20000: Oracle Text error:
DRG-11206: user filter command /dk2/app/oracle/ctx/bin/ctxhx could not be
executed
ORA-06512: at "CTXSYS.DRUE", line 160
ORA-06512: at "CTXSYS.TEXTINDEXMETHODS", line 364
/dk2/app/oracle/ctx/bin/ctxhx is ok and may be executed by anyone.
I found no reason for this problem on the Web.
If somebody can help, thanks a lot...
ThomasHi,
for using the sync parameter, the user needs to be granted to execute a job. Oracle makes a job to do the sync. So issue:
GRANT CREATE JOB TO SMADMIN;
from SYS/SYSTEM.
Herald ten Dam
superconsult.nl -
Recreating indexes of type: ctxsys.context
For a database on Oracle 10g, I need to output a script that recreates all indexes of type of ctxsys.context type. I can do it running this query:
SELECT owner, index_name, DBMS_METADATA.get_ddl('INDEX', index_name, owner)
FROM all_indexes
WHERE ityp_owner = 'CTXSYS' AND ityp_name = 'CONTEXT';However, if an index has parameters like this:
CREATE INDEX <MySchema>.<Index_name> ON <MySchema>.<Index_name>
(BL_RESOLUCION)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS('sync (every "FREQ=DAILY; BYHOUR=1")')
NOPARALLEL;If I run DBMS_METADATA.get_ddl function, I get this output script:
CREATE INDEX <MySchema>.<Index_name> ON <MySchema>.<Index_name>
(BL_RESOLUCION)
INDEXTYPE IS CTXSYS.CONTEXT;How to include the parameter line?
Edited by: user521219 on 06-nov-2012 9:55>
For a database on Oracle 10g, I need to output a script that recreates all indexes of type of ctxsys.context type. I can do it running this query:
SELECT owner, index_name, DBMS_METADATA.get_ddl('INDEX', index_name, owner)
FROM all_indexes
WHERE ityp_owner = 'CTXSYS' AND ityp_name = 'CONTEXT';
However, if an index has parameters like this:
CREATE INDEX <MySchema>.<Index_name> ON <MySchema>.<Index_name>
(BL_RESOLUCION)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS('sync (every "FREQ=DAILY; BYHOUR=1")')
NOPARALLEL;
If I run DBMS_METADATA.get_ddl function, I get this output script:
CREATE INDEX <MySchema>.<Index_name> ON <MySchema>.<Index_name>
(BL_RESOLUCION)
INDEXTYPE IS CTXSYS.CONTEXT;
How to include the parameter line?
>
When you post always provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION); 10g is not a version.
Works for me on Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
CREATE INDEX "SCOTT"."NDX_TEST_CONTEXT" ON "SCOTT"."DEPT" ("DNAME")
INDEXTYPE IS "CTXSYS"."CONTEXT" PARAMETERS ('sync (every "FREQ=DAILY; BYHOUR=1")')Post information about which user is running that query and which user owns the index that is giving the problem.
Have you tried the query using a DBA user? -
Autoboxing does not work in Vector.add(x) context?
Hello,
I wondered about this bit of code today:
Vector<Long> data = new Vector<Long>();
long l = 10;
data.add(l);On the add method I get the error message "The method add(Long) in the type Vector<Long> is not applicable for the arguments (long)"... I mean, isn't this what autoboxing was meant for? I still have to use data.add(new Long(l)); to get it to work.
Casting to Long, such as add((Long)l) doesn't work either, though it explicitly tells the compiler that we expect an object here (as if this were necessary...)
Now, who is getting it wrong - me or the compiler? ;-) I am using the JDK 1.5.0, of course, and the Eclipse 3.1 IDE; maybe it's a problem of the IDE also.
Thanks for answers,
kind regards, LeoThanks for the reply.
It seems that the Eclipse parser does not fully support autoboxing.
Concerning the confusing variable name: this is not a live code snippet, but a made-up example.
Greetings, Leo -
Differance between Type & Like
Hye Friends,
Apart from the following differences what are the other differences between these two statements.
1 type is used for data type and like is used for ddic structures.
What are the other differences??????????????
Thanks in advance.
Subodh GHi Subodh,
Check this info.
The Statements TYPES and DATA
Each ABAP program define its own data types using the statement.
TYPES dtype [TYPE type|LIKE dobj] ...
and declare its own variables or instance attributes of classes using the statement
DATA var [{TYPE type}|{LIKE dobj}] ...
Within the program or a class, you can also define local data types and variables within procedures. Local variables in procedures obscure identically-named variables in the main program or class.
When creating data types and data objects, there are a number of naming convention that also apply for other local program definitions, such as procedures. These are described in detail in the keyword documentation.
The Additions TYPE and LIKE
The additions TYPE type and LIKE dobj are used in various ABAP statements. The additions can have various meanings, depending on the syntax and context.
Definition of local types in a program
Declaration of data objects
Dynamic creation of data objects
Specification of the type of formal parameters in subroutines
Specification of the type of formal parameters in methods
Specification of the type of field symbols
Constructing New Data Types
The TYPE addition allows you to construct new data types in the TYPES, DATA; CONSTANTS; and STATICSstatements. In the TYPES statement, these are local data types in the program. In the other statements, they are attributes of new data objects, meaning that the newly defined data types are not free-standing. Rather, they are linked to database objects.This means that you can refer to them using the LIKEaddition, but not using TYPE.
To construct new data types, the addition TYPE can be used with the following type constructors:
Construction of reference types
REF TO type|dobj
Construction of structured data types
BEGIN OF struc_type.
END OF struc_type.
Construction of table types
tabkind OF linetype [WITH key]
These data types only exist during the runtime of the ABAP program.
Referring to Known Data Types or Data Objects
Using the additions TYPE or LIKE in the TYPESstatement, local data types in a program can be referred to known data types or data objects. This is mainly the case with user-defined elementary data types. If you declare variables using the additions TYPE type or LIKE dobj with statement DATA, the data type of var is already fully defined before the declaration is made.
The known types or data that are referred to must be visible at the point where the data type or variable is declared.
A known data type can be any of the following:
A predefined ABAP type to which you refer using the TYPE addition
An existing local data type in the program to which you refer using the TYPE addition
The data type of a local data object in the program to which you refer using the LIKE addition
A data type in the ABAP Dictionary to which you refer using the TYPE addition. To ensure compatibility with earlier releases, it is still possible to use the LIKE addition to refer to database tables and flat structures in the ABAP Dictionary. However, you should use the TYPE addition in new programs.
The LIKE addition takes its technical attributes from a visible data object. As a rule, you can use LIKE to refer to any object that has been declared using DATA or a similar statement, and is visible in the current context. The data object only has to have been declared. It is irrelevant whether the data object already exists in memory when you make the LIKE reference.
In principle, the local data objects in the same program are visible. As with local data types, there is a difference between local data objects in procedures and global data objects. Data objects defined in a procedure obscure other objects with the same name that are declared in the global declarations of the program.
You can also refer to the data objects of other visible ABAP programs. These might be, for example, the visible attributes of global classes in class pools. If a global class cl_lobal has a public instance attribute or static attribute attr, you can refer to it as follows in any ABAP program:
DATA dref TYPE REF TO cl_global.
DATA: f1 LIKE cl_global=>attr,
f2 LIKE dref->attr.
You can access the technical properties of an instance attribute using the class name and a reference variable without first having to create an object. The properties of the attributes of a class are not instance-specific and belong to the static properties of the class.
TYPES: BEGIN OF struct,
number_1 TYPE i,
number_2 TYPE p DECIMALS 2,
END OF struct.
DATA: wa_struct TYPE struct,
number LIKE wa_struct-number_2,
date LIKE sy-datum,
time TYPE t,
text TYPE string,
company TYPE s_carr_id.
This example declares variables with reference to the internal type STRUCT in the program, a component of an existing data object wa_struct, the predefined data object SY-DATUM, the predefined ABAP type t and STRING, and the data element S_CARR_ID from the ABAP Dictionary.
Referring to Generic Data Types
If you refer to one of the generic predefined ABAP types of fixed length (c, n, p, x) in the TYPES or DATA statement, you must specify the undefined technical attributes.
TYPES|DATA var[(length)] TYPE type [DECIMALS dec]...
TYPES|DATA var TYPE type [LENGTH len] [DECIMALS dec]...
DATA: text1,
text2 LENGTH 2,
text3 TYPE c LENGTH 3,
pack TYPE p DECIMALS 2 VALUE '1.225'.
This example creates three character variables with field lengths of one, two, and three bytes respectively, and a packed number variable with field length 8 bytes and two decimal places. If the attribute Fixed point arithmetic is set, the value of pack is 1.23.
This example shows how to declare elementary data objects with reference to predefined ABAP types.
PROGRAM demo_elementary_data_objects.
DATA text1 TYPE c LENGTH 20.
DATA text2 TYPE string.
DATA number TYPE i.
text1 = 'The number'.
number = 100.
text2 = 'is an integer.'.
WRITE: text1, number, text2.
This program produces the following output on the screen:
The number 100 is an integer.
In this example, the data objects text1, text2 and number are declared with the DATA statement. The technical attributes are determined by referring to the predefined ABAP types c, string, and I. Values from unnamed literals are assigned to the data objects. The contents of the named data objects are displayed on the list.
Specifying a Start Value
When you declare an elementary fixed-length variable, the DATAstatement automatically fills it with the type-specific initial value as listed in the table in the Predefined ABAP Types section.
However, you can also specify a starting value of a fixed-length elementary variable (also within a structure declaration) using the VALUE addition in the DATAstatement:
DATA var ... VALUE val|{IS INITIAL}.
Specifying start values:
DATA: counter TYPE p VALUE 1,
date TYPE d VALUE '19980601',
flag TYPE n VALUE IS INITIAL.
After this data declaration, the character string flag contains its type specific
Initial value 0
Internal Tables
Internal tables are dynamic variable data objects. Like all variables, you declare them using the DATA statement.
You can also declare static internal tables in procedures using the STATICSstatement, and static internal tables in classes using the CLASS-DATAstatement.
This description is restricted to the DATAstatement. However, it applies equally to the STATICS and CLASS-DATA statements.
Referring to Known Table Types
Like all other data objects, you can declare internal tables using the LIKE or TYPE addition of the DATA statement.
DATA itab TYPE type|LIKE obj [WITH HEADER LINE].
Here, the LIKE addition refers to an existing table object in the same program. The TYPE addition can refer to an internal type in the program declared using the TYPES statement, or a table type in the ABAP Dictionary.
You must ensure that you only refer to tables that are fully typed. Referring to generic table types (ANY TABLE, INDEX TABLE) or not specifying the key fully is not allowed (for exceptions, refer to Special Features of Standard Tables).
The WITH HEADER LINE addition is obsolete; you should no longer use it. Also see the keyword documentation.
The optional addition WITH HEADER LINE declares an extra data object with the same name and line type as the internal table. This data object is known as the header line of the internal table. You use it as a work area when working with the internal table (see Using the Header Line as a Work Area). When you use internal tables with header lines, you must remember that the header line and the body of the table have the same name. If you have an internal table with header line and you want to address the body of the table, you must indicate this by placing brackets after the table name (itab[]). Otherwise, ABAP interprets the name as the name of the header line and not of the body of the table. You can avoid this potential confusion by using internal tables without header lines. In particular, internal tables nested in structures or other internal tables must not have a header line, since this can lead to ambiguous expressions.
TYPES vector TYPE SORTED TABLE OF i WITH UNIQUE KEY table_line.
DATA: itab TYPE vector,
jtab LIKE itab WITH HEADER LINE.
MOVE itab TO jtab. <- Syntax error!
MOVE itab TO jtab[].
The table object itab is created with reference to the table type vector. The table object jtab has the same data type as itab. jtab also has a header line. In the first MOVE statement, jtab addresses the header line. Since this has the data type I, and the table type of itab cannot be converted into an elementary type, the MOVE statement causes a syntax error. The second MOVE statement is correct, since both operands are table objects.
Declaring New Internal Tables
You can use the DATA statement to construct new internal tables as well as using the LIKE or TYPEaddition to refer to existing types or objects. The table type that you construct does not exist in its own right; instead, it is only an attribute of the table object. You can refer to it using the LIKE addition, but not using TYPE. The syntax for constructing a table object in the DATA statement is similar to that for defining a table type in the TYPESstatement.
DATA itab TYPE|LIKE tabkind OF linetype WITH key
[INITIAL SIZE n]
[WITH HEADER LINE].
As illustrated when you define a table type yourself, the type constructor
tabkind OF linetype WITH key
defines the table type tabkind, the line type linetype, and the key key of the internal table itab. Since the technical attributes of data objects are always fully specified, the table must be fully specified in the DATAstatement. You cannot create generic table types (ANY TABLE, INDEX TABLE), only fully-typed tables (STANDARD TABLE and TABLE, SORTED TABLE, HASHED TABLE). You must also specify the key and whether it is to be unique (for exceptions, refer to Special Features of Standard Tables).
As in the TYPES statement, you can, if you wish, allocate an initial amount of memory to the internal table using the INITIAL SIZEaddition. You can create an internal table with a header line using the WITH HEADER LINE addition. The header line is created under the same conditions as apply when you refer to an existing table type.
DATA itab TYPE HASHED TABLE OF spfli
WITH UNIQUE KEY carrid connid.
The table object itab has the type hashed table, a line type corresponding to the flat structure SPFLI from the ABAP Dictionary, and a unique key with the key fields CARRID and CONNID. The internal table itab can be regarded as an internal template for the database table SPFLI. It is therefore particularly suitable for working with data from this database table as long as you only access it using the key.
Hope this resolves your query.
<b>Reward all the helpful answers.</b>
Regards -
Question on optimum choice of index - whether to use CTXCAT or CONTEXT
Hi ,
I have a situation in which there are short texts that are to be searched for diacritical characters and for that I implemented CTXCAT type of index. The solution works fine except for left side wild card search - in that case I have suggested the developers to use the query template feature. -this is the background information for the question I have and following example demonstrates it:
CREATE TABLE TEST_USER
FIRST_NAME VARCHAR2(64 CHAR) NOT NULL,
LAST_NAME VARCHAR2(64 CHAR) NOT NULL
CREATE INDEX TEST_USER_IDX3 ON TEST_USER
(FIRST_NAME)
INDEXTYPE IS CTXSYS.CTXCAT
PARAMETERS('LEXER cust_lexer');
CREATE INDEX TEST_USER_IDX4 ON TEST_USER
(LAST_NAME)
INDEXTYPE IS CTXSYS.CTXCAT
PARAMETERS('LEXER cust_lexer');
Don't worry about the cust_lexer, it is for diacritical search and it is not relevant to this question so I am not copying the code for the preference I created etc.
Now I have a row of data in the table with first_name column as Supervisor. If I run the below sql, it gives output:
SELECT *
FROM test_user
WHERE catsearch (first_name, 'Supervisor', NULL) > 0;
FIRST_NAME LAST_NAME
Supervisor upervisor
--even the below sql with wild card (*) at the end works fine...
SQL> SELECT *
2 FROM test_user
3 WHERE catsearch (first_name, 'Super*', NULL) > 0;
FIRST_NAME LAST_NAME
Supervisor upervisor
However the below sql queries doesn't give any output, though they should return the same row as above!
SQL> SELECT *
2 FROM test_user
3 WHERE catsearch (first_name, '*visor', NULL) > 0;
no rows selected
SQL> SELECT *
2 FROM test_user
3 WHERE catsearch (first_name, '*vis*', NULL) > 0;
no rows selected
--Using query template as below solves the issue:
select * from test_user
where catsearch(first_name,
'<query>
<textquery grammar="context">
%viso%
</textquery>
</query>','')>0
FIRST_NAME LAST_NAME
Supervisor upervisor
Note that I verified the query execution plan and it uses the index and there is no Full Table Scan:
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | | | 9 (100)| |
| 1 | TABLE ACCESS BY INDEX ROWID| TEST_USER | 376 | 99K| 9 (0)| 00:00:01 |
|* 2 | DOMAIN INDEX | TEST_USER_IDX3 | | | | |
---------------------------------------------------------------------------------------------- Up to the above , all details were by way of the back ground...now the question is - it is this the right choice? I am using context grammer using query template. There is another thread on this forum where an expert (Barbara) said that
". It should be better to use a context index than a ctxcat index with a query template that uses context grammar. " -this was said on this question link: Re: Wildcard Search
So I am getting this doubt. However I have good data here that shows that the query doesn't do full table scan - still is it a bad choice? Note that there are several issues with CONTENT type of indexes( as per my limited understanding) - because they are not transactional in nature and so we have to take extra steps/measures to have the indexes updated which seems like a major pain area to me.
My doubt is , did I do the right thing by using query template or should I use the CONTEXT type of index instead of CTXCAT type of index?
Thanks,
Nirav
Edited by: orausern on Jan 17, 2013 1:40 AM
Edited by: orausern on Jan 17, 2013 1:43 AMI would just like to add a few comments.
Alhough it is documented that the ctxcxat index and catsearch do not support a wildcard in front of the term, a workaround is to use two asterisks on the left side of the term, as demonstrated below. I provide this only for clarification and interesting trivia. I would still use a context index for various reasons.
SCOTT@orcl_11gR2> CREATE TABLE TEST_USER
2 (FIRST_NAME VARCHAR2(64 CHAR))
3 /
Table created.
SCOTT@orcl_11gR2> INSERT INTO test_user VALUES ('Supervisor')
2 /
1 row created.
SCOTT@orcl_11gR2> CREATE INDEX TEST_USER_IDX
2 ON TEST_USER (FIRST_NAME)
3 INDEXTYPE IS CTXSYS.CTXCAT
4 /
Index created.
SCOTT@orcl_11gR2> SET AUTOTRACE ON EXPLAIN
SCOTT@orcl_11gR2> SELECT * FROM test_user
2 WHERE catsearch (first_name, '**vis*', NULL) > 0
3 /
FIRST_NAME
Supervisor
1 row selected.
Execution Plan
Plan hash value: 4046491764
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 142 | 3 (0)| 00:00:01 |
| 1 | TABLE ACCESS BY INDEX ROWID| TEST_USER | 1 | 142 | 3 (0)| 00:00:01 |
|* 2 | DOMAIN INDEX | TEST_USER_IDX | | | | |
Predicate Information (identified by operation id):
2 - access("CTXSYS"."CATSEARCH"("FIRST_NAME",'**vis*',NULL)>0)
Note
- dynamic sampling used for this statement (level=2)
SCOTT@orcl_11gR2>The only time that I am aware of that there is a conflict between a wordlist and a lexer is when you specify stemming in both. If you are using stemming, you can still use both a wordlist and a lexer, but only set the stemmer attribute in the wordlist, not the index_stems attribute in the lexer. -
How to print a Proe .drw ( Vector Graphic ) file to a printer.
I am having a drawing model (proe .drw file). I want to print this file to a .tif file using java.The print driver is "Informatik Image Driver 3.20".
.Can some one help me out with the steps involved in this.
I understand .drw file are of type Vector Graphic. How to print it.
I also have a corresponding postscript file generated from the .drw file. Is there a way to print this post scritp file to the printer mentioned above to create .tif.
Any quick help will be deeply appreciated.
The postscript file content as below
%!PS-Adobe-2.0
%%BoundingBox: 0 0 1190 841
%%Creator: Pro/ENGINEER
%%Title: c:/temp/xx.plt
%%CreateDate: 18-Mar-10 17:29:28
%%DocumentFonts: Times-Roman
%%EndComments
%%EndProlog
%%Page: ? 1
%%BeginPageSetup
systemdict /setpagedevice known
<</PageSize[1190 841]>> setpagedevice
} if
%%EndPageSetup
newpath
%90 rotate 0 -11.6929 72 mul translate
/m {moveto} def
/l {lineto} def
/rm {rmoveto} def
/rl {rlineto} def
/slw {setlinewidth} def
/srgb {setrgbcolor} def
/sd {setdash} def
/gs {gsave} def
/f {fill} def
/gr {grestore} def
/s {stroke} def
/np {newpath} def
0 setlinecap
2 setlinejoin
0 0 0 srgb
72 72 scale
s
[] 0 sd
s
[] 0 sd
s
0.02 slw
1.21121 0.393701 m
1.21121 11.2992 l
1.21121 0.393701 m
15.3242 0.393701 l
15.3242 11.2992 l
1.21121 11.2992 m
15.3242 11.2992 l
8.01388 7.69355 m
5.49708 7.69355 2.5168 0 360 arc
14.2189 7.69355 m
10.8812 7.69355 3.33771 0 360 arc
8.03498 5.85547 m
7.69023 5.85547 0.344747 0 360 arc
11.1515 5.53362 m
7.81378 5.53362 3.33771 0 360 arc
3.33558 4.07796 m
7.52551 5.0152 4.29347 192.609 398.596 arc
7.44242 10.0908 m
4.1278 2.50717 8.2764 66.3911 106.456 arc
s
0 0 0 srgb
0 rotate
showpage
---------------------------------------------I did try google. But could not get a solution. Any idea what is the doc flavor for .drw file.?
Edited by: ekuriakose on Mar 22, 2010 11:47 PM -
How to check the whole values of a set of map exist in the vector of map?
Hi Friends!
I have a set of map; map<int, set<int>>myset;
and a vector of map; map<int,vector<int>>myvec;
myset contains;
1=>11 16 30
3=>2 11
6=>2
7=>9 12 16
8=>9 13 16
myvec contains;
1=>11 15 21
2=>16
3=>11 16
4=>2 13
5=>11 16 30
6=>9 5 10
First, the first value of myset(11 16 30) will be checked with all the values of myvec, if the whole value(11 16 30) available at certain value in the myset, then it gives the key of myvec. So, the output for the first value is 5.
Next, if you consider the value (2 11) in the myset, there are no matching values that contains whole 2 11 in the particular value in myvec. Therefore, what we do is, delete the last value of the current set, that is 11, and now consider 2 as
the value and find the matching value from myvec. That is (2 13) and the key is 4.
Like wise when we find the first possible match, then we print the key of myset immediately, there may be some other possible values available in the values of myset.
I have written two functions that check the particular whole values of the myset matched with a particular values in myvec.
bool IsValueInVec(int value, const IntVec& v2)
IntVec::const_iterator itv=find (v2.begin(), v2.end(), value);
if (itv!=v2.end())
return true;
return false;
bool AreAllValuesInVec(const IntSet& s1, const IntVec& v2)
for(set<int>::const_iterator sit=s1.begin();sit!=s1.end();++sit)
if (!IsValueInVec((*sit), v2))
return false;
return true;
Could anyone help me to solve this?You have neither a set of map nor a vector of map. You have two maps. Each contains keys of type int. The mapped values of one are of type set<int>. The mapped values of the other are of type vector<int>. If
you don't understand the types of the objects you are using, you will never be able to use them properly.
Help you solve what? Do the two functions you wrote perform as desired? If not, provide a complete description of how what they do differs from what you want.
Somewhere in code you have not shown, you need to call AreAllValuesInVec for a particular set and vector. If this function returns false and if the set contains more than one element, you need to delete the last element of the set and try again.
If the set contains only a single element, you need to perform some "failure" processing that you have not described. When the function returns true, you need to print the key of the map element which contains the vector. What are you
having trouble with? -
To access context values in java util methods in webdynpro java
My requirement is to access the wdcontext values in the my util classes.
kindly suggest how to access the context value in my util class
Regards
PriyaThe context reference must be passed to the .java class in order to access same in the .java
for example,
Change MyUtil.java - get the reference to this file.
public class MyUtil {
//make a local variable of context element type.
private IPrivateCompView.IHashContextElement local_context;
//add context type in Constructor
public MyUtil (IPrivateCompView.IHashContextElement local_context, /*rest of params*/){
this.local_context = local_context;
//.... rest of initialization
In Webdynpro, initialize the call by passing the context reference.
IPrivateCompView.IHashContextElement hashmap = wdContext.currentHashContextElement();
//initialize my class
new MyUtil( hashmap, /*rest of params*/);
regards,
Nikhil -
How do we do TypeMapping for Vector, Hashtable, or any java data structure in RPC?
I tried to implement a dynamic Client (RPC) however I got the following Error
when I ran the program.
Exception in thread "main" java.lang.ClassCastException
Here is my part of code
//create service
Service service = factory.createService( serviceName );
TypeMappingRegistry registry = service.getTypeMappingRegistry();
TypeMapping mapping = registry.getTypeMapping(
SOAPConstants.URI_NS_SOAP_ENCODING );
mapping.register( Vector.class,
new QName( targetNamespace, "Vector" ),
new language_builtins.util.VectorCodec(), new language_builtins.util.VectorCodec()
//create call
Call call = service.createCall();
//set port and operation name
call.setPortTypeName( portName );
call.setOperationName( operationName );
call.addParameter( "string",new QName( "http://www.w3.org/2001/XMLSchema","string"
ParameterMode.IN);
call.addParameter( "intVal",new QName( "http://www.w3.org/2001/XMLSchema","int"
ParameterMode.IN);
call.setReturnType( new QName( targetNamespace, "Vector" ) );
Vector v = (Vector) call.invoke(new Object[] {"Hi", new Integer(1) });
Any help on this will be greatly appreciated.
decemberHey December,
I looked at your WSDL, but it doesn't give any hint of what you are putting in
the LinkedList or Vector. All it says is that an "array of anything" (basically,
an array of java.lang.Object) is returned from the buy and sell web service operations.
Surely there is some complexType (i.e. TradeResults, TransactionResults, etc.)
that you want to return here. A java.util.LinkedList object is not a complexType.
It's a generic container object which is specific to the Java programming language.
Same with the java.util.Vector. Web services are programming language independent,
so a .NET client (written in C# or VB code) wouldn't really know how to deal with
a java.util.LinkedList, right? Web services do not transfer objects back and forth,
just XML. This means that the buy web service operation doesn't really return
a java.util.Vector over an HTTP connection. It returns an XML representation of
the "hierarchical state" associated with the complexTypes you put in the Vector,
inside the "service implementation" code on the server side.
What you want to do is use the WSDL "to describe" the data types your web services
accepts and returns. To do this, you'll need to define complexTypes to put in
the array of complex types that is returned. If you leave things as they are,
I don't think you'll ever be able to determine what's in "the Vector". Again,
this is because web services don't transfer objects back and forth, just the state
that is used to instanciate them :-)
HTH,
Mike Wooten
"december_i" <[email protected]> wrote:
>
>
>
Hi Michael Wooten,
When I printed out the Object class name, it returned this "[Ljava.lang.Object;"
So I tried this way again.
Object[] obj = (Object[])call.invoke(new Object[] {"Hi", new Integer(1)});
System.out.println("obj[0].getClass().getName()=" + obj[0].getClass().getName());
At this time, it printed this "java.lang.String".
I guess web services is not returning Vector.
I attached my WSDL file.
I really appreciated your help.
best wishes,
December
"Michael Wooten" <[email protected]> wrote:
If you are still getting a class cast exception, maybe it's becausethe
web service
isn't returning a Vector.
Change the following line in your client code:
Vector v = (Vector) call.invoke(new Object[] {"Hi", new Integer(1)});
to:
Object obj = call.invoke(new Object[] {"Hi", new Integer(1)});
System.out.println("obj.getClass().getName()=" + obj.getClass().getName());
That way you can see what the return type is :-)
You might want to post the WSDL and remote interface of the web service
you are
trying to call also.
Regards,
Mike Wooten
"december_i" <[email protected]> wrote:
Hi Mike Wooten,
Thanks for pointing out my mistake.
However I'm still getting same error. I know i'm gettting this error
because of
return type "Vector". But I don't know what I did wrong.
Does anybody have any sample example about TypeMapping for any datastructures?
Any help on this will be greatly appreciated.
December
"Michael Wooten" <[email protected]> wrote:
Hi December_i,
Your code is saying that the "Vector" type is in the target namespace
for your
web service. I don't think this is correct. Try this:
mapping.register(
java.util.Vector.class,
new QName("java:language_builtins.util", "Vector" ),
new language_builtins.util.VectorCodec(),
new language_builtins.util.VectorCodec()
call.setReturnType( new QName("java:language_builtins.util", "Vector"
HTH,
Mike Wooten
"december_i" <[email protected]> wrote:
I tried to implement a dynamic Client (RPC) however I got the following
Error
when I ran the program.
Exception in thread "main" java.lang.ClassCastException
Here is my part of code
//create service
Service service = factory.createService( serviceName );
TypeMappingRegistry registry = service.getTypeMappingRegistry();
TypeMapping mapping = registry.getTypeMapping(
SOAPConstants.URI_NS_SOAP_ENCODING
mapping.register( Vector.class,
new QName( targetNamespace, "Vector" ),
new language_builtins.util.VectorCodec(), new language_builtins.util.VectorCodec()
//create call
Call call = service.createCall();
//set port and operation name
call.setPortTypeName( portName );
call.setOperationName( operationName );
call.addParameter( "string",new QName( "http://www.w3.org/2001/XMLSchema","string"
ParameterMode.IN);
call.addParameter( "intVal",new QName( "http://www.w3.org/2001/XMLSchema","int"
ParameterMode.IN);
call.setReturnType( new QName( targetNamespace, "Vector" ) );
Vector v = (Vector) call.invoke(new Object[] {"Hi", new Integer(1)
Any help on this will be greatly appreciated.
december -
Hi everybody, I´m working in a mapping excercise where I want to map a data object in my context that has three header fields and one table to a Visual Composer view, I have no problems with the header fields because they are typed as xsd:string, the problem comes with the complex field (table) called Positions, for sure the 'Positions' type is not the same for the VC model and it never be, so my question is how do you make an input mapping from a complex field in the context to a VC,...
As you can see here is my mapping :
If I delete the 'Positions' mapping the build is ok, but when I map the 'Positions' field the build failed with the following message :
Ant build finished with ERRORS
com.sap.glx.paradigmInterface.bpmn.compiler.BPMNCompilerException: Mapping compilation failed!
[ERROR] Incompatible expression type.
Expected:Form.WS_Data_Object.Positions
Found:PositionType
Build stopped due to an error: com.sap.glx.paradigmInterface.bpmn.compiler.BPMNCompilerException: Mapping compilation failed!
[ERROR] Incompatible expression type.
Expected:Form.WS_Data_Object.Positions
Found:PositionType
MOIN forced shutdown initiated.
It says clairly that expect a Form.WS_DATA_Object.Positions (VC) and found a 'PositionType' from my context.
Do I need to cast every mapping !? How do you achieve that both types are the same !?
Any help will be appreciated.I already change my WSDL (start message) to the Visual Composer start node type, and with that change I´m able to map:
start message -> process context -> VC,
all these objects have the VC types, so the question is....
do I really need to create the VC data and then set my wsdl and process context DO with those types !?
I was thinking in create a wsdl in my trigger then store the input values to a DO object of the same type and then mapping only the required displayed fields to the VC... but If I can´t modify the VC types to meet the context types all this is pointless and I need to recreate all my context into the VC isn´t !?
Any comment will be appreciated. !
thanks ! -
I have a problem in my socket program(trying to implement sliding window algorithm). Details are given below:
I have declared a static member variable ServerWindow of type Vector in my socket program. I am adding all the packets receiving from the client
to this vector. But whenever I am trying to add a new packet, it simply overwrites all the records in the vector. So my vector when displayed
has the last packet for all elements. I have checked the received
packet and its contents are OK.
public void receive(DatagramPacket p) throws IOException {
boolean KeepRunning = true;
boolean KeepGoing = true;
ServerWindow = new Vector();
while(KeepRunning){
try{
while (KeepGoing){
if (ServerWindow.size() <= 7){
super.receive(p);
if (isCorrectCRC(p)){
ServerWindow.add(p);
if (ServerWindow.size() == 7){
for (i=0;i<ServerWindow.size();i++){
System.out.println("In receive(): " + i + " " + new String( (byte[])ServerWindow.get(i)));
}catch(SocketTimeoutException e){
} //end of catch
} // end of while
} // end of receive methodI think coz you keep redeclaring serverwindow in your method. Each time it creates a new Vector object.
-
Problems populating complex type structre in bpel
Hi All,
I'm trying to populate with no good results a complexType variable that contains n maxOccurs="unbounded" element.
This is the schema:
<xsd:complexType name="logWarnParam">
<xsd:sequence>
<xsd:element name="Message" type="xsd:string"/>
<xsd:element name="MessageParam" type="xsd:string" maxOccurs="unbounded"/>
<xsd:element name="context" type="ns1:context"/>
</xsd:sequence>
</xsd:complexType>
This is the bpel variable
<variable name="logWarnParamVariable" element="ns3:logWarnParam"/>
and these are the parts of the bpel that applies to this case:
<while name="While1"
condition="bpws:getVariableData('i')<number(5)">
<scope name="Log1" variableAccessSerializable="no">
<sequence name="Sequence1">
<assign name="assign1">
*<bpelx:append>*
*<bpelx:from expression="string('value1')"/>*
*<bpelx:to variable="logWarnParamVariable"*
query="/ns3:logWarnParam/MessageParam"/>
*</bpelx:append>*
<copy>
<from expression="bpws:getVariableData('i')+1"/>
<to variable="contador"/>
</copy>
</assign>
</sequence>
</scope>
</while>
Can anyone help me with the way to populate this structure?
Thanks in advance!The complexType element defines a complex type. A complex type element is an XML element that contains other elements and/or attributes.
Its a place holder to hold different types of element or same set of elements.
In the below example you will get more information.
*<xs:element name="employee" type="fullpersoninfo"/>*
*<xs:complexType name="personinfo">*
<xs:sequence>
<xs:element name="firstname" type="xs:string"/>
<xs:element name="lastname" type="xs:string"/>
</xs:sequence>
</xs:complexType>
*<xs:complexType name="fullpersoninfo">*
<xs:complexContent>
<xs:extension base="personinfo">
<xs:sequence>
<xs:element name="address" type="xs:string"/>
<xs:element name="city" type="xs:string"/>
<xs:element name="country" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
In this example i would like to have more than one employee information. So i have created a complexType as "fullpersoninfo", Then in run time i will populate the values inside "fullpersoninfo"
not the employee or fullpersoninfo variable, rather i will populate the firstname, lastname, address, city and country.
The out put will be having value like the below.
<employee>
<firstname></firstname>
<lastname></lastname>
<address>Duke Street</address>
<city>Liverpool</city>
<country>UK</country>
</employee>
<employee>
<firstname></firstname>
<lastname></lastname>
<address>Duke Street</address>
<city>Liverpool</city>
<country>UK</country>
</employee>
I will populate the elements inside the complex type element not it self.
I took the example from below URL
http://www.w3schools.com/schema/el_complextype.asp
You should modify your assign as below.
<bpelx:append>
<bpelx:from expression="string('value1')"/>
<bpelx:to variable="logWarnParamVariable"
query="*/ns3:logWarnParamVariable/ns3:logWarnParam/ns3:MessageParam*"/>
</bpelx:append>
Let me know how you go !!
Thanks,
Vijay
Maybe you are looking for
-
I hope this makes sense. I have two sets of pdfs containing 100+ individual pages (totalling 200 pages in one folder) Set/series 1: a1,a2,a3 -----> a100 Set/series 2: b1,b2,b3------> b100 I would like to create a button on each page that will open a
-
HOW CAN I PUT E MAIL DIRECTIONS IN THE ADDRESS BOOK
I don't know how to fill the address book with the e-mail directions, how can i put'em in?
-
How to dowmload free games without using credit card info ?
How do I download free games without having to enter credit card info??
-
How do I set cache to always reload a page?
I am in an online class and need to set cache to always reload a page. I do not even know what a cache is. I have just downloaded Firefox 18.
-
Session expiry on 2 applications
Hello I have 2 applications running on weblogic 7.0 on two managed servers , When I try to access the applications from 2 browser sessions I am getting an issue where the user session is lost from the other application, If I open the second window us