Display CLOB value in multiple rows in ADF UIX
Hi,
I have an ADF UIX application that uses data that are stored in a CLOB column in an Oracle Database.
The table data is presented in a simple table in page1.uix, I use BC4J for accessing the Database and Oracle JDeveloper 9.0.5.2.
The problem is that the CLOB data appear properly (meaning the rows appear OK) only in a frame (messageTextInput element) of a predefined size and if I change the element into a styledText or a formattedText the frame will not appear, but all the CLOB characters appear in a single row.
Does anyone know how I can present the CLOB text data in a UIX page, without having a frame around the text, and at the same time keep the CLOB text in multiple rows?
There's no completely trivial way. You'd have to do a bit of extra processing of your CLOB data. The most straightforward work to do is to convert "\n" into "<br>", and then pass that into a <formattedText>.
Similar Messages
-
How To Concatenate Column Values from Multiple Rows into a Single Column?
How do I create a SQL query that will concatenate column values from multiple rows into a single column?
Last First Code
Lesand Danny 1
Lesand Danny 2
Lesand Danny 3
Benedi Eric 7
Benedi Eric 14
Result should look like:
Last First Codes
Lesand Danny 1,2,3
Benedi Eric 7,14
Thanks,
David JohnsonStarting with Oracle 9i
select last, first, substr(max(sys_connect_by_path(code,',')),2) codes
from
(select last, first, code, row_number() over(partition by last, first order by code) rn
from a)
connect by last = prior last and first = prior first and prior rn = rn -1
start with rn = 1
group by last, first
LAST FIRST CODES
Lesand Danny 1,2,3
Benedi Eric 7,14Regards
Dmytro -
How to delete multiple rows from ADF table
How to delete multiple rows from ADF table
Hi,
best practices when deleting multiple rows is to do this on the business service, not the view layer for performance reasons. When you selected the rows to delete and press submit, then in a managed bean you access thetable instance (put a reference to a managed bean from the table "binding" property") and call getSeletedRowKeys. In JDeveloper 11g, ADF Faces returns the RowKeySet as a Set of List, where each list conatins the server side row key (e.g. oracle.jbo.Key) if you use ADF BC. Then you create a List (ArrayList) with this keys in it and call a method exposed on the business service (through a method activity in ADF) and pass the list as an argument. On the server side you then access the View Object that holds the data and find the row to delte by the keys in the list
Example 134 here: http://blogs.oracle.com/smuenchadf/examples/#134 provides you with the code
Frank -
Concatenate a column value across multiple rows - PDW
We are using PDW based on SQL2014. We require an efficient logic on how to concatenate a column value across multiple rows. We have the following table
T1
(CompanyID, StateCD)
Having following rows:
1 NY
1 NJ
1 CT
2 MA
2 NJ
2 VA
3 FL
3 CA
We need a code snippet which will return following result set:
1
CT,NJ,NY
2
MA,NJ,VA
3
CA,FL
We have tried built-in function STUFF with FOR XML PATH clause and it is not supported in PDW. So, we need a fast alternative.Hi Try this:
SELECT * INTO #ABC
FROM
SELECT 1 AS ID,'NY' AS NAME
UNION
SELECT 1 AS ID,'NJ' AS NAME
UNION
SELECT 1 AS ID,'CT' AS NAME
UNION
SELECT 2 AS ID,'MA' AS NAME
UNION
SELECT 2 AS ID,'NJ' AS NAME
UNION
SELECT 2 AS ID,'VA' AS NAME
UNION
SELECT 3 AS ID,'FL' AS NAME
UNION
SELECT 3 AS ID,'CA' AS NAME
)A
CREATE TABLE ##CDB (ID INT, NAME NVARCHAR(800))
DECLARE @TMP VARCHAR(MAX),
@V_MIN INT,
@V_MAX INT,
@V_COUNT INT
SELECT @V_MIN=MIN(ID),@V_MAX=MAX(ID) FROM #ABC
SET @V_COUNT=@V_MIN
WHILE @V_COUNT<=@V_MAX
BEGIN
SET @TMP = '' SELECT @TMP = @TMP + CONVERT(VARCHAR,NAME) + ', ' FROM #ABC
WHERE ID=@V_COUNT
INSERT INTO ##CDB (ID, NAME) SELECT @V_COUNT AS ID ,CAST(SUBSTRING(@TMP, 0, LEN(@TMP)) AS VARCHAR(8000)) AS NAME
SET @V_COUNT=@V_COUNT+1
END
SELECT * FROM ##CDB
OR
SELECT * INTO #ABC
FROM
SELECT 1 AS ID,'NY' AS NAME
UNION
SELECT 1 AS ID,'NJ' AS NAME
UNION
SELECT 1 AS ID,'CT' AS NAME
UNION
SELECT 2 AS ID,'MA' AS NAME
UNION
SELECT 2 AS ID,'NJ' AS NAME
UNION
SELECT 2 AS ID,'VA' AS NAME
UNION
SELECT 3 AS ID,'FL' AS NAME
UNION
SELECT 3 AS ID,'CA' AS NAME
UNION
SELECT 5 AS ID,'LG' AS NAME
UNION
SELECT 5 AS ID,'AP' AS NAME
)A
CREATE TABLE ##CDB (ID INT, NAME NVARCHAR(800))
DECLARE @TMP VARCHAR(MAX),
@V_MIN INT,
@V_MAX INT,
@V_COUNT INT
SELECT @V_MIN=MIN(ID),@V_MAX=MAX(ID) FROM #ABC
SET @V_COUNT=@V_MIN
WHILE @V_COUNT<=@V_MAX
BEGIN
SET @TMP = '' SELECT @TMP = @TMP + CONVERT(VARCHAR,NAME) + ', ' FROM #ABC
WHERE ID=@V_COUNT
SELECT @V_COUNT AS ID ,CAST(SUBSTRING(@TMP, 0, LEN(@TMP)) AS VARCHAR(8000)) AS NAME INTO #TEMP
INSERT INTO ##CDB (ID, NAME) SELECT ID, NAME FROM #TEMP WHERE NAME<>''
DROP TABLE #TEMP
SET @V_COUNT=@V_COUNT+1
END
SELECT * FROM ##CDB
Thanks Shiven:) If Answer is Helpful, Please Vote -
Reg : Concatenation of a column value with multiple rows... URGENT
Hello,
Could any of u help me in concatenating a column value with
multiple rows ???
For ex : I've the following data from emp table :
DEPTNO ENAME
10 KING'S
30 BLAKE
10 CLARK
10 TOM JONES
30 ALLEN
30 JAMES
20 SMITH
20 SCOTT
20 MILLER
10 MILLER
20 rajeev
I want the following output :
deptno Concat_value
10 KING'S,CLARK,TOM JONES,MILLER
20 Rajeev,MILLER,SMITH,SCOTT
30 BLAKE,ALLEN,JAMES
Thanks in Advance,
SriniHello Naveen,
Thanks for ur answer. But I need a single SQL query for getting
what I want. I know the solution in PL/SQL.
Please try it in a single SQL....
Thanks again,
Srini -
Please - immediate help needed parsing csv values into multiple rows
Hello, we have a very immediate need to be able to parse out a field of comma separated values into individual rows. The following is an example written in SQL Server syntax which does not work in Oracle.
The tricky part is that each ROUTES can be a different length, and each CSV can have a different number of routes in it.
Here is an example of the table ("Quotes") of CSV values I want to normalize:
TPNUMBER ROUTES
1001 1, 56W, 18
1002 2, 16, 186, 28
Here is an example of what I need it to look like:
TPNUMBER ROUTES
1001 1
1001 56W
1001 18
1002 2
1002 16
1002 186
1002 28
Here is the "Tally" table for the query below:
ID
1
2
3
4
5
6
7
And finally, here is the query which parses CSV values into multiple rows but which does not work in Oralce:
SELECT TPNUMBER,
NullIf(SubString(',' + ROUTES + ',' , ID , CharIndex(',' , ',' + ROUTES + ',' , ID) - ID) , '') AS ONEROUTE
FROM Tally, Quotes
WHERE ID <= Len(',' + ROUTES + ',') AND SubString(',' + Phrase + ',' , ID - 1, 1) = ','
AND CharIndex(',' , ',' + ROUTES + ',' , ID) - ID > 0
It may be necessary to use a cursor to loop through the CSV table and process each row (a loop within another loop...) but this is beyond my comprehesion of PL/SQL.
Many thanks in advance for your advice/help.
apkNot sure what you are trying to do with the last step, but this should work for the first part. I assume you would use sqlldr but I just did inserts instead. You might need more than 5 "routes" in the csv. You could put some reasonable max on that number of columns:
SQL>create table t_csv
2 (TPNUMBER varchar2(20),
3 ROUTE_1 VARCHAR2(5),
4 ROUTE_2 VARCHAR2(5),
5 ROUTE_3 VARCHAR2(5),
6 ROUTE_4 VARCHAR2(5),
7 ROUTE_5 VARCHAR2(5),
8 ROUTE_6 VARCHAR2(5) );
Table created.
SQL>INSERT INTO t_csv (TPNUMBER,ROUTE_1,ROUTE_2) values( '1001 1', '56W', '18' );
1 row created.
SQL>INSERT INTO t_csv (TPNUMBER,ROUTE_1,ROUTE_2,ROUTE_3) values( '1002 2', '16', '186', '28');
1 row created.
SQL>create table t_quotes(
2 tpnumber NUMBER,
3 routes VARCHAR2(5));
Table created.
SQL>DECLARE
2 L_tpnumber NUMBER;
3 L_route VARCHAR2(5);
4 begin
5 for rec in (select * from t_csv) loop
6 L_tpnumber := SUBSTR(rec.tpnumber,1,INSTR(rec.tpnumber,' ')-1);
7 L_route := SUBSTR(rec.tpnumber,INSTR(rec.tpnumber,' ')+1);
8 insert into t_quotes values( L_tpnumber, l_route );
9 if rec.route_1 is not null then
10 insert into t_quotes values( L_tpnumber, rec.route_1 );
11 end if;
12 if rec.route_2 is not null then
13 insert into t_quotes values( L_tpnumber, rec.route_2 );
14 end if;
15 if rec.route_3 is not null then
16 insert into t_quotes values( L_tpnumber, rec.route_3 );
17 end if;
18 if rec.route_4 is not null then
19 insert into t_quotes values( L_tpnumber, rec.route_4 );
20 end if;
21 if rec.route_5 is not null then
22 insert into t_quotes values( L_tpnumber, rec.route_5 );
23 end if;
24 end loop;
25 end;
26 /
PL/SQL procedure successfully completed.
SQL> select tpnumber, routes from t_quotes;
TPNUMBER ROUTE
1001 1
1001 56W
1001 18
1002 2
1002 16
1002 186
1002 28
7 rows selected. -
How to update multiple rows in ADF Tble
Hi,
I have created a search form and ADF table. This ADF table is having column of Select Boolean check box along with actual table columns.
When I click on Search button it should show the result in ADF table. I will be able to select the check box in multiple rows.
Finally when I click on Submit button status column should be updated against the rows for which Boolean check box is selected.
Here the thing that I would like to know is how to identify the rows whichever are selected when I click on Submit button.
Could you please help.
Regards
Vinod.http://sameh-nassar.blogspot.de/2009/12/use-checkbox-for-selecting-multiple.html shows how to use a checkbox via a transient attribute on the EO. To get the selected row you check the transient attribute of each row.
Timo -
Populating Combo Box list value In Multiple Row
Hi,
i to have the same problem .
I have used add_list_element to populate the list value of the combo box in multiple row.
I am selecting the list value from the database where the combo box value will be different for each row. However, when i do this.
All the previous row combo box list value will follow the combo box value in the last row. How can i resolve this?
i tried with lov but hasnt had any sucesss.in case of LOV can we make the list to appear automatuically and select a value????i havent had much sucesss over it??
is thr any work around for this apart from lov?Hi,
which product or technology are you talking about ?
Frank -
Passing values of multiple rows to OracleCallableStatement
Hi,
I have a table with multiselection and a submit button. I want to select multiple rows and pass the values of selected rows one by one to a OracleCallableStatement in AM.
I have below code in CO. RowSelection is a transient attribute of type string in ItemsNotReturnedVO. 'Checked Value' is Y
When I run the page, select rows, click on Update button, I get this error. "*Attribute set for RowSelection in view object ItemsNotReturnedVO1 failed*"
if ("WaiveItemBtn".equals(pageContext.getParameter(EVENT_PARAM))) {
OAViewObject itemVO = (OAViewObject)am.findViewObject("ItemsNotReturnedVO1");
OARow row = (OARow)itemVO.first();
for(int i=0;i<itemVO.getRowCount();i++)
String appStatus=itemVO.getCurrentRow().getAttribute("RowSelection").toString();
if(appStatus.equalsIgnoreCase("Y"))
String vHeaderID = pageContext.getParameter("vTraHeaderId");
pageContext.putTransactionValue("vTraHeaderId", vHeaderID);
String vTempID = pageContext.getParameter("vTraTempId");
pageContext.putTransactionValue("vTraTempId", vTempID);
Serializable[] params = { vHeaderID,vTempID };
am.invokeMethod("waiveItemRequest", params);
row = (OARow)itemVO.next();
Below code in AM
public void waiveItemRequest(String vHeaderID, String vTempID){
try{
OADBTransactionImpl oadbtransactionimpl = (OADBTransactionImpl)getDBTransaction();
OracleCallableStatement oraclecallablestatement =
(OracleCallableStatement)oadbtransactionimpl.createCallableStatement(" { call xxitemreturn_pkg.waive_item(:1,:2) } ",1);
oraclecallablestatement.setInt(1, Integer.parseInt(vHeaderID));
oraclecallablestatement.setInt(2, Integer.parseInt(vTempID));
oraclecallablestatement.execute();
catch(Exception e){
e.printStackTrace();
Using 10g database, Jdeveloper 10.1.3.3.0Hi Nadir,
The error is coming because you transient attribute is not updateable.
To make it updateable,
1) Open your VO
2) Go to Attributes
3) Select your transient attribute and make UPDATEABLE = Always.
Let me know, if this helps or you need further assistance.
Thanks
Saurabh -
Cell value spanning multiple rows in JTable
Hi,
I have a JTable where I want a single column value alone to span multiple rows.
Something like
Course No. | Location | Cost
| loc1 | 1000
1 ---------------------------------------------
| loc2 | 2000
How can I create a JTable like this?
Thanks for the help.I have a link for that,
http://www2.gol.com/users/tame/
go in swing examples, JTable #4.
Hope it helps :) -
Saving values of Multiple rows
hi Friends,
I am developing Timesheet Tracking System which enables an employee to enter his project details and submit the weekly timesheet to his Project Manager
I have eight columns and 3 Rows
Columns
1. Project Description
2. Mon
3. Tue
4. Wed
5. Thurs
6. Fri
7. Sat
8. Sun
Rows
Leave
Training
I have seven textboxes (time1-time7 for values entered in columns Mon-Sun) for all 3 Rows
i want to save the values entered in the textboxes in the table
The things is that i m able to save the first row only
Mon Tue Wed Thurs Fri Sat Sun
Timesheet Project 6 6 7 7 8 4 0
Leave 1
Training 2 1 1.5 1
how do i save all values all 3 rows
how do i save values of second row i.e.'Leave'
PreparedStatement pstmt=con.prepareStatement("insert into poojac_Week26 values(?,?,?,?,?,?,?,?)");
pstmt.setInt(1,time1);
pstmt.setInt(2,time2);
pstmt.setInt(3,time3);
pstmt.setInt(4,time4);
pstmt.setInt(5,time5);
pstmt.setInt(6,time6);
pstmt.setInt(7,time7);
pstmt.setInt(8,time1+time2+time3+time4+time5+time6+time7);
int cnt=pstmt.executeUpdate();
System.out.println("values inserted");
the above code is saving values of only first row
Do help me
Thanx & Regards,
Poojahi Friends,
I am developing Timesheet Tracking System which
enables an employee to enter his project details and
submit the weekly timesheet to his Project Manager
I have eight columns and 3 Rows
Columns
1. Project Description
2. Mon
3. Tue
4. Wed
5. Thurs
6. Fri
7. Sat
8. Sun
PreparedStatement pstmt=con.prepareStatement("insert
into poojac_Week26 values(?,?,?,?,?,?,?,?)");
pstmt.setInt(1,time1);The first Column is a String right? Why are you putting a time?????
pstmt.setInt(2,time2);
pstmt.setInt(3,time3);
pstmt.setInt(4,time4);
pstmt.setInt(5,time5);
pstmt.setInt(6,time6);
pstmt.setInt(7,time7);
pstmt.setInt(8,time1+time2+time3+time4+time5+time6+time
);I saw you had values like 1.5, and this is not an int......
You only made one insert why are you expecting to have two rows inserted????
You need to make two calls to execute update if you want two insertions.... and you should clear up you mind about the nature of the fields on your table.... -
How to save multiple rows using ADF faces ?!
Hello;
I am developing a search page using ADF faces (jdeveloper 10.1.3).
after building my view i dragged it as search form on my page then i dragged it again as a read only table to display results with different iterator.
I have a field act as a flag with 'Y' and 'N' value so i converted this field in the table to select boolean checkbox.
what i need is ...
after processing search operation i want to update this flag by 'Y' or 'N' (select/un-select checkbox) then click on a save button to save all result rows flag with its new status to the data base.
Wish to know how to implement that.
Thanks a lotSearching this forum yields How to do a bound af:SelectBooleanCheckbox inside of af:Table
Hope this helps -
How I can display the values in one row when they come from the same colum
This query
SELECT
sorints_ints_code
FROM
saturn.sorints a,
connman.cc_adm_prospect_master
WHERE
sorints_ints_code like 'Z%'
and sorints_pidm = prospect_pidm
give me the results of
ZA
ZB
ZC
I want to use this query in a cursor to update a column in another table, the problem is that I need to update the table concatenating the values ZA,ZB,ZC
I have 24 different codes stored in the column sorints_ints_code, so I don’t want to use 24 different cursors and I don’t to use cross reference, It is there any way that I DON’T know to display the data like this za,zb,zc without using cross reference, I don’t want to use the table 24 times…
Like THIS, this is only for two values…
SELECT
a.sorints_ints_code,
b. sorints_ints_code
FROM
saturn.sorints a,
saturn.sorints b
connman.cc_adm_prospect_master
WHERE
a.sorints_ints_code = ‘ZA’
AND a.sorints_ints_code = ‘ZB’
and a.sorints_pidm = prospect_pidm
and b.sorints_pidm = prospect_pidm
REMEMBER, I have 24 different values
I am trying to write a procedure like this;
Someone suggest this v_int_code1 := v_int_code1||interest_coach_rec.sorints_ints_code;
BUT IT IS NOT WORKING!!!
PROCEDURE prospect_coach_interest_upd
p_prospect_term_code IN srbrecr.srbrecr_term_code%TYPE,
p_prospect_admin_err_code OUT VARCHAR2,
p_ora_err_code OUT NUMBER,
p_ora_err_msg OUT VARCHAR2
) IS
v_out_path VARCHAR2(40) := '/home/connman/student';
v_out_file VARCHAR2(40) := 'cc_adm_prospect_'||p_prospect_term_code||'_'||TO_CHAR(SYSDATE,'YYYYMMDDHH');
v_file_handle UTL_FILE.FILE_TYPE;
v_pidm NUMBER;
v_int_code1 varchar2(30);
v_int_code2 varchar2(2);
v_int_code3 varchar2(2);
CURSOR cur_pidms IS
SELECT prospect_pidm
FROM connman.cc_adm_prospect_master
WHERE prospect_term_code = p_prospect_term_code
FOR UPDATE;
CURSOR interest_coach_cur is
SELECT
sorints_ints_code
FROM
saturn.sorints
WHERE
sorints_ints_code like 'Z%'
and sorints_pidm = v_pidm ;
interest_coach_rec interest_coach_cur%ROWTYPE;
BEGIN
UTL_FILE.FCLOSE_ALL;
v_file_handle := UTL_FILE.FOPEN (v_out_path, v_out_file, 'a');
UTL_FILE.PUT_LINE (v_file_handle,
CHR (10) || TO_CHAR (SYSDATE, 'DD-MON-YYYY HH:MI:SS')
UTL_FILE.PUT_LINE (v_file_handle, 'Entering the Admin Name procedure.');
--- BEGIN
FOR rec_pidms IN cur_pidms
LOOP
EXIT WHEN cur_pidms%NOTFOUND;
v_pidm := rec_pidms.PROSPECT_pidm;
v_int_code1 := v_int_code1||interest_coach_rec.sorints_ints_code;
IF interest_coach_cur%ISOPEN
THEN
CLOSE interest_coach_cur;
END IF;
OPEN interest_coach_cur;
FETCH interest_coach_cur
INTO interest_coach_rec;
IF interest_coach_cur%FOUND
THEN
UPDATE
connman.cc_adm_prospect_master
SET
PROSPECT_COACH_INTEREST = interest_coach_rec.sorints_ints_code
WHERE CURRENT OF cur_pidms;
END IF;
END LOOP;
COMMIT;
p_prospect_admin_err_code := '0';
UTL_FILE.put_line (v_file_handle, 'Successful Completion.');
EXCEPTION
WHEN OTHERS
THEN
p_prospect_admin_err_code := '1';
p_ora_err_msg := SUBSTR (SQLERRM, 1, 2000);
p_ora_err_code := SQLCODE;
END; -- prospect_coach_interest_upd;Search in the forum or web you will find many solutions
Return multi-row result as one comma-delimited row
http://www.oracle-developer.net/display.php?id=412 -
How to convert colon separated column values in multiple rows in report
Hi All,
I want to display colon separated values from a column, in a multi row in report.
For example i have a column1 in a table with value 'A:B:C' , column2 has value '1'.
i want to show in a report three rows using these two columns like
column1 column2
A 1
B 1
C 1Here's one way:
SQL> create table test (col1 varchar2(20), col2 number);
Table created.
SQL> insert all
2 into test values ('A:B:C', 1)
3 into test values ('Dg:Ezs', 2)
4 select * from dual;
2 rows created.
SQL> select
2 t.col2,
3 regexp_substr(t.col1, '\w+', 1, t2.column_value) c1
4 from test t,
5 table(cast(multiset(select level
6 from dual
7 connect by level <= length(t.col1) - length(replace(t.col1, ':', '')) + 1
8 ) as sys.odcinumberlist )) t2
9 order by 2, 1;
COL2 C1
1 A
1 B
1 C
2 Dg
2 Ezs
SQL>Edited by: Littlefoot on Jan 31, 2012 10:13 AM -
Display and edit currently selected row of ADF Table in ADF Form
I have an ADF Read-only Table and ADF Form, which were created from the same Data Control.
I need to be able to edit the selected row of the table in the form (just like in "Binding Data Controls to your JSF page" part of "Developing RIA Web Applications with Oracle ADF" Tutorial). However, I can't figure out how to do this :(
I found the following solution on the Web: #{bindings.DeptView1.currentRow.dataProvider.dname} - but it doesn't work, since "the class oracle.jbo.server.ViewRowImpl does not have the property dataProvider".
Sorry for the newbie question.
Thanks in advance for any help!Hi,
AFAIK, dataProvider is not supported on ADF BC, hence the error.
If you have created ADF Read only table and form from the same data control you just need to refresh the form based on table selection to show up the selected record, to do which you just need to add partialTriggers property to the panelFormLayout and set its value to the id of table
Sireesha
Maybe you are looking for
-
Dear Friends, We are suppose to go likve soon, but we have @ 500 open Purchase orders and we would like to ipload same in sap as retail can any 1 guide me how to do it? Regrads, Vishal [email protected]
-
Printing from HTML rendered page assume bigger margins than defined on the report
Hello! I have a report with PageSize and InteractiveSize of 29,7cm x 21cm and Margins of 2cm each. Body of report is 25cm width. When rendered in report server and then try to print it I get some blank pages because it changes print margins to 2,032c
-
How to get direct support from apple
Hi, I am a new iPod user... I have just created a new account and I am having problems with language support. So I tried to get support from Apple and ended up here... So my first question is, is this forum being maintained exclusively by iPod users
-
How do i dounload my sons from my iphone to my pc so i can burn music cd
how do i download my songs from my iphone to my pc so i can burn music cd
-
Hi is possible without BPM to receive data from txt, call an RFC and the response map to a new txt file