Using bucket search and lookup tables
I have to create an array of dates, and then extend this by creating a lookup table for the months of the dates. So this lookup table will have 12 elements. Finally it should print to the screen the total amount of times a month appears in the object array. I have created my array and i am only working on getting the bucket search working at the moment. In the code you will see the problem i am having on lines 45 and 46. The assigning is of different types so it wont allow it. I was thinking about using a toString method to get this working but then would the lookup tables be able to look up the months still? Also where abouts in the code would i put the toString method? Can i actually do it when declaring the arrays e.g. a[0]=new Date.toSting( (2, "January", 2007) );
Anyway, heres what i have:
import javax.swing.*;
public class Date
public int Day;
public int Year;
public String Month;
public Date(int day, String month, int year){
Day = day;
Year = year;
Month = month;
public static void main(String[] args)
final int ARRAY_SIZE = 10;
final int RANGE = 30;
Date[] a = new Date[ARRAY_SIZE];
a[0]=new Date (2, "January", 2007);
a[1]=new Date (21, "Feburary", 2007);
a[2]=new Date (31, "December", 2007);
a[3]=new Date (29, "Demember", 2007);
a[4]=new Date (8, "April", 2007);
a[5]=new Date (15, "January", 2007);
a[6]=new Date (12, "Feburary", 2007);
a[7]=new Date (30, "August", 2007);
a[8]=new Date (4, "June", 2007);
a[9]=new Date (19, "June", 2007);
boolean result;
String searchKey;
boolean[] bucket = new boolean[RANGE];
for (int i = 0; i < RANGE; i++)
bucket[i] = false;
for (int j = 0; j < ARRAY_SIZE; j++)
String data;
data = a[j]; //???????????????
bucket[data] = true;
searchKey = JOptionPane.showInputDialog("Give me a date");;
result = bucketSearch(bucket, searchKey);
if (result == true)
JOptionPane.showMessageDialog(null,"KEY " + searchKey + " FOUND");
else
JOptionPane.showMessageDialog(null,"KEY " + searchKey + " NOT FOUND");
System.exit(0);
public static boolean bucketSearch (boolean[] bucket, int key)
return bucket[key];
}ps.. i know i need to sort out my searchkey but i will do this after i sort out this problem.
Cheers
The bucket search is actually another question, but i also went to search the net for it and couldnt find anything on bucket search. This is what they are calling a bucket search:
Write a fragment of Java code that does a lookup table search. It asks the user of the program to input a
key to search for and then searches for it in a previously pre-computed lookup table, called bucket that
stores true to mean the data was in the original array and false to mean it was not. It prints a message
indicating whether the data was in the original array or not.
key = Integer.parseInt(JOptionPane.showInputDialog
("Give me a number to search for"));
if (bucket[key] == true)
System.out.print("Data found");
else
System.out.print("Data is not present");
Similar Messages
-
Import of Main and Lookup table in a single Map
Hey Guys,
I am developing a Proof of Concept to Import Main and Lookup-Flat in a single Import Map (by using a single excel file).
Below is my Table structure:
Main Table: Customer
--->Customer_Number (Text,Unique Field, Display Field)
--->Sales_Area (Lookup Flat)
Lookup Table: Sales_Area
Sales_Area_ID (Text,Unique Field,Display Field)
Sales_Area_Desc (Text,Display Field).
The import File (excel) has below attributes:
Customer_Number,Sales_Area_ID,Sales_Area_Desc.
When i start both Main Table and Lookup tables are empty (there is no data in Data Manager for either of the tables)
Now in the Import Map, i selected source as the excel file and target as the Main table.
I did mapping of Customer_Number as usual after that I created a compound field for Sales_Area_ID+ Sales_Area_Desc and did the mapping of this compound field. then did the mapping for Sales_Area_ID and Sales_Area_Desc.
Now since there is no data in lookup table, i select the "Add" button in the "Value Mapping" section. when i execute this map, it works perfectly and data is loaded in both the Main table and lookup table but if a new value comes in the excel(a value which does not yet exist in lookup table), the map fails, when i open it , it says that i need to redo the Value Mapping, again i click on "Add" button and it starts working. So basically the Import Map fails whenever i get a value in excel which does not yet exist in Lookup table.
Now my question is, is there a way to automate my import map, i thought clicking on "Add" button will take care of all the lookup values which are not already present.
Can anyone please help me in this regard.
Thanks
SaifHi Saif,
You can try the following option.
Right click on the lookup filed/compound filed in destination fields, and select the option 'SET MDIS Unmapped Value Handling' as 'ADD'.
Cheers,
Cherry. -
Creating a single context index on a one-to-many and lookup table
Hello,
I've been successfully setting up text indexes on multiple columns on the same table (using MULTI_COLUMN_DATASTORE preferences), but now I have a situation with a one-to-many data collection table (with a FK to a lookup table), and I need to search columns across both of these tables. Sample code below, more of my chattering after the code block:
CREATE TABLE SUBMISSION
( SUBMISSION_ID NUMBER(10) NOT NULL,
SUBMISSION_NAME VARCHAR2(100) NOT NULL
CREATE TABLE ADVISOR_TYPE
( ADVISOR_TYPE_ID NUMBER(10) NOT NULL,
ADVISOR_TYPE_NAME VARCHAR2(50) NOT NULL
CREATE TABLE SUBMISSION_ADVISORS
( SUBMISSION_ADVISORS_ID NUMBER(10) NOT NULL,
SUBMISSION_ID NUMBER(10) NOT NULL,
ADVISOR_TYPE_ID NUMBER(10) NOT NULL,
FIRST_NAME VARCHAR(50) NULL,
LAST_NAME VARCHAR(50) NULL,
SUFFIX VARCHAR(20) NULL
INSERT INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME) VALUES (1, 'Some Research Paper');
INSERT INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME) VALUES (2, 'Thesis on 17th Century Weather Patterns');
INSERT INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME) VALUES (3, 'Statistical Analysis on Sunny Days in March');
INSERT INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME) VALUES (1, 'Department Chair');
INSERT INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME) VALUES (2, 'Department Co-Chair');
INSERT INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME) VALUES (3, 'Professor');
INSERT INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME) VALUES (4, 'Associate Professor');
INSERT INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME) VALUES (5, 'Scientist');
INSERT INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX) VALUES (1,1,2,'John', 'Doe', 'PhD');
INSERT INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX) VALUES (2,1,2,'Jane', 'Doe', 'PhD');
INSERT INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX) VALUES (3,2,3,'Johan', 'Smith', NULL);
INSERT INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX) VALUES (4,2,4,'Magnus', 'Jackson', 'MS');
INSERT INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX) VALUES (5,3,5,'Williard', 'Forsberg', 'AMS');
COMMIT;I want to be able to create a text index to lump these fields together:
SUBMISSION_ADVISORS.FIRST_NAME
SUBMISSION_ADVISORS.LAST_NAME
SUBMISSION_ADVISORS.SUFFIX
ADVISOR_TYPE.ADVISOR_TYPE_NAME
I've looked at DETAIL_DATASTORE and USER_DATASTORE, but the examples in Oracle Docs for DETAIL_DATASTORE leave me a little bit perplexed. It seems like this should be pretty straightforward.
Ideally, I'm trying to avoid creating new columns, and keeping the trigger adjustments to a minimum. But I'm open to any and all suggestions. Thanks for for your time and thoughts.
-JamieI would create a procedure that creates a virtual document with tags, which is what the multi_column_datatstore does behind the scenes. Then I would use that procedure in a user_datastore, so the result is the same for multiple tables as what a multi_column_datastore does for one table. I would also use either auto_section_group or some other type of section group, so that you can search using WITHIN as with the multi_column_datastore. Please see the demonstration below.
SCOTT@orcl_11gR2> -- tables and data that you provided:
SCOTT@orcl_11gR2> CREATE TABLE SUBMISSION
2 ( SUBMISSION_ID NUMBER(10) NOT NULL,
3 SUBMISSION_NAME VARCHAR2(100) NOT NULL
4 )
5 /
Table created.
SCOTT@orcl_11gR2> CREATE TABLE ADVISOR_TYPE
2 ( ADVISOR_TYPE_ID NUMBER(10) NOT NULL,
3 ADVISOR_TYPE_NAME VARCHAR2(50) NOT NULL
4 )
5 /
Table created.
SCOTT@orcl_11gR2> CREATE TABLE SUBMISSION_ADVISORS
2 ( SUBMISSION_ADVISORS_ID NUMBER(10) NOT NULL,
3 SUBMISSION_ID NUMBER(10) NOT NULL,
4 ADVISOR_TYPE_ID NUMBER(10) NOT NULL,
5 FIRST_NAME VARCHAR(50) NULL,
6 LAST_NAME VARCHAR(50) NULL,
7 SUFFIX VARCHAR(20) NULL
8 )
9 /
Table created.
SCOTT@orcl_11gR2> INSERT ALL
2 INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME)
3 VALUES (1, 'Some Research Paper')
4 INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME)
5 VALUES (2, 'Thesis on 17th Century Weather Patterns')
6 INTO SUBMISSION (SUBMISSION_ID, SUBMISSION_NAME)
7 VALUES (3, 'Statistical Analysis on Sunny Days in March')
8 SELECT * FROM DUAL
9 /
3 rows created.
SCOTT@orcl_11gR2> INSERT ALL
2 INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME)
3 VALUES (1, 'Department Chair')
4 INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME)
5 VALUES (2, 'Department Co-Chair')
6 INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME)
7 VALUES (3, 'Professor')
8 INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME)
9 VALUES (4, 'Associate Professor')
10 INTO ADVISOR_TYPE (ADVISOR_TYPE_ID, ADVISOR_TYPE_NAME)
11 VALUES (5, 'Scientist')
12 SELECT * FROM DUAL
13 /
5 rows created.
SCOTT@orcl_11gR2> INSERT ALL
2 INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX)
3 VALUES (1,1,2,'John', 'Doe', 'PhD')
4 INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX)
5 VALUES (2,1,2,'Jane', 'Doe', 'PhD')
6 INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX)
7 VALUES (3,2,3,'Johan', 'Smith', NULL)
8 INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX)
9 VALUES (4,2,4,'Magnus', 'Jackson', 'MS')
10 INTO SUBMISSION_ADVISORS (SUBMISSION_ADVISORS_ID, SUBMISSION_ID, ADVISOR_TYPE_ID, FIRST_NAME, LAST_NAME, SUFFIX)
11 VALUES (5,3,5,'Williard', 'Forsberg', 'AMS')
12 SELECT * FROM DUAL
13 /
5 rows created.
SCOTT@orcl_11gR2> -- constraints presumed based on your description:
SCOTT@orcl_11gR2> ALTER TABLE submission ADD CONSTRAINT submission_id_pk
2 PRIMARY KEY (submission_id)
3 /
Table altered.
SCOTT@orcl_11gR2> ALTER TABLE advisor_type ADD CONSTRAINT advisor_type_id_pk
2 PRIMARY KEY (advisor_type_id)
3 /
Table altered.
SCOTT@orcl_11gR2> ALTER TABLE submission_advisors ADD CONSTRAINT submission_advisors_id_pk
2 PRIMARY KEY (submission_advisors_id)
3 /
Table altered.
SCOTT@orcl_11gR2> ALTER TABLE submission_advisors ADD CONSTRAINT submission_id_fk
2 FOREIGN KEY (submission_id) REFERENCES submission (submission_id)
3 /
Table altered.
SCOTT@orcl_11gR2> ALTER TABLE submission_advisors ADD CONSTRAINT advisor_type_id_fk
2 FOREIGN KEY (advisor_type_id) REFERENCES advisor_type (advisor_type_id)
3 /
Table altered.
SCOTT@orcl_11gR2> -- resulting data:
SCOTT@orcl_11gR2> COLUMN submission_name FORMAT A45
SCOTT@orcl_11gR2> COLUMN advisor FORMAT A40
SCOTT@orcl_11gR2> SELECT s.submission_name,
2 a.advisor_type_name || ' ' ||
3 sa.first_name || ' ' ||
4 sa.last_name || ' ' ||
5 sa.suffix AS advisor
6 FROM submission_advisors sa,
7 submission s,
8 advisor_type a
9 WHERE sa.advisor_type_id = a.advisor_type_id
10 AND sa.submission_id = s.submission_id
11 /
SUBMISSION_NAME ADVISOR
Some Research Paper Department Co-Chair John Doe PhD
Some Research Paper Department Co-Chair Jane Doe PhD
Thesis on 17th Century Weather Patterns Professor Johan Smith
Thesis on 17th Century Weather Patterns Associate Professor Magnus Jackson MS
Statistical Analysis on Sunny Days in March Scientist Williard Forsberg AMS
5 rows selected.
SCOTT@orcl_11gR2> -- procedure to create virtual documents:
SCOTT@orcl_11gR2> CREATE OR REPLACE PROCEDURE submission_advisors_proc
2 (p_rowid IN ROWID,
3 p_clob IN OUT NOCOPY CLOB)
4 AS
5 BEGIN
6 FOR r1 IN
7 (SELECT *
8 FROM submission_advisors
9 WHERE ROWID = p_rowid)
10 LOOP
11 IF r1.first_name IS NOT NULL THEN
12 DBMS_LOB.WRITEAPPEND (p_clob, 12, '<first_name>');
13 DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r1.first_name), r1.first_name);
14 DBMS_LOB.WRITEAPPEND (p_clob, 13, '</first_name>');
15 END IF;
16 IF r1.last_name IS NOT NULL THEN
17 DBMS_LOB.WRITEAPPEND (p_clob, 11, '<last_name>');
18 DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r1.last_name), r1.last_name);
19 DBMS_LOB.WRITEAPPEND (p_clob, 12, '</last_name>');
20 END IF;
21 IF r1.suffix IS NOT NULL THEN
22 DBMS_LOB.WRITEAPPEND (p_clob, 8, '<suffix>');
23 DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r1.suffix), r1.suffix);
24 DBMS_LOB.WRITEAPPEND (p_clob, 9, '</suffix>');
25 END IF;
26 FOR r2 IN
27 (SELECT *
28 FROM submission
29 WHERE submission_id = r1.submission_id)
30 LOOP
31 DBMS_LOB.WRITEAPPEND (p_clob, 17, '<submission_name>');
32 DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r2.submission_name), r2.submission_name);
33 DBMS_LOB.WRITEAPPEND (p_clob, 18, '</submission_name>');
34 END LOOP;
35 FOR r3 IN
36 (SELECT *
37 FROM advisor_type
38 WHERE advisor_type_id = r1.advisor_type_id)
39 LOOP
40 DBMS_LOB.WRITEAPPEND (p_clob, 19, '<advisor_type_name>');
41 DBMS_LOB.WRITEAPPEND (p_clob, LENGTH (r3.advisor_type_name), r3.advisor_type_name);
42 DBMS_LOB.WRITEAPPEND (p_clob, 20, '</advisor_type_name>');
43 END LOOP;
44 END LOOP;
45 END submission_advisors_proc;
46 /
Procedure created.
SCOTT@orcl_11gR2> SHOW ERRORS
No errors.
SCOTT@orcl_11gR2> -- examples of virtual documents that procedure creates:
SCOTT@orcl_11gR2> DECLARE
2 v_clob CLOB := EMPTY_CLOB();
3 BEGIN
4 FOR r IN
5 (SELECT ROWID rid FROM submission_advisors)
6 LOOP
7 DBMS_LOB.CREATETEMPORARY (v_clob, TRUE);
8 submission_advisors_proc (r.rid, v_clob);
9 DBMS_OUTPUT.PUT_LINE (v_clob);
10 DBMS_LOB.FREETEMPORARY (v_clob);
11 END LOOP;
12 END;
13 /
<first_name>John</first_name><last_name>Doe</last_name><suffix>PhD</suffix><submission_name>Some
Research Paper</submission_name><advisor_type_name>Department Co-Chair</advisor_type_name>
<first_name>Jane</first_name><last_name>Doe</last_name><suffix>PhD</suffix><submission_name>Some
Research Paper</submission_name><advisor_type_name>Department Co-Chair</advisor_type_name>
<first_name>Johan</first_name><last_name>Smith</last_name><submission_name>Thesis on 17th Century
Weather Patterns</submission_name><advisor_type_name>Professor</advisor_type_name>
<first_name>Magnus</first_name><last_name>Jackson</last_name><suffix>MS</suffix><submission_name>The
sis on 17th Century Weather Patterns</submission_name><advisor_type_name>Associate
Professor</advisor_type_name>
<first_name>Williard</first_name><last_name>Forsberg</last_name><suffix>AMS</suffix><submission_name
Statistical Analysis on Sunny Days inMarch</submission_name><advisor_type_name>Scientist</advisor_type_name>
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> -- user_datastore that uses procedure:
SCOTT@orcl_11gR2> BEGIN
2 CTX_DDL.CREATE_PREFERENCE ('sa_datastore', 'USER_DATASTORE');
3 CTX_DDL.SET_ATTRIBUTE ('sa_datastore', 'PROCEDURE', 'submission_advisors_proc');
4 END;
5 /
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> -- index (on optional extra column) that uses user_datastore and section group:
SCOTT@orcl_11gR2> ALTER TABLE submission_advisors ADD (any_column VARCHAR2(1))
2 /
Table altered.
SCOTT@orcl_11gR2> CREATE INDEX submission_advisors_idx
2 ON submission_advisors (any_column)
3 INDEXTYPE IS CTXSYS.CONTEXT
4 PARAMETERS
5 ('DATASTORE sa_datastore
6 SECTION GROUP CTXSYS.AUTO_SECTION_GROUP')
7 /
Index created.
SCOTT@orcl_11gR2> -- what is tokenized, indexed, and searchable:
SCOTT@orcl_11gR2> SELECT token_text FROM dr$submission_advisors_idx$i
2 /
TOKEN_TEXT
17TH
ADVISOR_TYPE_NAME
AMS
ANALYSIS
ASSOCIATE
CENTURY
CHAIR
CO
DAYS
DEPARTMENT
DOE
FIRST_NAME
FORSBERG
JACKSON
JANE
JOHAN
JOHN
LAST_NAME
MAGNUS
MARCH
PAPER
PATTERNS
PHD
PROFESSOR
RESEARCH
SCIENTIST
SMITH
STATISTICAL
SUBMISSION_NAME
SUFFIX
SUNNY
THESIS
WEATHER
WILLIARD
34 rows selected.
SCOTT@orcl_11gR2> -- sample searches across all data:
SCOTT@orcl_11gR2> VARIABLE search_string VARCHAR2(100)
SCOTT@orcl_11gR2> EXEC :search_string := 'professor'
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> SELECT s.submission_name,
2 a.advisor_type_name || ' ' ||
3 sa.first_name || ' ' ||
4 sa.last_name || ' ' ||
5 sa.suffix AS advisor
6 FROM submission_advisors sa,
7 submission s,
8 advisor_type a
9 WHERE CONTAINS (sa.any_column, :search_string) > 0
10 AND sa.advisor_type_id = a.advisor_type_id
11 AND sa.submission_id = s.submission_id
12 /
SUBMISSION_NAME ADVISOR
Thesis on 17th Century Weather Patterns Professor Johan Smith
Thesis on 17th Century Weather Patterns Associate Professor Magnus Jackson MS
2 rows selected.
SCOTT@orcl_11gR2> EXEC :search_string := 'doe'
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> /
SUBMISSION_NAME ADVISOR
Some Research Paper Department Co-Chair John Doe PhD
Some Research Paper Department Co-Chair Jane Doe PhD
2 rows selected.
SCOTT@orcl_11gR2> EXEC :search_string := 'paper'
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> /
SUBMISSION_NAME ADVISOR
Some Research Paper Department Co-Chair John Doe PhD
Some Research Paper Department Co-Chair Jane Doe PhD
2 rows selected.
SCOTT@orcl_11gR2> -- sample searches within specific columns:
SCOTT@orcl_11gR2> EXEC :search_string := 'chair'
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> SELECT s.submission_name,
2 a.advisor_type_name || ' ' ||
3 sa.first_name || ' ' ||
4 sa.last_name || ' ' ||
5 sa.suffix AS advisor
6 FROM submission_advisors sa,
7 submission s,
8 advisor_type a
9 WHERE CONTAINS (sa.any_column, :search_string || ' WITHIN advisor_type_name') > 0
10 AND sa.advisor_type_id = a.advisor_type_id
11 AND sa.submission_id = s.submission_id
12 /
SUBMISSION_NAME ADVISOR
Some Research Paper Department Co-Chair John Doe PhD
Some Research Paper Department Co-Chair Jane Doe PhD
2 rows selected.
SCOTT@orcl_11gR2> EXEC :search_string := 'phd'
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> SELECT s.submission_name,
2 a.advisor_type_name || ' ' ||
3 sa.first_name || ' ' ||
4 sa.last_name || ' ' ||
5 sa.suffix AS advisor
6 FROM submission_advisors sa,
7 submission s,
8 advisor_type a
9 WHERE CONTAINS (sa.any_column, :search_string || ' WITHIN suffix') > 0
10 AND sa.advisor_type_id = a.advisor_type_id
11 AND sa.submission_id = s.submission_id
12 /
SUBMISSION_NAME ADVISOR
Some Research Paper Department Co-Chair John Doe PhD
Some Research Paper Department Co-Chair Jane Doe PhD
2 rows selected.
SCOTT@orcl_11gR2> EXEC :search_string := 'weather'
PL/SQL procedure successfully completed.
SCOTT@orcl_11gR2> SELECT s.submission_name,
2 a.advisor_type_name || ' ' ||
3 sa.first_name || ' ' ||
4 sa.last_name || ' ' ||
5 sa.suffix AS advisor
6 FROM submission_advisors sa,
7 submission s,
8 advisor_type a
9 WHERE CONTAINS (sa.any_column, :search_string || ' WITHIN submission_name') > 0
10 AND sa.advisor_type_id = a.advisor_type_id
11 AND sa.submission_id = s.submission_id
12 /
SUBMISSION_NAME ADVISOR
Thesis on 17th Century Weather Patterns Professor Johan Smith
Thesis on 17th Century Weather Patterns Associate Professor Magnus Jackson MS
2 rows selected. -
Hi,
How to use the 'Tab' key to open a lookup table, E.g. BP Code, Name?
Alternatively, how to use the 'Tab' key to call a formatted search? I hope to follow the standard in SBO and do away the Shift-F2.
I am using VB and 2004B. Your input will be appreciated.I think you can mimic every user action with UIAPI.
Therefore, e.g. in Sales Order Form you activate the BPCode item (.Click) and hit Tab (.SendKeys(vbTab)).
You could also try clicking the the iconitem ("67") next to BPCode.
If you want to assign a Choose From List (CFL) to an item of your choice using UIAPI then you should wait for 2005.
Shift-F2 is standard in SBO UI for launching FSs, why would you like to disable it?
If you want to enable tabbing to kick-off an existing FS, then you should capture the tabbing event (et_KEY_DOWN) in your item and then use SendKeys for sending Shift-F2 to keyboard.
HTH
Juha -
Hi,
I think the title says it all, but I've used a script to export a project from an NLE as a html file with a bunch of images and timecodes within table cells. For example, In=00:00:34 and Out=00:01:30 needs to be converted In=0:34 and Out=1:30. I think the Search and Replace is the most simple way of working that, but I've not experience with Regular Expressions (or much in that regard) so would really appreciate if someone could give me a hand writing the Regular Expression I need to achieve this.
Thanks in advance,
JamesOkay, so an example row is:
<tr>
<td align="left" valign="top"><p align="left"><img src="Snapshot At Event Start [00-01-22-19].jpg"><br>
<strong>In: </strong>1:22<br>
<br>
</p></td>
<td align="left" valign="top"><p align="left"><img src="Snapshot At Event End [00-01-24-25].jpg"><br>
<strong>Out: </strong>1:24<br>
</p></td>
<td width="100%" align="left" valign="top"><p><strong>Cut to League Video</strong></p>
<p><strong>Duration</strong>: 2<br>
<strong></strong></p></td>
</tr>
I need to change it to:
<tr>
<td align="left" valign="top"><p align="left"><img src="Snapshot At Event Start [00-01-22-19].jpg"><br>
<strong>In: </strong>1:22 seconds<br>
<br>
</p></td>
<td align="left" valign="top"><p align="left"><img src="Snapshot At Event End [00-01-24-25].jpg"><br>
<strong>Out: </strong>1:24 seconds<br>
</p></td>
<td width="100%" align="left" valign="top"><p><strong>Cut to League Video</strong></p>
<p><strong>Duration:</strong> 2 seconds<br>
<strong></strong></p></td>
</tr>
The script itself is something I found somewhere on the internet - it's for Sony Vegas.
I've highlighted the changes with bold underlined italics.
Thanks for you help, guys,
James -
Create key mapping using import manager for lookup table FROM EXCEL file
hello,
i would like create key mapping while importing the values via excel file.
the source file containing the key, but how do i map it to the lookup table?
the properties of the table has enable the creation of mapping key. but during the mapping in import manager, i cant find any way to map the key mapping..
eg
lookup table contains:
Material Group
Code
excel file contain
MatGroup1 Code System
Thanks!
ShantiHi Shanti,
Assuming you have already defined below listed points
1) Key Mapping "Yes" to your lookup table in MDM Console
2) Created a New Remote System in MDM console
3) proper rights for your account for updating the remote key values in to data manager through import manager.
Your sample file can have Material Group and Code alone which can be exported from Data Manager by File-> Export To -> Excel, if you have data already in Data Manager.
Open your sample file through Import Manager by selecting the remote system for which you want to import the Key mapping.
(Do Not select MDM as Remote System, which do not allows you to maintain key mapping values) and also the file type as Excel
Now select your Soruce and Destination tables, under the destination fields you will be seeing a new field called [Remote Key]
Map you source and destination fields correspondingly and Clone your source field code by right clicking on code in the source hierarchy and map it to Remote Key if you want the code to be in the remote key values.
And in the matching criteria select destination field code as a Matching field and change the default import action to Update NULL fields or UPDATED MAPPED FIELDS as required,
After sucessfull import you can check the Remote Key values in Data Manager.
Hope this helps
Thanks
Sowseel -
Use of T168F and T168 Tables in System
Hi everybody
I'm making a development, the purpose is to assign the Release Strategy to RFQ's when the user sets the Unit Prices for Items in transactión ME47.
This action is executed in SAPMM06E in Routine strategie_ermitteln calling FM ME_REL_STRATEGIE_EKKO, but before the call there is a check at routine begin: t160-vorga NE vorga-angb (vorga-angb is a constant 'AG').
t160-vorga has the 'A' value for ME41 (creating RFQ), then in this transaction the Strategy is assigned.
But in ME47, t160-vorga has the 'AG' value, then the FM is not called.
I solved this making t160-vorga = 'A' (only in memory) in EXIT_SAPMM06E_017, and the Release Strategy is assigned ok.
But, when the user modificates a price using a button, the program makes a validation in Routine FCODE, checking that the value of t160-vorga exists in T168F and T168 tables with field fcode = 'KO'. Because i modified the value from AG to A, this record does not exist and the program set an error. But, if i don't modify the t160-vorga, the Release is not assigned because the check in Routine strategie_ermitteln.
So , i'm thinking in change my development, calling myself the FM ME_REL_STRATEGIE_EKKO in EXIT_SAPMM06E_012 when action Save, but i dont' like this solution because i would need to copy not only the FM call, but else all the code involved in fill the parameters.
So, i think other solution is to create the record for vorga = 'A', fcode = 'KO' in T168F and T168 tables.
If somebody can helpe, my doubts are:
1. what implicates this record creation in these tables T168/T168F, that is, wich is the usage of these tables in the system ??
2. Where can i see the meaning of t168-vorga values (AG, A, K, F etc.) ??
3. In wich transaction can i create records to these tables ??
4. Could be any problem if i add that records to these tables ??
Any help will be apreciated !!
(Excuse the long Topic text)
Thanks
FrankHi Frank,
2. Look the table T167T (to find this, I was going into the SE11, Data element: VORGA, : table, ...)
3. The table T167T could be updated with the SM30/SM31 transaction. But you have a warning message.
4. See the message, in the previous answer
Rgd
Frédéric -
Oracle portal text search and bespoke table
We have the oracle portal text searching working okay.
We also have a bespoke table that users are uploading word documents into a blob column.
Is it possible to get oracle portal text searching to search this bespoke table as well. Maybe by creating an index that points at this table or
when a document is uploaded an api call that registers the document in oracle text searching??????The oracle Portal text is created for content that can directly be mapped to items, folders etc on portal. The BLOB column you want to indexed has not been mapped to content uploaded in portal.
You might want to explore crawling using the Ultrasearch table datasource for the same -
Use of ORCHPROCESS and ORCHEVENTS table in OIM
Hi,
Can anyone help me in understanding what for ORCHPROCESS and ORCHEVENTS tables are used?
What data will be stored in these tables? Pleaes explain me in detail.
Thanks,
Saravanan
Edited by: Saravanan on Mar 16, 2012 3:18 PMHi Saravanan,
These tables are:
ORCHPROCESS: stores the process instances that are being executed
ORCHEVENTS: Event Handlers those are either executed or pending in the current anticipated flow.
Also, depending on the volume and business propose of your environment it could grow too fast. If so,
You have an option to use archival utility as described here:
http://www.art2dec.com/documentation/docs/fmw11g1115documentation/doc.1111/e14308/archival_utilities.htm
Ref:
Oracle® Fusion Middleware System Administrator's Guide for Oracle Identity Manager
11g Release 1 (11.1.1)
Part Number E14308-05
I hope this helps,
Thiago Leoncio -
Content Search web part - Display Project Enterprise Custom Fields and Lookup Tables
My ultimate goal is to display a rollup table of our active projects (from PWA) on another site collection using the content search web part. I can return default properties (such as the project name, author and URL) fairly easily using the same basic steps
in the link below.
http://en.share-gate.com/blog/roll-up-sharepoint-2013-sites-using-search
My problem is that I want to also display information associated with each project from our PWA enterprise custom fields (such as risk, phase, etc.)
Because these custom fields do not appear to be site columns, I'm at a bit of a loss as to how this data is searched / indexed / mapped.
Is it possible to display PWA enterprise custom fields in a content search web part?Hi Jennifer,
According to your description, my understanding is that you want to display PWA enterprise custom fields in a Content Search web part in SharePoint 2013.
As your active projects were from different site collection with the Content Search web part, you need to do a crawl for the content source, then create a managed property for the column in CA->Search Service Application->Search Schema. When you create
the managed property, select Searchable, Queryable, Retrievable. Then map it to the crawled property based on the custom column. You can find the crawled property by searching the name of the column in crawled properties.
More information, please refer to the link:
http://technet.microsoft.com/en-us/library/jj219667(v=office.15).aspx
I hope this helps.
Thanks,
Wendy
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Wendy Li
TechNet Community Support -
How to make reference wbs custom data carried to new wbs when using custom tab and custom table
I created a custom tab for WBS elements by using user exit CNEX0007 and custom screen and put a table control in it.
As table control's data has to be stored in a table I could not use append structure of PRPS.
When I used reference wbs, PRPS custom fields were carried also but I could not find any solution to fill table control data with reference table.
I need to get correspondence between reference number's and new id's key data. Is there any exit, enh. that I can store the relationship.Solved...
I've used an enhancement point in include LCNPB_MF38. CJWB_SUBTREE_COPY exports a table called newnumbers. Here you can find correspondances between copied WBS and new WBS.
Exported table to memory id.
And imported it in another user-exit. You can use proper user exit for your need. ( EXIT_SAPLCNAU_002) -
Query hangs using db link and nested table collection
Hi,
I have a stored procedure which takes, as input, a string of values that can vary in length. The input is used as an IN operator within the queries that exist within the proc:
Code:
PROCEDURE get_contacts (i_customerids IN VARCHAR2)
an example of the input would be: '987451',412897' or '7541256','75412','95412589'
In order to process the dynamic "In-List", I created a custom collection type to convert the string to a table:
Code:
CREATE OR REPLACE
TYPE stringtotable AS TABLE OF VARCHAR2(3900)
(I've also tried the solutions on http://tkyte.blogspot.com/2006/06/varying-in-lists.html and http://fdegrelle.over-blog.com/article-1694534-6.html for handling dynamic in-lists and they also hang)
The proc contains 2 queries, the first returns records from a table within the current database:
Code:
SELECT *
FROM contacts
WHERE customer_id IN (
SELECT *
FROM TABLE (stringtotable (i_customerids
The second query returns records from a database that is defined via a db link:
Code:
SELECT b.customer_id, a.row_id, a.fst_name, a.last_name
FROM userlist.customers@uldblink a, userlist.firms@ulbdlink b
WHERE a.parent_id = b.row_id
AND b.customer_id IN (
SELECT *
FROM TABLE (stringtotable (i_customerids
The first query is executing without issue. The second query, however, is hanging indefinitely. Additionally, If I hard code the string in the IN operator, the second query executes without issue.
I am not the DBA for the database, so I don't currently have access to the trace logs. I've requested access to the trace logs to see if I can figure out what is hanging.
In the meantime, I was hoping someone would be able to tell me if
a: there is a better way to handle "dynamic in- lists".
or
b: if there is something obvious that I'm not considering.
Thanks for your help,
Fielding
Message was edited by:
fwilsonHi Todd,
Thanks for the suggestion. I was not aware of the cardinality hint.
I tried adding it to my query but unfortunately the query still appeared to hang. It did get me thinking though... that maybe the stringtotable collection type is creating the table in memory, and therefore its records aren't accessible to the dblink
so I inserted the values that were being returned via the stringtotable collection type into a physical table named TestTable. I then modified my query to select the values from TestTable.
Code:
...in (select /*+ cardinality(t 3) */ t.*
from testtable t)
This worked.
So that poses the questions-
a: is my assumption about the in-memory table correct
and
b: if so is there a way around it?
Thanks for your help -
Using Logical Databases and the Tables or Nodes Statement
I want to start using Logical Databases whenever possible, but it seems that I need to use the Tables or Nodes statement for the Get statement to work. Is there anyway to avoid Tables/Nodes statement since they are obsolete (and still use LDBs)?
Message was edited by: Jason DeLucaHi Jason,
1) table statement is obligatory:
-> look at abap-docu to GET:
node is a node in the logical database that is assigned to the report (type 1 program) in the program attributes. <b>You must declare the node in the report using the NODES statement (or the TABLES statement, if the node is of the type "table").</b>
2) some ldb-selections from the selection screen
depends on the table-statement too, i remember...
regards Andreas -
How to query table/comment information and lookup table names from PKs?
I am trying to figure out whether I can query the Oracle meta-data to look for:
a) comments on tables and fields matching a certain text pattern. If possible I would LIKE the text pattern matching not to be case-sensitive. Am I looking within the right meta tables?
SQL> desc all_col_comments
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
TABLE_NAME NOT NULL VARCHAR2(30)
COLUMN_NAME NOT NULL VARCHAR2(30)
COMMENTS VARCHAR2(4000)
SQL> desc user_tab_comments
Name Null? Type
TABLE_NAME NOT NULL VARCHAR2(30)
TABLE_TYPE VARCHAR2(11)
COMMENTS VARCHAR2(4000)
See http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:233014204543.
b) I was trying to look up a text named 'PKa200030' which showed up within an application upon which we are developing. The application uses Oracle 11g Enterprise Edition. However, I could not find the name anywhere when querying all_constraints, so I am not sure how to trace back the table name / package name, by knowing what seems to be a primary key constraints, any ideas please?
select c.table_name,c.constraint_name, --c.r_constraint_name,
cc.table_name
from all_constraints c
inner join all_constraints cc on c.r_constraint_name = cc.constraint_name
See http://stackoverflow.com/questions/3210743/viewing-oracles-metadata-about-primary-foreign-key-constraints.
c) I am not sure whether it is possible to draw a database entity model, perhaps using software, assuming that the primary/foreign keys have been already defined within Oracle 11g. Is software available to do this?Hi,
a) comments on tables and fields matching a certain text pattern. If possible I would LIKE the text pattern matching not to be case-sensitive. Am I looking within the right meta tables?
SQL> desc all_col_comments
Name Null? Type
OWNER NOT NULL VARCHAR2(30)
TABLE_NAME NOT NULL VARCHAR2(30)
COLUMN_NAME NOT NULL VARCHAR2(30)
COMMENTS VARCHAR2(4000)
SQL> desc user_tab_comments
Name Null? Type
TABLE_NAME NOT NULL VARCHAR2(30)
TABLE_TYPE VARCHAR2(11)
COMMENTS VARCHAR2(4000)
....... The dictionary views are the same . A query with regular expressions may help in identifying the matching strings in comments.
b) I was trying to look up a text named 'PKa200030' which showed up within an application upon which we are developing. The application uses Oracle 11g Enterprise Edition. However, I could not find the name anywhere when querying all_constraints, so I am not sure how to trace back the table name / package name, by knowing what seems to be a primary key constraints, any ideas please?
select c.table_name,c.constraint_name, --c.r_constraint_name,
cc.table_name
from all_constraints c
inner join all_constraints cc on c.r_constraint_name = cc.constraint_name
....... There is one more view for constraints. USER_CONS_COLUMNS may be of help.
Padma -
Need to create a procedure whic h search and drop tables from the db.
Dear Gurus,
I need to create a procedure, which first checks the tables and then drop those tables if find in the database. For example, I have 5 tables, then my procedure should first checks the existence , then drop all those 5 tables from the database. Actually, I have to attach this procedure to report buildeer, so please keep in mind the above mentioned scenario. Your input will be highly appriciated.
hare krishna
AlokDropping 5 tables each time user hits the report!!! (According to my understanding)
I would like to share my experience. My group developed many complex reports, we used oracle jobs to run the complex queries time to time, according to our business requirements and stored the result in a final table. Just for viewing at front end level, we used a simple select statement.
-aijaz
Maybe you are looking for
-
Report parameters for pdf instance
Hi, is there a way to read the parameters from a pdf report instance? I already successfully retrieved the report parameters from a CrystalReport using the IReport.getReportParamters. Is there a similar way to do this for pdf instances or Excel insta
-
I can't log in with my Apple ID is says server error
Upgraded to Mavericks and it asked me to log in with my apple ID so I did and it said that I coudnt log it due to a server error. Now the screen is frozen and it doesn't let me do anything !! Tried to restart the machine but it doesn't let me !! I'm
-
How can i enlarge the mail size?
hi all: i have installed JES2005Q4. The system version is: Sun Java(tm) System Messaging Server 6.2-3.04 (built Jul 15 2005) libimta.so 6.2-3.04 (built 01:43:03, Jul 15 2005) SunOS mail 5.10 Generic_118833-33 sun4u sparc SUNW,Sun-Fire-280R now, i ass
-
i have created a class which extends an abstract class that extends applet, and this class fails to show images when i use the graphics.drawImage command in paint. note: i am using appletviewer package hangman; public abstract class Hangman extends A
-
RTE_SQLERRM: ORA-00600: internal error code
Hi All, OWB Config Details is as follows: Oracle 9i Warehouse Builder Client: 9.2.0.2.8 Oracle 9i Warehouse Builder Repository: 9.2.0.2.8 Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64bit Production With the Partitioning, OLAP and Oracle Data Min