Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Table cell progress indicator

JGagnonMay 2 2013 — edited May 22 2013
I see in the JavaFX 2.2 API that there is a table cell implementation for rendering a progress bar. However, it appears that this only supports the progress indicator that takes an incremental update value (as a double, presumably a value between 0 and 1?) to adjust the "progress" in the indicator. There does not appear to be any support for an indeterminate progress indicator that can be embedded in a table cell.

I am asking because I have a situation where there will be a background task that will be launched potentially for any row in a table. The task may take some time to execute and complete and I would like to show an indeterminate progress indicator that will "spin" until the task completes. I wanted to be able to include this as a cell (column) for each row so that individual rows could indicate whether they were currently "working" or done.

Is there, or will there be in the near future, support for this type of functionality? Or, are there suggestions on a way to cobble together something that can do this?

Comments

User_H3J7U

Bug or DESIGN
By design the query is returned at hard parse time, the parameter values is accessed at runtime.
Any ideas ? Suggestion ?
Split the string at runtime.

user552932

That does not fully explain the error - WHERE IN is a standard SQL clause ? - and I can not split the list of ids that I am looking up. Needs to be clearer...

User_H3J7U

That does not fully explain the error - WHERE IN is a standard SQL clause ?
Parameter acts like a bind variable. fahrbahnproj.employee_func('100, 101') -> ... employee_id in (:p_list_of_ids) -> ... employee_id in ('100, 101')  -> ORA-01722: invalid number
I can not split the list of ids that I am looking up.

with function sm(numlist varchar2) return varchar2 sql_macro as
  nl varchar2(32767 byte);
begin
  return 'select id from json_table(''[''||sm.numlist||'']'', ''$[*]'' columns (id number path ''$''))';
end;
select * from sm('11,22,33')
/

        ID
----------
        11
        22
        33

To split string you can use a table/varray function instead of sql_macro.

Solomon Yakobson
CREATE OR REPLACE
 FUNCTION EMPLOYEE_FUNC(
                        P_LIST_OF_IDS VARCHAR2
                       )
   RETURN VARCHAR2
   SQL_MACRO
   IS
   BEGIN
       RETURN Q'{
                 SELECT  EMPLOYEE_ID,
                         FIRST_NAME,
                         LAST_NAME,
                         EMAIL
                   FROM  EMPLOYEES
                   WHERE EMPLOYEE_ID IN (
                                         SELECT  TO_NUMBER(REGEXP_SUBSTR(P_LIST_OF_IDS,'\d+',1,LEVEL))
                                           FROM  DUAL
                                           CONNECT BY LEVEL <= REGEXP_COUNT(P_LIST_OF_IDS,',') + 1
                                        )
                }';
END EMPLOYEE_FUNC;
/

Function created.

SQL> SELECT  *
  2    FROM  EMPLOYEE_FUNC('100')
  3  /

EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL
----------- -------------------- ------------------------- -------------------------
        100 Steven               King                      SKING

SQL> SELECT  *
  2    FROM  EMPLOYEE_FUNC('100,101')
  3  /


EMPLOYEE_ID FIRST_NAME           LAST_NAME                 EMAIL
----------- -------------------- ------------------------- -------------------------
        101 Neena                Kochhar                   NKOCHHAR
        100 Steven               King                      SKING

SQL>

SY.

Frank Kulash

Hi, user551641
WHERE IN is a standard SQL clause ? 
That's right, IN is a standard SQL operator. When the right operand is a single value, as in
employee_id IN (101)
then it's equivalent to
employee_id = 101
'101,101' is a single VARCHAR2 value, not two NUMBER values.
I can not split the list of ids that I am looking up.
If you can't split the string (or, even better, collect the values in First Normal Form, e.g. a global temporary table) in the first place, then you can do something like this:

SELECT   employee_id, first_name, last_name, email
FROM	 hr_employees
WHERE	 INSTR  ( ',' || :p_list_of_ids        || ','
	 	, ',' || TO_CHAR (employee_id) || ','
		) > 0
;

or you could split the sting inside the function.

BluShadow

the parameter you pass in, is a single string. Just because your string contains commas doesn't mean that Oracle will magically know that it should be a list of values, and it's not just substituted into the query string as if it's a dynamically built SQL. As user_<whatever> says, it acts like a bind variable, so Oracle replaces the value in the string with the single value you pass it, as a whole.... it's expecting a set of numbers and you're giving it a string that isn't a number... simple as.

1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on May 30 2013
Added on May 2 2013
3 comments
5,278 views