Adding a parameter with comma separated having different values
i want to add a parameter with comma separated having different values of a column. e.g i have column having values from 10000 to 99999. i want to create report for the selected values of 11111,12111,131111 etc. This selection can be one or more values as desired. Second problem is restricting the records as per parameter.
Reports doesn't allow multi-selection of a parameter in its parameter form. You need to use Oracle*Forms or an HTML Form to front end more advanced parameter form options.
However, you could have multiple parameters and combine their selections into a single parameter in the after parameter form trigger. This would at least allow you to give the user the option for selecting up to 'n' parameters. The single parameter would have to be of type "character" and you probably want to add appropriate quotes around the values in the after parameter form trigger.
Second problem is restricting the records as per parameter. Once you've got the comma seperated values into a single parameter (say p_myValues with a default value of '') then you can just use a lexical parameter to restrict the values as in:
select * from emp
where to_char(empno) in (&p_myValues)
Similar Messages
-
One column having multiple values with comma separator.
Hey Guys,
In my db, one culmn having multiple values with comma separator. like column_name = 'value1,value2,value3'. Now I want to compare this column to another column and fetch in Cursor.
and each value having corresponding email_id, By fetching cursor, I need to populate email_ids.
Thanks in advance!!
-LakshmanPlease compare and fetch cursor and populate result with out extract data into temp table. Give me the query!You have not provided DDL for table so I don't know table or column name to write any SQL.
You have not provided DML for test data to run SQL against. -
How can i get all these values in single row with comma separated?
I have a table "abxx" with column "absg" Number(3)
which is having following rows
absg
1
3
56
232
43
436
23
677
545
367
xxxxxx No of rows
How can i get all these values in single row with comma separated?
Like
output_absg
1,3,56,232,43,436,23,677,545,367,..,..,...............
Can you send the query Plz!These all will do the same
create or replace type string_agg_type as object
2 (
3 total varchar2(4000),
4
5 static function
6 ODCIAggregateInitialize(sctx IN OUT string_agg_type )
7 return number,
8
9 member function
10 ODCIAggregateIterate(self IN OUT string_agg_type ,
11 value IN varchar2 )
12 return number,
13
14 member function
15 ODCIAggregateTerminate(self IN string_agg_type,
16 returnValue OUT varchar2,
17 flags IN number)
18 return number,
19
20 member function
21 ODCIAggregateMerge(self IN OUT string_agg_type,
22 ctx2 IN string_agg_type)
23 return number
24 );
25 /
create or replace type body string_agg_type
2 is
3
4 static function ODCIAggregateInitialize(sctx IN OUT string_agg_type)
5 return number
6 is
7 begin
8 sctx := string_agg_type( null );
9 return ODCIConst.Success;
10 end;
11
12 member function ODCIAggregateIterate(self IN OUT string_agg_type,
13 value IN varchar2 )
14 return number
15 is
16 begin
17 self.total := self.total || ',' || value;
18 return ODCIConst.Success;
19 end;
20
21 member function ODCIAggregateTerminate(self IN string_agg_type,
22 returnValue OUT varchar2,
23 flags IN number)
24 return number
25 is
26 begin
27 returnValue := ltrim(self.total,',');
28 return ODCIConst.Success;
29 end;
30
31 member function ODCIAggregateMerge(self IN OUT string_agg_type,
32 ctx2 IN string_agg_type)
33 return number
34 is
35 begin
36 self.total := self.total || ctx2.total;
37 return ODCIConst.Success;
38 end;
39
40
41 end;
42 /
Type body created.
[email protected]>
[email protected]> CREATE or replace
2 FUNCTION stragg(input varchar2 )
3 RETURN varchar2
4 PARALLEL_ENABLE AGGREGATE USING string_agg_type;
5 /
CREATE OR REPLACE FUNCTION get_employees (p_deptno in emp.deptno%TYPE)
RETURN VARCHAR2
IS
l_text VARCHAR2(32767) := NULL;
BEGIN
FOR cur_rec IN (SELECT ename FROM emp WHERE deptno = p_deptno) LOOP
l_text := l_text || ',' || cur_rec.ename;
END LOOP;
RETURN LTRIM(l_text, ',');
END;
SHOW ERRORS
The function can then be incorporated into a query as follows.
COLUMN employees FORMAT A50
SELECT deptno,
get_employees(deptno) AS employees
FROM emp
GROUP by deptno;
###########################################3
SELECT SUBSTR(STR,2) FROM
(SELECT SYS_CONNECT_BY_PATH(n,',')
STR ,LENGTH(SYS_CONNECT_BY_PATH(n,',')) LN
FROM
SELECT N,rownum rn from t )
CONNECT BY rn = PRIOR RN+1
ORDER BY LN desc )
WHERE ROWNUM=1
declare
str varchar2(32767);
begin
for i in (select sal from emp) loop
str:= str || i.sal ||',' ;
end loop;
dbms_output.put_line(str);
end;
COLUMN employees FORMAT A50
SELECT e.deptno,
get_employees(e.deptno) AS employees
FROM (SELECT DISTINCT deptno
FROM emp) e;
DEPTNO EMPLOYEES
10 CLARK,KING,MILLER
20 SMITH,JONES,SCOTT,ADAMS,FORD
30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
CREATE OR REPLACE FUNCTION concatenate_list (p_cursor IN SYS_REFCURSOR)
RETURN VARCHAR2
IS
l_return VARCHAR2(32767);
l_temp VARCHAR2(32767);
BEGIN
LOOP
FETCH p_cursor
INTO l_temp;
EXIT WHEN p_cursor%NOTFOUND;
l_return := l_return || ',' || l_temp;
END LOOP;
RETURN LTRIM(l_return, ',');
END;
COLUMN employees FORMAT A50
SELECT e1.deptno,
concatenate_list(CURSOR(SELECT e2.ename FROM emp e2 WHERE e2.deptno = e1.deptno)) employees
FROM emp e1
GROUP BY e1.deptno;
DEPTNO EMPLOYEES
10 CLARK,KING,MILLER
20 SMITH,JONES,SCOTT,ADAMS,FORD
30 ALLEN,WARD,MARTIN,BLAKE,TURNER,JAMES
CREATE OR REPLACE TYPE t_string_agg AS OBJECT
g_string VARCHAR2(32767),
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
value IN VARCHAR2 )
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
returnValue OUT VARCHAR2,
flags IN NUMBER)
RETURN NUMBER,
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
ctx2 IN t_string_agg)
RETURN NUMBER
SHOW ERRORS
CREATE OR REPLACE TYPE BODY t_string_agg IS
STATIC FUNCTION ODCIAggregateInitialize(sctx IN OUT t_string_agg)
RETURN NUMBER IS
BEGIN
sctx := t_string_agg(NULL);
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateIterate(self IN OUT t_string_agg,
value IN VARCHAR2 )
RETURN NUMBER IS
BEGIN
SELF.g_string := self.g_string || ',' || value;
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateTerminate(self IN t_string_agg,
returnValue OUT VARCHAR2,
flags IN NUMBER)
RETURN NUMBER IS
BEGIN
returnValue := RTRIM(LTRIM(SELF.g_string, ','), ',');
RETURN ODCIConst.Success;
END;
MEMBER FUNCTION ODCIAggregateMerge(self IN OUT t_string_agg,
ctx2 IN t_string_agg)
RETURN NUMBER IS
BEGIN
SELF.g_string := SELF.g_string || ',' || ctx2.g_string;
RETURN ODCIConst.Success;
END;
END;
SHOW ERRORS
CREATE OR REPLACE FUNCTION string_agg (p_input VARCHAR2)
RETURN VARCHAR2
PARALLEL_ENABLE AGGREGATE USING t_string_agg;
/ -
Hi all ,
I have a currency filed TFULLVACWTG. I am summing all values like this
TFULLVACWTG = VFWTG001 + VFWTG002 + VFWTG003 + VFWTG004 + VFWTG005 . iam getting output like this 14092.00 i should get output like this 14,092.00
I should write output with comma separator .is there any key word or f.m for this one?Hi Priya,
You have two options.
1) Changes in user master record ie change thousand separator as , and decimal separator as .(dot).
You can do this with transaction SU3.
2) If you dont want to change master record then try with this code.
DATA VC_TFULLVACWTG(18).
VC_TFULLVACWTG = TFULLVACWTG.
TRANSLATE VC_TFULLVACWTG USING ',#'.
TRANSLATE VC_TFULLVACWTG USING '.,'.
TRANSLATE VC_TFULLVACWTG USING '#.'.
WRITE VC_TFULLVACWTG.
Thanks,
Vinay -
Query on column with comma separated values
I have a proposed table with unnormalized data like the following:
ID COLA COLB REFLIST
21 xxx zzz 24,25,78,412
22 xxx xxx 21
24 yyy xxx 912,22
25 zzz fff 433,555,22
.. ... ... ...There are 200 million rows. There is maximum of about 10 IDs in the REFLIST, though typically two or three. How could I efficiently query this data on the REFLIST column? e.g. something like:
SELECT id FROM mytable WHERE :myval in reflistLogically there is a many to many relationship between rows in this table. The REFLIST column contains pointers to ID values elsewhere in the table. The data could be normalized so that the relationship keys are in a separate table (in fact this is the current solution that we want to change).
ID REF
21 24
21 25
21 78
21 412
22 21
24 912
... ...The comma separated list seems instinctively like a bad idea, however there are various reasons for proposing it. The main reason is because the source for this data has it structured like the REFLIST example. It is an OLTP-like system rather than a data warehouse. The source code (and edit performance) would benefit greatly from not having to maintain the relationship table as the data changes.
Going back to querying the REFLIST column, the problem seems to be building an approriate index for the data. The ideas proposed so far are:
<li>Make a materialized view that presents the relationships as normalized (e.g. as in the example with ID, REF columns above), then index the plain column - the various methods of writing the view SQL have been widely posted.
<li>Use a Oracle Text Index (not something I have ever had call to use before).
Any other ideas? Its Oracle 10.2, though 11g could be possible.
Thanks
JimSomething like this ?
This is test demo on my 11.2.0.1 Windows XP
SQL> create table test (id number,reflist varchar2(30));
Table created.
SQL> insert into test values (21,'24,25,78,412');
1 row created.
SQL> insert into test values (22,'21');
1 row created.
SQL> insert into test values (24,'912,22');
1 row created.
SQL> insert into test values (25,'433,555,22');
1 row created.
SQL> select * from test
2 where
3 ',' || reflist || ',' like '%,22,%';
ID REFLIST
24 912,22
25 433,555,22
SQL>Source:http://stackoverflow.com/questions/7212282/is-it-possible-to-query-a-comma-separated-column-for-a-specific-value
Regards
Girish Sharma
Edited by: Girish Sharma on Jul 12, 2012 2:31 PM -
SQL - Multiple Fetch into Single Column with Comma Separator
Hello Experts,
Good Day to all...
I need your help on following scenarios. The below query returns set of titleID strings. Instead of printing them one below the other as query output, I want the output to be in batch of 25 values.i.e each row should have 25 values separated by comma. i.e If there are 100 titles satisfying the output, then there should be only four rows with and each row having 25 titles in comma separated manner.
SELECT DISTINCT title_id
FROM pack_relation
WHERE package_id IN ( SELECT DISTINCT fa.package_id
FROM annotation fa
GROUP BY fa.package_id
HAVING COUNT
(fa.package_id) <100);I tried with the PL/SQL block; whereas it is printing all the values continously :(
I need to stop with 25 values and display.
If its possible with SQL block alone; then it would be of great help
DECLARE
v_str VARCHAR2 (32767) := NULL;
CURSOR c1
IS
SELECT DISTINCT title_id
FROM pack_relation
WHERE package_id IN ( SELECT DISTINCT fa.package_id
FROM annotation fa
GROUP BY fa.package_id
HAVING COUNT
(fa.package_id) <100);
BEGIN
FOR i IN c1
LOOP
v_str := v_str || ',' || i.title_id;
END LOOP;
v_str := SUBSTR (v_str, 2);
DBMS_OUTPUT.put_line (v_str);
EXCEPTION
WHEN OTHERS
THEN
DBMS_OUTPUT.put_line ('Error-->' || SQLERRM);
END;Thanks...You can use CEIL
Sample code
SELECT
nt,
LTRIM(MAX(SYS_CONNECT_BY_PATH(val,',')) KEEP (DENSE_RANK LAST ORDER BY curr),',') AS concat_val
FROM
SELECT
val,
nt,
ROW_NUMBER() OVER (PARTITION BY nt ORDER BY val) AS curr,
ROW_NUMBER() OVER (PARTITION BY nt ORDER BY val) -1 AS prev
FROM
SELECT
level AS val,
ceil(rownum/3) as nt /* Grouped in batches of 3 */
FROM
dual
CONNECT BY level <= 10
GROUP BY
nt
CONNECT BY prev = PRIOR curr
AND nt = PRIOR nt
START WITH curr = 1;
NT CONCAT_VAL
1 1,2,3
2 4,5,6
3 7,8,9
4 10Your code
SELECT
nt,
LTRIM(MAX(SYS_CONNECT_BY_PATH(title_id,',')) KEEP (DENSE_RANK LAST ORDER BY curr),',') AS concat_val
FROM
SELECT
title_id,
nt,
ROW_NUMBER () OVER (PARTITion BY nt ORDER BY title_id) AS curr,
ROW_NUMBER() OVER (PARTITION BY nt ORDER BY title_id) -1 AS prev
FROM
SELECT
title_id,
ceil(rownum/25) AS nt /* Grouped in batches of 25 */
FROM
pack_relation tdpr
JOIN annotation fa
ON
tdpr.package_id = fa.package_id
GROUP BY
title_id,
fa.package_id
HAVING
COUNT (fa.package_id) < 500
GROUP BY
nt
CONNECT BY prev = PRIOR curr
AND nt = PRIOR nt
START WITH curr = 1; -
How to get the values entered in parameter as comma separated
Hi friends,
I need to capture the values entered in the parameter which is entered as comma separated in the srs window o
for ex in the parameter : 1234,4586,356,.....
now i need to capture all the values to select in my list of
employee numbers as
employee number in(1234,4586,356...)
how to do this
pls helpPlease refer to SQL and PL/SQL FAQ
Sybrand Bakker
Senior Oracle DBA -
SQL Select with comma separated column value
Hi All
ASP VBScript
I have a DB column named allowed_contracts that stores a
comma separated
list of of values e.g. 3, 5, 19, 44, 52
I need to select records based on a variable called
varContractList that
contains another comma separated list i.e. 5, 44, 52
I only want to select records where the allowed_contracts
column contains
each of the varContractList,
For example only return records that have 5 or 44 or 52 in
thier
allowed_contracts column.
My brain is now in a persistant vegetive state trying to work
this out so
any ideas would be much appreciated.
Regards
BrenHi Jules
Cheers for this.
I was trying to be a bit cute (lazy even) by storing the
project ID's as a
comma delimted string but as we see it doesn't always pay to
be lazy. Serves
me right for destroying brain cells by drinking the Welshpool
beer the other
week whilst visiting mates down that neck of the woods. :-))
Time for another table me thinks.
Rgds
Bren
"Julian Roberts" <[email protected]> wrote in message
news:e7i13f$mup$[email protected]..
> Fatal flaw here Bren. In a relational database, one
shouldn't really store
> foreign keys as a comma delimted string. One should have
a 3 table
> structure. eg
>
> Products:
> ProductID
> Product
>
> Categories:
> CategoryID
> Category
>
> ProductCategories:
> ProductID
> CategoryID
>
> So, from the table ProductCategories, a product can
belong to many
> categories. When doing a front end search to find
products in multiple
> categories, products can be shown thus:
>
> select * from Products where ProductID in (select
ProductID from
> ProductCategories where CategoryID in (5,44))
>
> --
> Jules
>
http://www.charon.co.uk/charoncart
> Charon Cart 3
> Shopping Cart Extension for Dreamweaver MX/MX 2004
>
>
>
>
> -
Count of rows having different values
SQL> select * from med;
CERT REC PRIM RACE
100 10 EN USA
100 11 EN USA
100 12 EN USA
100 13 SP MX
200 14 SP MX
200 15 SP MX
6 rows selected.
SQL> select * from sub;
CERT REC PRIM RACE
100 10 EN USA
100 11 EN USA
100 12 EN USA
100 13 SP MX
200 14 SP MX
200 15
6 rows selected.
SQL> select * from den;
CERT REC PRIM RACE
100 01 EN USA
100 02 EN USA
100 03 EN USA
100 04 SP MX
200 06 SP MX
(cert,rec) uniquly identifies a person;
In Den table rec =med.rec-9 or rec =sub.rec-9 which implies
med sub den
(cert,rec)=(100,10)=(100,10)=(100,01)How can I find out how many people in the table where the PRIM and RACE hold different values.?Hi,
Perhaps this ,
with med as (
select 100 CERT, 10 rec, 'EN' prim, 'USA' race from dual union all
select 100 , 11, 'EN', 'USA' from dual union all
select 100 , 12, 'EN', 'USA' from dual union all
select 100 , 13, 'SP', 'MX' from dual union all
select 200 , 14, 'SP', 'MX' from dual union all
select 200 , 15, 'SP', 'MX' from dual )
sub as (
select 100 CERT, 10 rec , 'EN' prim, 'USA' race from dual union all
select 100, 11 , 'EN', 'USA' from dual union all
select 100, 12 , 'EN', 'USA' from dual union all
select 100, 13 , 'SP', 'MX' from dual union all
select 200, 14 , 'SP', 'MX' from dual union all
select 200, 15, null, null from dual )
den as (
select 100 cert, 01 rec, 'EN' prim, 'USA' race from dual union all
select 100, 02, 'EN' , 'USA'from dual union all
select 100, 03, 'EN' , 'USA'from dual union all
select 100, 04, 'SP' , 'MX'from dual union all
select 200, 06, 'SP' , 'MX'from dual )
----- sample data
select cert, prim, race ,count(rec) rec
from (
select *
from med
union all
select *
from sub
union all
select *
from den
group by cert, prim, race
ORDER BY 1,2,3
CERT PR RAC REC
100 EN USA 9
100 SP MX 3
200 SP MX 4
200 1HTH
SS -
Displaying data from a list into a single field with comma separated values
Hi,
I have a requirement to change a report with an XML structure (simplified version) as below
<Protocol>
<ProtocolNumber>100</ProtocolNumber>
<SiteName>Baxter Building</SiteName>
<ListOfActivity>
<Activity>
<Description>Communication Memo Description.</Description>
<Name>James</Name>
</Activity>
<Activity>
<Description>Visit 4</Description>
<Name>James</Name>
</Activity>
<ListOfActivity/>
</Protocol>
On the report I need to display all the 'Names' for each of the Child (Activities) in a single field at the Parent (Protocol) level, with each Name separated by a comma.
How do I go about getting this to work?
ThanksTake a look at this: http://blogs.oracle.com/xmlpublisher/entry/inline_grouping
You could do this (ofcourse, you will need to add extra logic to ensure that there is no comma added after the last name..)
<?for-each@inlines:Name?><?.?><?', '?><?end for-each?>
Thanks,
Bipuser -
Download internal table as text file with comma separation
hi all
I wanted text file separated by comma. I used the CSV function module, but the result is separeted by semicolon,instead i need comma.
Kindly suggest some solution.
Thanks
Subhause this fm to convert to csv file
CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
EXPORTING
I_FIELD_SEPERATOR = ','
TABLES
I_TAB_SAP_DATA = ITAB_FINAL
CHANGING
I_TAB_CONVERTED_DATA = ITAB_OUTPUT
EXCEPTIONS
CONVERSION_FAILED = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
itab_output is of type ITAB_OUTPUT TYPE TRUXS_T_TEXT_DATA,
and then download using gui_download
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = W_FILENAME
FILETYPE = 'ASC'
TABLES
DATA_TAB = ITAB_OUTPUT
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22. -
Uploading file with comma separator
Hi firends,
I have a text file in the format below.
"abc","dedffrt","asd"
The value of field is enclosed in double quotes and each values are separated by comma.
I have tried with the function modules available for upload but of no use.
Im aware of the methods uploading and splitting ...
But i want to know is there any other function modules available to upload the file of this type.
KeshavHi KSD,
Try this way.
REPORT ztest_notepad.
DATA: BEGIN OF it_t001 OCCURS 0,
bukrs TYPE t001-bukrs,
butxt TYPE t001-butxt,
END OF it_t001.
DATA: BEGIN OF it_file OCCURS 0,
data TYPE char255,
END OF it_file.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\hor_file.txt'
filetype = 'ASC'
TABLES
data_tab = it_file.
REPLACE ALL OCCURRENCES OF '"' IN TABLE it_file WITH space.
LOOP AT it_file.
SPLIT it_file-data AT ',' INTO it_t001-bukrs it_t001-butxt.
APPEND it_t001.
CLEAR it_t001.
ENDLOOP.
LOOP AT it_t001.
WRITE:/ it_t001-bukrs, it_t001-butxt.
ENDLOOP.
<li>Text file
"CGH","CGH Hospital"
"KKH","KKH hospital"
"SGH","SGH Hospital"
Thanks
Venkat.O -
Setting DESFORMAT parameter with Comma as delimiter
Hi Gurus,
I have a report in which i set the DESFORMAT to Delimited and whenever i generate the output, it is a tab separated file. The reason is that the default delimiter is Tab. How can i set Comma as the delimiter for that report. I don't want to change it for all the reports, means i don't want to change any of the environment variablr. I want this change only for this report.
Thanks in advance
ManishI haven't had personal experience with it,
but the reference docs say that DELIMITER
is a possible option to RWBLD60 as well.
(Only for DESFORMAT=delimited.)
Also, the built-in-help says that if you
select file->generate-to-file->delimited,
you'll get a dialog box for options, one of
which is the delimiter. Tried it, seems to
work. Doesn't like Unicode, which is one of
the reasons I don't use DELIMITED...
-- Allan Plumb -
Sortable jtable with jcombo having different values
Hi,
I have a contacts list with name, addrerss etc., and telephone numbers where each contact can have several telephone numbers.
The data is stored in a Derby DB in two tables with a PK and FK relationship. I need to load all the Contact fields in to a JTable where one of the columns will be the JCombos with telephone number(s) for that paticular contact.
I have studied two neat sample code segments posted by a senior mrmber "camickr" at;
[http://forum.java.sun.com/thread.jspa?forumID=57&threadID=637581 |http://forum.java.sun.com/thread.jspa?forumID=57&threadID=637581 ]
Also another by " skdaga " at;
[http://forums.sun.com/thread.jspa?threadID=749031&messageID=4284078|http://forums.sun.com/thread.jspa?threadID=749031&messageID=4284078]
both are solid working examples.
My problem is that I need to let the user to sort the table by columns and also filter by a text box entry. Meaning, the Combo boxes cannot have a fixed row index.
Could someone advice if this is possible or I should use some other approach.
Thanking you in advance,Hi camickr;
Many thanks for your kind reply. I have managed to slightly modify your code to load the combos of individual telephone numbers dynamically.
I have done so by returning a TableCellEditor from the public TableCellEditor getCellEditor(int row, int column) method, in place of storing the
DefaultCellEditor dce1 = new DefaultCellEditor( comboBox1 ); etc., in an ArrayList.
It goes as this. Following method is called by the return statement.
private TableCellEditor createCellEditorWithCombo(int contactId) {
JComboBox cmbNumbers = new JComboBox( <passed a Vector here thro' a PreparedStatement from the DB>);
DefaultCellEditor editor = new DefaultCellEditor(cmbNumbers);
return (TableCellEditor)editor;
}The contactId of course could be easily desiphered from the "row" parameter then and there.
I will follow your advice on the sorting part (on which I am yet to read the API fully) and get back with the result. Btw, I use the JDK 1.6u7 with Netbeans 6.1
Thanking you once again for your great contributions,
ViKARLL
NB: By the way;
camickr wrote:
Well, if you look at my example you will note it uses the convertColumnIndexToModel(...). So you need to do the same thing for the row.It looks like you are referring to a diffrent post by you, since your example I worked on does not contain this method ??
Edited by: ViKARLL on Sep 13, 2008 4:19 AM -
Best way to deal with same members having different parents/children
We have a situation where some nodes need to have different parents for different application but they exist in the main hierarchy. What is the best way to deal with it? The nodes used are pretty much the same.
Is it best to create a new hierarchy within the same version and let the nodes have different parents in it?
-- AEvery node has a parent in the hierarchy. You said that some nodes need different parents for different applications.
Do these 'different parents' exist further up the tree? If they do then you can create a boolean input property that flags the nodes that exist JUST for the application. Create a new property (call it NewAppParent, let's say) with a formula that recursively climbs up the tree to find its next parent for the application, and export NewAppParent as the parent value.
If the parent does not exist in the hierarchy then you should create an alternate hierarchy.
If the parent exists in the hierarchy and is not an ancestor of the node then you're out of luck. Unless you create an alternate hierarchy with unique parent names.
D
Maybe you are looking for
-
CS5.0.3 Temp files on C during export even with scratch as E
I have a small project that uses alot of Photoshop files as graphics templates. I thought that because I set my scratch disks to "E" that whenever I would export, it would use "E" as my temp location for any temp files generated/needed during exporti
-
Java SDK for RoboSapien RS Media
I have heard that there was a Java SDK for RoboSapien RS Media. I talked to a Customer Support Rep at WowWee and they said that the current Java SDK would work in it. If not that I can obtain the right one from Sun? But I can't seem to find where I c
-
CE 10: Stack overflow at line
I am using Crystal 10, RAS 10 using Crystal Interactive Viewer. The error occurs when closing the viewer window. I receive a java alert: "Stack Overflow at line: 63" When I debugged I found the error in the rendered javascript. The debugger stopped
-
SQL Server Max Memory Settings
Hi, I'd like to check if SQL Server will consume memory more than the configured MAX Memory settings? And if so when does SQL consume that and how much would it consume. Regards, Jay
-
Skype works, but no internet and mail
All, This sounds to funny to be true, but it is real. My skype works on my Mini (via LAN cable to my Airport), but If I open Safari or FF (or Mail) I get a message that it is not connected to the internet. I checked the network settings and I do get