String to Row: Delimiter as part of the value
My DB Version - 10.2.0.4.0
I have a string like this
with t
as
select q'['My column',LPAD(TRIM(my_column),4,'0'),10,10000]' str
from dual
select * from tI am looking for a SQL solution that will convert this string into row like this
'My column'
LPAD(TRIM(my_column),4,'0')
10
10000Normal way to convert delimited string to row would be like this
with t
as
select q'['My column',LPAD(TRIM(my_column),4,'0'),10,10000]' str
from dual
select regexp_substr(str,'[^,]+',1,level) val
from t
connect by level <= length(str)-length(replace(str,','))+1But this would result in
'My column'
LPAD(TRIM(my_column)
4
'0')
10
10000 But this is incorrect. So any idea how to solve it?
Karthick_Arp wrote:
I totally understand. But we should also accept the fact that at times we get such crazy stuff to work with.
Just hoping that some one comes up with a super cool sql to do this ;)Something like this perhaps?
SQL> ed
Wrote file afiedt.buf
1 with t as (select q'['My column',LPAD(TRIM(my_column),4,'0'),10,10000]' str from dual)
2 ,x as (select regexp_substr(str, '[^(]+', 1, rownum) str, rownum as lvl
3 from t
4 connect by rownum <= length(regexp_replace(str, '[^(]'))+1
5 )
6 ,y as (select x.str as orig_str, lvl
7 ,replace(regexp_replace(x.str, '[^\)]+$'),',','~')||regexp_substr(x.str, '[^\)]+$') as str2
8 from x
9 )
10 ,z as (select ltrim(sys_connect_by_path(str2, '('),'(') as str
11 from y
12 where connect_by_isleaf = 1
13 connect by lvl = prior lvl + 1
14 start with lvl = 1
15 )
16 --
17 select rownum rn, replace(regexp_substr(str, '[^,]+', 1, rownum),'~',',') str
18 from z
19* connect by rownum <= length(regexp_replace(str, '[^,]'))+1
SQL> /
RN STR
1 'My column'
2 LPAD(TRIM(my_column),4,'0')
3 10
4 10000
SQL> ed
Wrote file afiedt.buf
1 with t as (select q'['My column',LPAD(TRIM(SUBSTR(my_column,4)),4,'0'),10,SUBSTR('FRED',4),10000]' str from dual)
2 ,x as (select regexp_substr(str, '[^(]+', 1, rownum) str, rownum as lvl
3 from t
4 connect by rownum <= length(regexp_replace(str, '[^(]'))+1
5 )
6 ,y as (select x.str as orig_str, lvl
7 ,replace(regexp_replace(x.str, '[^\)]+$'),',','~')||regexp_substr(x.str, '[^\)]+$') as str2
8 from x
9 )
10 ,z as (select ltrim(sys_connect_by_path(str2, '('),'(') as str
11 from y
12 where connect_by_isleaf = 1
13 connect by lvl = prior lvl + 1
14 start with lvl = 1
15 )
16 --
17 select rownum rn, replace(regexp_substr(str, '[^,]+', 1, rownum),'~',',') str
18 from z
19* connect by rownum <= length(regexp_replace(str, '[^,]'))+1
SQL> /
RN STR
1 'My column'
2 LPAD(TRIM(SUBSTR(my_column,4)),4,'0')
3 10
4 SUBSTR('FRED',4)
5 10000
SQL>Seems to work, but don't hold me to that. :D
Similar Messages
-
Is it possible to duplicate a row in a table and the values entered by u
PDF LiveCycle Designer : Is it possible to duplicate a row in a table and the values entered by the user?
[Move to LiveCycle Designer]
-
How to use an equal sign as a part of the value in a property file
say I have this line in a properties file:
args = -Xms512m -Xmx512m -XX:MaxPermSize=256m
obviously I can't use the (=) as is. What should I do to make it work?
I tried to use \= and \:, but it doesn't work as well.
thanks.A property file contains "key" lines or "key=value" lines the '=' character loses its special meaning after a key is read so you can use '=' characters in the 'value' part of a property.
kind regards,
Jos -
KE28 Top-down distribution for only part of the Value Field
Hi Experts,
We have a situation where we will make manual postings in CO-PA through KE21N. Part of this postings will be at the lowest detailed level and part will be for a more summarized level od characteristics. All the postings will flow to the same value field.
We need to make a top-down distribution only for the postings that were made in a summarized level, because the other postings already have the details that we need.
Is it possible?
Kind Regards
Mayumi BlakHi Venkata,
Please note that :-
you can not distribute to a characteristic that already contains a
value. Please see note 77476. If you want to distribute to eg.
profit center, then the characteristic must be initial (in the data
to be distributed).
In the case where the log showed "number of receivers" but no line
written is a common problem in transaction KE28 logged by customers.
One example is that, if the amount of line items is 0.00 for all the
receivers, no line item will be written.
No values in reference data:
If there are no values in reference data for some segments (see the
log). No records are posted (segments which were distributed, but
their value is zero i.e. there is no value to be distributed, are not
posted).
No initial values in the distribution level (ie. # - non assigned)
in each of the characteristics in distribution level.
Kind Regards,
Abhisek Patnaik, -
Get the value from a selected row in a table
Hi all,
My table contains a tree structure.
When I select a single row, I need to get the value of a particular column.
I created an action on the leadSelect of the table and gave the following code:
public void onActionleadValue(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionleadValue(ServerEvent)
String strLeadValue = wdContext.nodeAttribute_View_Out().currentAttribute_View_OutElement().getAttributeAsText("<MyModelAttributename>");
wdComponentAPI.getMessageManager().reportSuccess("selected lead value "+strLeadValue);
wdContext.currentContextElement().setLeadselectedvalue(strLeadValue);
//@@end
My Bapi returns me 6 records. and when I click on any row its always pointing to the last record value.
What could be the problem?
Thanks
AnjanaHi Anjana,
Try this.
try
IWDMessageManager msg = wdComponentAPI.getMessageManager();
int leadselect = wdContext.nodeSChild1().getLeadSelection();
for(int i=0;i<wdContext.nodeSChild1().size();i++)
if(leadselect == i)
//Displaying output in diff table
// IPublicTestComp.ITableNodeElement tabelm = wdContext.createTableNodeElement();
// tabelm.setAttribute1(wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute1());
// tabelm.setAttribute2(wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute2());
// tabelm.setAttribute3(wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute3());
// wdContext.nodeTableNode().addElement(tabelm);
String att1 = wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute1();
String att2 = wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute2();
String att3 = wdContext.nodeSChild1().getSChild1ElementAt(i).getAttribute3();
msg.reportSuccess("Row ("i") : "att1"====="att2"======"+att3);
} catch (WDDynamicRFCExecuteException e) {
wdComponentAPI.getMessageManager().reportException("Message : "+ e.getMessage(),true);
Regards,
Mithu -
How to get the value of column from previous row to current row?
Hi All,
I am facing a critical problem in SQL query (for reporting purpose (COGNOS)). please reply to my query.
REQUIREMENT: i want to retrive value of a column (this is not a table column, this will be calculated based expression) from previous row to current row.
EXAMPLE:
TABLE NAME: i have to join multiple tables. so, i am not mentioning table names here.
DISPLAY COLUMNS in the report: item, loc, sku, beginval (not table column), endval (not table column, this will calculated based on some expressions), etc. Here, first time the value of BEGINVAL will be taken from some x column name of x table. ENDVAL will calculated based on the expression. For the next row onwards, BEGINVAL will become the value of ENDVAL and the value of ENDVAL will be calculated based on the expression and this expression uses the value of BEGINVAL.
my report will look like below.
ITEM LOC SKU BEGINVAL ENDVAL
1 HYD 1-HYD 10 10+1+2 (13)
2 HYD 2-HYD 13 13+1+2 (16)
3 SEC 3-SEC 16 16+1+2 (19)
4 SEC 4-SEC 19 19+1+2 (22)
etc....
in the above output, BEGINVAL and ENDVAL columns are not part of any table. they are alias column names.if you observe intially BEGINVAL will be assigned to some value, but from subsequent rows, BEGINVAL will become the ENDVAL of previous row.
Please help me on how to write this query?Hi, please find the detail description of the problom.
DDL (table scripts)
ITEM
CREATE TABLE ITEM
ITEM VARCHAR2(50 CHAR) NOT NULL,
DESCR VARCHAR2(50 CHAR) DEFAULT ' ' NOT NULL,
UOM VARCHAR2(50 CHAR)
SKU
CREATE TABLE SKU
ITEM VARCHAR2(50 CHAR) NOT NULL,
LOC VARCHAR2(50 CHAR) NOT NULL,
OH float
SKUPROJSTATIC
CREATE TABLE SKUPROJSTATIC
ITEM VARCHAR2(50 CHAR) NOT NULL,
LOC VARCHAR2(50 CHAR) NOT NULL,
STARTDATE DATE
VehicleLoad
CREATE TABLE VEHICLELOAD
LOADID VARCHAR2(50 CHAR) NOT NULL,
DESCR VARCHAR2(50 CHAR) DEFAULT ' ' NOT NULL,
SHIPDATE DATE DEFAULT TO_DATE('01/01/1970','MM/DD/YYYY') NOT NULL,
ARRIVDATE DATE
VEHICLELOADLINE
CREATE TABLE VEHICLELOADLINE
LOADID VARCHAR2(50 CHAR) NOT NULL,
ITEM VARCHAR2(50 CHAR) NOT NULL,
QTY float(126)
DML scripts
I can't provide the the DML scripts, because its very huge data.
Main QUERY is below.
below is the query which i have to write and execute.
select
i.item,
i.descr,
i.unitsperpallet,
sp.loc,
sp.startdate,
'Crucial_IND',
LAG (EndBal,1,0) OVER (ORDER BY STARTDATE) BeginBal,
SP.FCSTCUSTORDERS CustOrders,
SP.COMMITINTRANSOUT,
SP.RECARRIV,
SP.TOTINTRANSIN,
(BeginBal - sp.FCSTCUSTORDERS - sp.COMMITINTRANSOUT + sp.TOTINTRANSIN ) EndBal,
'CuttingQty',
VLL.QTY,
vl.source,
vl.arrivdate,
vl.shipdate,
vl.loadid,
s.oh
from item i, skuprojstatic sp, sku s, VehicleLoad vl, VehicleLoadLine vll
where sp.item = i.item
and s.item=i.item
and sp.item =s.item (+)
and sp.loc = s.loc (+)
and vll.item = s.item
and vll.loadid = vl.loadid
and to_char(sp.startdate ,'mm/dd/yyyy') = to_char(vl.arrivdate,'mm/dd/yyyy')
and sp.loc = vl.dest (+)
order by sp.startdate
problem description: in the above query, BeginBal and EndBal is what i am looking for. when i execute this query, oracle throwing an error saying that alias names can't be used as expressions. For the first row, the BeginBal should be the value sku.OH and for the subsequent rows, this value will be the previous row value of EndBal. -
Bad Data treated as row delimiter
HI,
i'm having an issue about the SAP download file having a bad data treated by BODI as row delimiter.
*Here is the error:*
A row delimiter was seen for row number <12424> while processing column number <32> in file
<FILE_LOCATION>. The row delimiter should be seen after <36> columns. Please check the file for
bad data, or redefine the input schema for the file by editing the file format in the UI.
A row delimiter was seen for row number <12424> while processing column number <32> in file
<FILE_LOCATION>. The row delimiter should be seen after <36> columns. Please check the file for
bad data, or redefine the input schema for the file by editing the file format in the UI.
column # 32 - is the short text description column.
for this kind of error, is it possible to clean the data inside the R/3 Extraction before BODI writes the data or should this be done on the SAP side?
thanks
sheI have txt file this kind of the data but i need to insert it into in datbase
1 1301190300084178 11205 individual individual resident can any one help for this issue to filter this data and insert it into through txt file in asp.net database
1~1301190300084178~I11205~~Individual~Individual-Resident~PRAKASH AMRUTLAL SHAH~REETA PRAKASH SHAH~~A 101 104 MOTA NAGAR,~28216567~~ANDHERI KURLA ROAD,~ANDHERI EAST,[email protected]com~~~~~~2~12~PRAKASH AMRUTLAL
SHAH~A 101 104 MOTA NAGAR,~28216567~~ANDHERI KURLA ROAD,~ANDHERI EAST,~MUMBAI~MAHARASHTRA~INDIA~400099~6~RISHIN PRAKASH SHAH~A 101 104 MOTA NAGAR,~~~ANDHERI KURLA ROAD, CHAKALA,~ANDHERI EAST,~MUMBAI~MAHARASHTRA~INDIA~400099
21-AUG-2013~1~1~0
thanks in advance -
Problems copying a row and pasting it in the following row
Hi all,
In a Numbers table I have 400 rows with data separated each one by a blank row
row 2 has data
row 3 is blank
row 4 has data
row 5 is blank ... and so on.
I have prepared a small script to copy row 2 into row 3, row 4 into row 5,... as follows:
set dName to "Conta"
set sName to "Movis"
set tName to "Pruebas"
set row_ini to 2
tell application "Numbers" to tell document dName to tell sheet sName to tell table tName
set selection range to row row_ini
repeat
if value of first cell of selection range = 0 then
exit repeat
else
tell application "System Events"
keystroke "c" using {command down}
keystroke return
keystroke "v" using {command down}
end tell
tell first cell of the selection range to set rowNum to address of its row
set selection range to row (rowNum + 1)
end if
end repeat
end tell
The idea is:
1 select the initial row (in this case row 2)
2 check if the value of first cell of the row is cero, then exit the repeat loop
3 else
4 copy the entire row, move down a row and paste.
5 move to the next row
6 repeat
The first time I run the script it worked until the row 124 and stopped. I tried again changing the inicial row and it worked only for 7 rows. The third time it erased all the cells with data. I've tried closing both the table and the script but the problems persists: in this case it stops after replacing 5 rows.
Where am I wrong?
Thank you in advance
RatzKOENIG Yvan wrote:
There is not such a book.
There is just on short chapter dedicated to iWork in :
Hanaan Rosenthal & Hamish Sanderson, Learn AppleScript: The Comprehensive
Guide to Scripting and Automation on Mac OS X, Third Edition, Apress (2010);
ISBN 978-1-4302-2361-0
You may find useful infos in my idisk :
<http://public.me.com/koenigyvan>
Scan the contents of the folder :
For_iWork:iWork '09:for_Numbers09.
I guess the problem is for using the tell application block without telling the process Numbers.
No, I had to change a lot of things.
the name of the document was wrong (at least on my machine on which I always use the name extension.
set selection range … was wrong.
Yvan KOENIG (VALLAURIS, France) dimanche 20 février 2011 23:02:35
Thank you.
Visiting your idisk I realise how much work I must do to become a decent scripter!
The book you mention looks interesting. I'm going to include it in my bookcase (and read it, of course).
Ratz -
How to update the value of a column when a row is deleted
Hi,
My requirement is basically i have a table .Below is a sample data along with sample data
Column A Column B ColumnC
1 SAM 0
2 RAM 0
Now if i run a delete statement saying
delete from Table where ColumnA =1 then i want to see the value of ColumnC to be updated as 1.The row shouldnt be deleted however the value of ColumnC should be changed to 1.
Can someone please help me with any suggestions? I can create a trigger but i havent worked with triggers so not sure on how to use it.
Please let me know if i am unclear or if you need any details.
ThanksAs I understand what you need is an INSTEAD OF DELETE trigger like below
CREATE TRIGGER Trg_TableName
ON TableName
INSTEAD OF DELETE
AS
BEGIN
UPDATE t
SET ColumnC = 1
FROM TableName t
WHERE EXISTS (SELECT 1
FROM DELETED
WHERE ColumnA = t.ColumnA
END
this will set ColumnC to 1 and will not do an actual delete of the row.
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
ALV List in the same Column for the row CELL i need button or value
Hi,
In my ALV list for the same column I need Button or Value for the different rows (CELL) depending upon my condition.
as well as I have to make read only of 3 rd column CELL based on my first column dropdown value CELL for this Row Only.
Depends upon the value in column 1 / row 2 I have to read only the CELL of column 5 / row 2 ie for the same row.
Depends upon the value in Column 1/ row 3 I have to EDITABLE or Button the CELL of column 5 / row 3 ie for the same row
How to do the logic for this.
I tried and got it for the entire column only.
But my requirement is for the sepecific cell in the column.
Kindly help to proceed further.
Thanks in advance.
DavHere is how you can make a particular cell in the row read-only based on certain conditions.
In my example I am displaying the flight details in an ALV. Here I am checking the airline id and if it is "AA' I am making the cell in the column airline id as readonly. In my example I am putting a check and readonly on the same column. However you can do this for different columns as well.
In order to achieve this you need to add a new context attribute 'READONLY' of type abap_bool to the context node which is bound to data node of ALV.
The method where I populate the node has the following code to populate the data.
data: lr_input_node type ref to if_wd_context_node,
lr_flight_node type ref to if_wd_context_node,
lv_cityfrom type s_from_cit,
lv_cityto type s_to_city,
ls_from type bapisfldst,
ls_to type bapisfldst,
lt_flights type table of bapisfldat,
ls_flights type bapisfldat.
data: lt_final type if_mainview=>elements_node_flighttab,
ls_final type if_mainview=>element_node_flighttab.
* Instantiate the variable lr_input_note to the node NODE_FLIGHT
lr_input_node = wd_context->get_child_node( name = 'NODE_FLIGHT' ).
* Instantiate the variable lr_flight_note to the node NODE_FLIGHTTAB
lr_flight_node = wd_context->get_child_node( name = 'NODE_FLIGHTTAB' )
* Get the attributes CityFrom und CityTo
lr_input_node->get_attribute( exporting name = 'CITYFROM'
importing value = lv_cityfrom ).
lr_input_node->get_attribute( exporting name = 'CITYTO'
importing value = lv_cityto ).
* Fill the stuctures ls_from and ls_to
ls_from-city = lv_cityfrom.
ls_to-city = lv_cityto.
* Call the function BAPI_FLIGHT_GETLIST
call function 'BAPI_FLIGHT_GETLIST'
exporting
destination_from = ls_from
destination_to = ls_to
tables
flight_list = lt_flights.
Now I am going to check if the airline id is 'AA' and based on that I will fill the readonly context attribute.
loop at lt_flights into ls_flights.
MOVE-CORRESPONDING ls_flights to ls_final.
if ls_flights-airlineid = 'AA'.
ls_final-readonly = abap_true.
else.
ls_final-readonly = abap_false.
endif.
append ls_final to lt_final.
endloop.
Finally bind the data to the context node.
* Bind the data to the node NODE_FLIGHTTAB
lr_flight_node->bind_elements( lt_final ).
Now you need to do the ALV configuration settings.
* create an instance of ALV component
DATA:
lr_salv_wd_table_usage TYPE REF TO if_wd_component_usage.
lr_salv_wd_table_usage = wd_this->wd_cpuse_alv( ).
IF lr_salv_wd_table_usage->has_active_component( ) IS INITIAL.
lr_salv_wd_table_usage->create_component( ).
ENDIF.
* get ALV component
DATA:
lr_salv_wd_table TYPE REF TO iwci_salv_wd_table.
lr_salv_wd_table = wd_this->wd_cpifc_alv( ).
wd_this->alv_config_table = lr_salv_wd_table->get_model( ).
CALL METHOD wd_this->alv_config_table->if_salv_wd_table_settings~set_read_only
EXPORTING
VALUE = ABAP_FALSE
* set visible row count
DATA:
lr_table_settings TYPE REF TO if_salv_wd_table_settings.
lr_table_settings ?= wd_this->alv_config_table.
lr_table_settings->set_visible_row_count( '10' ).
DATA:
lr_column_settings TYPE REF TO if_salv_wd_column_settings,
lr_column TYPE REF TO cl_salv_wd_column.
lr_column_settings ?= wd_this->alv_config_table.
DATA: lr_input_field TYPE REF TO cl_salv_wd_uie_input_field.
lr_column = lr_column_settings->get_column( 'AIRLINEID' ).
CREATE OBJECT lr_input_field EXPORTING value_fieldname = 'AIRLINEID'.
lr_column->set_cell_editor( lr_input_field ).
lr_input_field->set_read_only_fieldname( value = 'READONLY' ).
CALL METHOD lr_column_settings->delete_column
EXPORTING
id = 'READONLY' -
Need to update row in the table if any one of the value is getting updated
Hi All,
I am new to SQL, I need to update the table's row if any one of the value of the row is getting updated, if none of the value is updated then do nothing.
Advice requestedIt is not clear what you meant... Perhaps a trigger
CREATE TRIGGER ShowUpdatedColumns ON Test FOR UPDATE
AS
DECLARE @ColumnID int, @Columns nvarchar(4000), @ObjectID int, @LastColumnID int
SET @ObjectID=(SELECT id FROM sysobjects WHERE name='test')
SET @LastColumnID=(SELECT MAX(colid) FROM syscolumns WHERE id=@ObjectID)
SET @ColumnID=1
WHILE @ColumnID<=@LastColumnID BEGIN
IF (SUBSTRING(COLUMNS_UPDATED(),(@ColumnID - 1) / 8 + 1, 1)) &
POWER(2, (@ColumnID - 1) % 8) = POWER(2, (@ColumnID - 1) % 8)
SET @Columns = ISNULL(@Columns+',','') + COL_NAME(@ObjectID,@ColumnID)
SET @ColumnID=@ColumnID+1
END
PRINT 'Updated columns are :' + @Columns
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
How can I pass the value to another frame?
Hi all,
The following is part of my coding of a frame. Once i click on the jButton2, the selected value will be stored into a variable named NAME and the value will be displayed by a label in same frame. At the same time, a new frame named TESTING3 will be set to visible.
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)
// TODO add your handling code here:
String name = (String)jList1.getSelectedValue();
jLabel1.setText(name); //display the value in a label in same frame
new testing3().setVisible(true); //a new frame set to visible
} Question: How can I pass the value to TESTING3 frame and display it on that frame?
Thanks,
ning.just make an archive that save that variable and them get them from de clase were you save it
public class sav {
String n;
public sav {
n="";
public void addn(String x){
n=x;
public String shown(){
return n;
and them save it from the frame
sav sun = new sav();
sav.addn(f);
them call it from the other frame
sav sin = new sav();
String s = sin.shown();
label.setText(s);
and i think thats you want to do if its not please explain me better
bye -
Help Creating A Link In An IR Report Passing The Value From A Different Col
Version 4.0.2.00.07
Hello,
I have an Interactive Report with a column that I need to create a link on but I need to pass the value of another column.
This report shows the Features of a particular Release. There is a select list for the Release that is selected and executes the report.
There is a column that indicates whether the Feature has a Commitment attached to it. If there is have that a link to another report that shows all the Commitments for that Feature by passing the FEATURE_ID which is also a column on the Feature report.
Query:
SELECT
,CASE WHEN ft.feature_id IN (SELECT cc.feature_id
FROM customer_commitments cc
WHERE ft.feature_id = cc.feature_id
) THEN 'Yes' ELSE 'No'
END "Commitment Exists"
,ft.feature_id
FROM ....If "Commitment Exists" has a 'Yes', the 'Yes' is a link that will pass the FEATURE_ID to another report that will show the Commitments for that Feature. If the "Commitment Exists" has a 'No' then no link.
I was also wondering if the Commitment report could open in a seperate window and make it modal?
I hope this is clear and someone could help me.
Please let me know if it's not clear or more information is needed.
Thanks,
JoeTo accomplish this I would build the link as part of the value. So if Yes the Yes itself would be a link, if No is simply text as today.
It would look something like this:
SELECT
,CASE WHEN ft.feature_id IN (SELECT cc.feature_id
FROM customer_commitments cc
WHERE ft.feature_id = cc.feature_id
THEN
'<a href="f?p=&APP_ID.:NEW_PAGE:&SESSION.::::Pn_FEATURE_ID:' || ft.feature_id || '">Yes</a>'
ELSE
'No'
END "Commitment Exists"
,ft.feature_id
FROM ....One problem with this approach is when you export the report (as a CSV for example). There are a few ways to handle this, one is to simply duplicate the column with clear text yes and no and set this column to be included on export and only visible on export. The other column, with the link, set it to no export.
The other option is to add another condition on the REQUEST value.
SELECT
,CASE WHEN ft.feature_id IN (SELECT cc.feature_id
FROM customer_commitments cc
WHERE ft.feature_id = cc.feature_id
THEN
decode(:REQUEST, 'CSV', 'Yes'
, '<a href="f?p=&APP_ID.:NEW_PAGE:&SESSION.::::Pn_FEATURE_ID:' || ft.feature_id || '">Yes</a>'
ELSE
'No'
END "Commitment Exists"
,ft.feature_id
FROM ....It seems that the link itself is getting replaced with a #. The link would look something like this:
'f?p=&APP_ID.:NEW_PAGE:&SESSION.::::Pn_FEATURE_ID:' || ft.feature_id
Hope this helps.
Oh and of course, in order for the link to display you need to change the Display Type to "Standard Report Column" otherwise the HTML will be escaped.
Thanks
-Jorge -
Changing the value of the SOAPElement in the SOAP message
Now another problem I encountered was of overwriting a value in the SOAP message by my value. SOAPElement interface which extends Node interface provides me the method getValue() to get the value of the node but doesnt give me any method to set any other value instead of this.
<token xsi:type="xsd:string">token123</token>
I want to replace the value "token123" with my value.
Is there no provision for altering a value in the SOAP message? Is this due to security contraints?
If yes then can we detach the same node and add a similar node with the new value. I wanted to try the same using addChildElements() method but then the problem here is how do I create a new SOAPElement in the handler as its an interface and not a class. Why I want to add a similar node is because I am having the definition of this object in the WSDL file, so if I attach the node corresponding to the parameter of the object then I would get the object populated with this value at J2EE or .net layer.
Also I thought of adding an attribute to the same node but then since this attribute will not be defined in the WSDL, the value of this attribute will not populate the java object at the J2EE layer. Hence attribute introduction also didnt help.
This is the userData object in the soap body:
</q1:FetchDetailsInput><q2:UserData xmlns:q2="java:com.anthem.enb.common.data" xsi:type="q2:UserData" id="id2">
<password xsi:type="xsd:string">12345</password>
<token xsi:type="xsd:string">token123</token>
<userID xsi:type="xsd:string">vikas123</userID>
</q2:UserData>
This is my code to extract the values from the above message:
Iterator i = ctx.getMessage().getSOAPPart().getEnvelope().getBody().getChildElements();
System.out.println(" i.hasNext() =" + i.hasNext());
while (i.hasNext())
Object obj = i.next();
System.out.println(" obj :" + obj.getClass());
if (obj instanceof SOAPElement)
SOAPElement e = (SOAPElement) obj;
System.out.println("e :" + e);
String operationName = e.getElementName().getLocalName();
LOG.info(CLASS_NAME + "operationName :" + operationName);
if (operationName.equals("UserData"))
Iterator j = e.getChildElements();
LOG.info(CLASS_NAME + " j.hasNext() : " + j.hasNext());
while (j.hasNext())
Object obj2 = j.next();
LOG.info(CLASS_NAME + " obj2 :" + obj2);
LOG.info(CLASS_NAME + " obj2 :" + obj2.getClass());
if (obj2 instanceof SOAPElement)
SOAPElement eGrandChild = (SOAPElement) obj2;
String operationName2 =
eGrandChild.getElementName().getLocalName();
if (operationName2.equals("userID"))
String strPass = eGrandChild.getValue();
LOG.info(CLASS_NAME + " strPass:" + strPass);
else if (operationName2.equals("password"))
String strUserID = eGrandChild.getValue();
LOG.info(CLASS_NAME + " strUserID:" + strUserID);
else if (operationName2.equals("token"))
String strToken = eGrandChild.getValue();
Please help.how do I create a new SOAPElement in the handler as its an interface and not a class?Here is an example:
<example>
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage m = messageFactory.createMessage();
SOAPEnvelope env = m.getSOAPPart().getEnvelope();
SOAPBody body = env.getBody();
SOAPElement fResponse =
body.addBodyElement(env.createName("fResponse"));
fResponse.addAttribute(env.createName("encodingStyle"),
"http://schemas.xmlsoap.org/soap/encoding/");
SOAPElement result =
fResponse.addChildElement(env.createName("result"));
result.addTextNode("test");
ctx.setMessage(m);
</example>
Jong -
Regarding round off the value in adf table
HI All,
My Requirement:
i have to round off the value after decimal in adf column before saving to data base.
Excample : 1234.67 = 1235
34567.89=34568
34567.34= 34567
i am using jdeveloper 11.1.1.3.0
Please can you give code using converter or any other strategy.
Thanks & Regards,
Madhu1. First of all you asked for rounding off, taking the integer part is not rounding off.
2. As per the documentation
integerOnly boolean Yes Flag specifying whether only the integer part of the value will be formatted and parsed. Default value is false.if i can understand correctly pertains to formatting only.
3. You can create a custom faces converter and add it to faces config.xml http://docs.oracle.com/javaee/1.4/tutorial/doc/JSFDevelop4.html . So that you do not have to write it in code.
4. If only integer is to be allowed why don't you change the data type to long or int instead of number
Maybe you are looking for
-
I need to import an xml file lookgin like this: <TABLE> <TABNAME>COMM_PRODUCT</TABNAME> <FIELDNAMES> <FIELDNAME>CLIENT</FIELDNAME> <FIELDNAME>PRODUCT_ID</FIELDNAME> </FIELDNAMES> </TABLE> The above XML has been created using the follo
-
Video file size triples when transferred from camera into FCP
I recorded about 16gb of video in avchd on a canon hf10. When I import it into fcp6 using pro ress 422, the file sizes are enormous, about 100 gb from the original 16. How did this happen and how do I shrink my finished project it back down to fit on
-
Since updating the software on my iphone 6, the video no longer works. The screen freezes and the only way to fix this is to turn it off and back on again.
-
Best way to have multiple arrangements in one project file?
Hello everybody, I am trying to figure out a smart way of having multiple arrangements associated with one project. More importantly, this would allow me to have multiple arrangements associated with the same pool of audio files in one audio window -
-
Hiding app won't hide the app, except at some random time later on
I've got this problem where hiding an application wont' hide it. You invoke HIDE and nothing happens. Then a while later the application hides and it's gone FOREVER. You can't get it back. You have to force quit it. 10.5 has some serious problems wit