Xsl fo doubt for instr function
Can anyone please advice if I can use instr and substring functions in xsl fo?
my issue is that i have a lon email address which needs to be wrapped up in 2 lines
Always my email ends with 'v'
So I tried to do this
<xsl:value-of select="substring(BUYER_CONTACT_EMAIL,1,instr(BUYER_CONTACT_EMAIL,'@'))"/>
<xsl:value-of select="substring(BUYER_CONTACT_EMAIL,instr(BUYER_CONTACT_EMAIL,'@')+1,instr(BUYER_CONTACT_EMAIL,'v',-1))"/>
It throwed me error
Any idea
KP
Instead of
<xsl:value-of select="substring(BUYER_CONTACT_EMAIL,1,instr(BUYER_CONTACT_EMAIL,'@'))"/>
use
<xsl:value-of select="substring-before(BUYER_CONTACT_EMAIL,'@')"/> <xsl:value-of select="substring-after(BUYER_CONTACT_EMAIL,'@')"/>
Similar Messages
-
Help needed for Instr function
Hi,
I using instr function to find the delimiter '|' .the function does retrives value , if the character contains
special charcater. (i.e)INSTR('Carán|','|',1,6) returns
only zero as the value , which is not correct. kindly suggest me some solution for the above problem.
Thanks in advance.By INSTR('Carán|','|',1,6) , you are trying to find location of 6th occurance of special character '|' . Since there is no such occurence, it is returning 0.
sql> select instr('Caran|','|') from dual;
INSTR('CARAN|','|')
6
Thanks -
Error while using CURRENTMEMBER property in INSTR function
Hi,
I am looking for SQL 'LIKE' operator equivalent solution in MDX and I tried the below query.
SELECT FILTER([Company].Members, INSTR([Company].CURRENTMEMBER.NAME,"AA") >0) on columns from temp1.db
The above query is not compiling due to CURRENTMEMBER propery in INSTR function.
When I replaced [Company].CURRENTMEMBER.NAME with a constant "AABB", then the query is working fine.
SELECT FILTER([Company].Members, INSTR("AABB","AA") >=0) on columns from temp1.db
Also, CURRENTMEMBER is working fine outside INSTR function.
SELECT FILTER([Company].Members, [Company].CURRENTMEMBER.[GEN_NUMBER] = 1) DIMENSION PROPERTIES GEN_NUMBER on columns from temp1.db
Is CURRENTMEMBER property not supported in INSTR? I am using Hyperion Provider Services 9.3.1.
Is there any other solution for SQL 'LIKE' operator equivalent in MDX?
Thanks in advance,
Anil.With Essbase 9.3.1 it ought to work. The following is a simple query that works for me:
select
filter (
[Market].Members,
Instr (1,
[Market].CurrentMember.MEMBER_NAME,
"e"
) > 0
) on axis(0)
from [Sample.Basic]
; -
Hi all,
I want to use decode function in RTF template.
I know i can use if statement to deal with it ,but if the conditions are over 3, if statement is not good choice.
Here is the if condition statement
<?if:answer='Y'?>Yes<?end if?> <?if:answer='N'?>No<?end if?>
how can i translate this if statement to use decode function
I tried to use the statement as below, but it doesn't work.
<?xdofx:decode(:answer,Y,'YES',N,'NO')?>
using this statement i got empty in this field.
I appreciate any responds, thanks in advance.
appcatHi,
it should work,coz there is no xsl equivalent for this function that i have seen on blogs,
the syntax that i have got it from other xmlp blogs, sounds like you put correct syntax, try to give multiple conditions to check the result
<?xdofx:decode(’xxx’,’bbb’,’ccc’,’xxx’,
’ddd’)?>
srinuk -
Dynamic PL/SQL & substr, instr function
I am having trouble with incorporating the SUBSTR and INSTR functions into my dynamic PL/SQL procedure using Oracle 8i.
I have data that is packed into one column seperated by a delimiter (':')
I need to seperate the data to use indicidual pieces.
If I run my query in general -
select substr(secondcol, 1, instr(secondcol, ':',1,1)-1) ONE,
substr(secondcol,instr(secondcol, ':',1,1)+1,instr(secondcol, ':',1,1)-1) TWO,
substr(secondcol,instr(secondcol, ':',1,2)+1,instr(secondcol, ':',1,1)-1) THREE,
substr(secondcol,instr(secondcol, ':',1,3)+1,instr(secondcol, ':',1,1)-1) FOUR
from temp_table where firstcol=100
This works and gives me the right result.
e.g
DATA :
Firstcol SECONDCOL
100 1:2:3:4
Result:
ONE TWO THREE FOUR
1 2 3 4
However to make this generic if I use it in a function passing it a parameter which has ':' delimited data it does not work and gives me errors. All I want is to get the output as a string that looks like my query above so I can use it in my proc.
create or replace function MYJUNK(TFieldNew IN CHAR)
RETURN CHAR IS
UpdateString Varchar2(100);
BEGIN
UpdateString := 'First=substr('||TFieldNew||', 1, instr('||TFieldNew||', '':'',1,1)-1) ONE, ';
UpdateString := UpdateString || ' Second=substr('||TFieldNew||', instr('||TFieldNew||', '':'',1,2)+1, instr('||TFieldNew||', '':'',1,1)-1) TWO, ';
UpdateString := UpdateString || ' third=substr('||TFieldNew||', instr('||TFieldNew||', '':'',1,3)+1, instr('||TFieldNew||', '':'',1,1)-1) THREE from temp_table';
return UpdateString;
END;
The function compiles but gives me run time errors
This is what I get -
SQL> select myjunk('''1:2:3:4''') from dual;
select myjunk('''1:2:3:4''') from dual
ERROR at line 1:
ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "SGHDTA.MYJUNK", line 8
ORA-06512: at line 1You are getting an error because updatestring is longer than the 100 characters you defined it as. Try using VARCHAR2(4000). Also, if you are trying to generate the sql statement, you need to get rid of first=, second= and third= when you build the string.
This is what your function returns. I put in line breaks for clarity:
First=substr('1:2:3:4', 1, instr('1:2:3:4', ':',1,1)-1) ONE,
Second=substr('1:2:3:4', instr('1:2:3:4', ':',1,2)+1, instr('1:2:3:4',':',1,1)-1) TWO,
third=substr('1:2:3:4', instr('1:2:3:4', ':',1,3)+1,instr('1:2:3:4', ':',1,1)-1) THREE
from temp_tableIf you are trying to actually parse the column, then you need something more like:
create or replace procedure MYJUNK(TFieldNew IN VARCHAR2,out1 OUT VARCHAR2,
out2 OUT VARCHAR2, out3 OUT VARCHAR2) is
BEGIN
out1 := SUBSTR(TFieldNew,1, INSTR(TFieldNew,':',1,1)-1);
out2 := SUBSTR(TFieldNew, INSTR(TFieldNew,':',1,2)+1, INSTR(TFieldNew,':',1,1)-1);
out3 := SUBSTR(, INSTR(TFieldNew,':',1,3)+1, INSTR(TFieldNew,':',1,1)-1);
END; -
How to use instr functions?
Hi guys,
I have a table like this:
name data
a 10101000U000
b 011U11001100
c 0U1001001001
d 01U010100010
I want to get the position of "U" in data column, like:
name position of U
a 9
b 4
c 2
d 3
what should I do? I use "instr" function, but failed. can anyone help me on this?
Thanks.Example for you:
[email protected]> select instr('10101000U000','U') from dual;
INSTR('10101000U000','U')
9
[email protected]> select instr('011U11001100','U') from dual;
INSTR('011U11001100','U')
4
Best Regards
Krystian Zieja / mob -
For Each function for a Concat Value
Hi:
The scenario is, we need to concat two unbounded elements and map it to a target element using for each functionality.
For example
<BookStore>
<Books>
<Name>NAME1</Name>
<Author>AUTHOR1</Author>
<BookId>1</BookId>
<Quantity>2</Quantity>
<Price></Price>
<Status></Status>
<Books>
<Books>
<Name>NAME2</Name>
<Author>AUTHOR2</Author>
<BookId>2</BookId>
<Quantity>2</Quantity>
<Price></Price>
<Status></Status>
<Books>
</BookStore>
I need to concat "Name" and "Author" which is under the unbounded element "BookStore" and map it to a single element called "Sample" on the Target side.
I am not able to use the "for-each" XSLT function to get the multiple value of Name and Author since concat function is used. Is there any other way to concat and get the multiple values of the element "Name" and "Author"?
Regards
RKHi Vlad:
Ok i use for-each function in my XSLT to get the vlaues of unbounded elements
eg:
<xsl:for-each select="/BookStore/Books/Name">
<request:Sample>
<xsl:value-of select="/BookStore/Books/Name"/>
</request:Sample>
</xsl:for-each>
This works perfectly fine and whenever there is a multiple vlaue for Name it is mapped to Sample and output comes as expected
<Sample>NAME1</Sample>
<Sample>NAME2</Sample>
Now i need to concat the Name and Author and pass the value to element on the target. Since name and author occuring multiple times, i am not sure how to pass the values to the element on the target -
How can I get an execution plan for a Function in oracle 10g
Hi
I have:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
I would like to know if is possible to get an EXECUTION PLAN for a FUNCTION if so, how can I get it ?
RegardsYou can query the AWR data if your interesting SQL consumes enough resources.
Here is a SQL*Plus script I call MostCPUIntensiveSQLDuringInterval.sql (nice name eh?)
You'll need to know the AWR snap_id numbers for the time period of interest, then run it like this to show the top 20 SQLs during the interval:
@MostCPUIntensiveSQLDuringInterval 20The script outputs a statement to run when you are interested in looking at the plan for an interesting looking statement.
-- MostCPUintesticeSQLDuringInterval: Report on the top n SQL statements during an AWR snapshot interval.
-- The top statements are ranked by CPU usage
col inst_no format 999 heading 'RAC|Node'
col sql_id format a16 heading 'SQL_ID'
col plan_hash_value format 999999999999 heading 'Plan|hash_value'
col parsing_schema_name format a12 heading 'Parsing|Schema'
col module format a10 heading 'Module'
col pct_of_total format 999.99 heading '% Total'
col cpu_time format 999,999,999 heading 'CPU |Time (ms)'
col elapsed_time format 999,999,999 heading 'Elapsed |Time (ms)'
col lios format 9,999,999,999 heading 'Logical|Reads'
col pios format 999,999,999 heading 'Physical|Reads'
col execs format 99,999,999 heading 'Executions'
col fetches format 99,999,999 heading 'Fetches'
col sorts format 999,999 heading 'Sorts'
col parse_calls format 999,999 heading 'Parse|Calls'
col rows_processed format 999,999,999 heading 'Rows|Processed'
col iowaits format 999,999,999,999 heading 'iowaits'
set lines 195
set pages 75
PROMPT Top &&1 SQL statements during interval
SELECT diff.*
FROM (SELECT e.instance_number inst_no
,e.sql_id
,e.plan_hash_value
,e.parsing_schema_name
,substr(trim(e.module),1,10) module
,ratio_to_report(e.cpu_time_total - b.cpu_time_total) over (partition by 1) * 100 pct_of_total
,(e.cpu_time_total - b.cpu_time_total)/1000 cpu_time
,(e.elapsed_time_total - b.elapsed_time_total)/1000 elapsed_time
,e.buffer_gets_total - b.buffer_gets_total lios
,e.disk_reads_total - b.disk_reads_total pios
,e.executions_total - b.executions_total execs
,e.fetches_total - b.fetches_total fetches
,e.sorts_total - b.sorts_total sorts
,e.parse_calls_total - b.parse_calls_total parse_calls
,e.rows_processed_total - b.rows_processed_total rows_processed
-- ,e.iowait_total - b.iowait_total iowaits
-- ,e.plsexec_time_total - b.plsexec_time_total plsql_time
FROM dba_hist_sqlstat b -- begining snap
,dba_hist_sqlstat e -- ending snap
WHERE b.sql_id = e.sql_id
AND b.dbid = e.dbid
AND b.instance_number = e.instance_number
and b.plan_hash_value = e.plan_hash_value
AND b.snap_id = &LowSnapID
AND e.snap_id = &HighSnapID
ORDER BY e.cpu_time_total - b.cpu_time_total DESC
) diff
WHERE ROWNUM <=&&1
set define off
prompt to get the text of the SQL run the following:
prompt @id2sql &SQL_id
prompt .
prompt to obtain the execution plan for a session run the following:
prompt select * from table(DBMS_XPLAN.DISPLAY_AWR('&SQL_ID'));
prompt or
prompt select * from table(DBMS_XPLAN.DISPLAY_AWR('&SQL_ID',NULL,NULL,'ALL'));
prompt .
set define on
undefine LowSnapID
undefine HighSnapIDI guess you'll need the companion script id2sql.sql, so here it is:
set lines 190
set verify off
declare
maxDisplayLine NUMBER := 150; --max linesize to display the SQL
WorkingLine VARCHAR2(32000);
CurrentLine VARCHAR2(64);
LineBreak NUMBER;
cursor ddl_cur is
select sql_id
,sql_text
from v$sqltext_with_newlines
where sql_id='&1'
order by piece
ddlRec ddl_cur%ROWTYPE;
begin
WorkingLine :='.';
OPEN ddl_cur;
LOOP
FETCH ddl_cur INTO ddlRec;
EXIT WHEN ddl_cur%NOTFOUND;
IF ddl_cur%ROWCOUNT = 1 THEN
dbms_output.put_line('.');
dbms_output.put_line(' sql_id: '||ddlRec.sql_id);
dbms_output.put_line('.');
dbms_output.put_line('.');
dbms_output.put_line('SQL Text');
dbms_output.put_line('----------------------------------------------------------------');
END IF;
CurrentLine := ddlRec.sql_text;
WHILE LENGTH(CurrentLine) > 1 LOOP
IF INSTR(CurrentLine,CHR(10)) > 0 THEN -- if the current line has an embeded newline
WorkingLine := WorkingLine||SUBSTR(CurrentLine,1,INSTR(CurrentLine,CHR(10))-1); -- append up to new line
CurrentLine := SUBSTR(CurrentLine,INSTR(CurrentLine,CHR(10))+1); -- strip off up through new line character
dbms_output.put_line(WorkingLine); -- print the WorkingLine
WorkingLine :=''; -- reset the working line
ELSE
WorkingLine := WorkingLine||CurrentLine; -- append the current line
CurrentLine :=''; -- the rest of the line has been processed
IF LENGTH(WorkingLine) > maxDisplayLine THEN -- the line is morethan the display limit
LineBreak := instr(substr(WorkingLine,1,maxDisplayLine),' ',-1); --find the last space before the display limit
IF LineBreak = 0 THEN -- there is no space, so look for a comma instead
LineBreak := substr(WorkingLine,instr(substr(WorkingLine,1,maxDisplayLine),',',-1));
END IF;
IF LineBreak = 0 THEN -- no space or comma, so force the line break at maxDisplayLine
LineBreak := maxDisplayLine;
END IF;
dbms_output.put_line(substr(WorkingLine,1,LineBreak));
WorkingLine:=substr(WorkingLine,LineBreak);
END IF;
END IF;
END LOOP;
--dbms_output.put(ddlRec.sql_text);
END LOOP;
dbms_output.put_line(WorkingLine);
dbms_output.put_line('----------------------------------------------------------------');
CLOSE ddl_cur;
END;
/ -
Convert varchar to date in BO Universe with Substring and instring function
to_date(substr(xxxx_v.e_details,instr(xxxx_v.e_details,'|',1,2)+1,9),'DD-MM-YYYY') In the universe while defining the object as date i was facing probs can any body help me out. the column xxxx_e_details is having the datatype varchar in database and the third string is date while i was creating the date object in the universe with the above syntax it was getting the error
The data in this obect is like this xxxx_v.e_details -> wwww|eeee|MM-DD-YY|
Edited by: mohammed kashif on Mar 31, 2011 11:47 AMi am getting the data but it is in the format 01-03-0201. The year format for 2010 is populating as 0201. i am not able to think whether it is due to instring function which is reading data like this. Need suggestion from experts.............
-
Set variable to result of instr function
I am trying to set a variable to the result of the instr function. I am getting the error Caused by: oracle.xdo.parser.v2.XPathException: Namespace prefix 'xdofx' used but not declared.
My code is as is below <?xdoxslt:set_variable($_XDOCTX,’POS1’, xdofx:Instr (LINE_ITEM_DESCRIPTION,'|',1,1))?>
I know in the documentation it says "You cannot mix xdofx statements with XSL expressions in the same context" is this such a case? If so how do I go about getting the result of Isntr into a variable?
Thanks a tonTry using the below code
<?xdoxslt:set_variable($_XDOCTX,’POS1’, xdoxslt:instr(LINE_ITEM_DESCRIPTION,'|',1,1))?> -
Hi,
I noticed in examples that when the INSTR function is used items and the search strings are preceeded/followed by ':'|| and ||':' and I was just wondering why this is so. Does this not just add a : to the start and finish of the item and string? Is there an advantage over just coding it like so:
instr(upper(OBJECT_ID), upper(:P18_OBJECT_ID)) > 0)
rather than
instr(':'||:P18_STATUS||':',':'||STATUS||':') > 0
Cheers,
simon.Simon,
I don't know about the instr vs. like question. For the other question, I've seen this used mostly for checking for the presence of a token within a colon-delimited string of values. Consider:
******** Right Answer ********
SQL> select 1 from dual where instr(':'||'CREATE:UPDATE:DELETE:'||':', ':'||'CREATE'||':') > 0;
1
1
******** Wrong Answer ********
SQL> select 1 from dual where instr('CREATE:UPDATE:DELETE:', ':'||'CREATE'||':') > 0;
no rows selected
******** Right Answer ********
SQL> select 1 from dual where instr(':'||'CREATE:UPDATE:APPLY_CHANGES:DELETE:'||':', ':'||'APPLY'||':') > 0;
no rows selected
******** Wrong Answer ********
SQL> select 1 from dual where instr(':'||'CREATE:UPDATE:APPLY_CHANGES:DELETE:'||':', 'APPLY') > 0;
1
1
Scott -
Help - Class name and descriptions for a function location.
Hi Guys
i have to write a report that displays the class and class descriptions for a function location. the user passes in either the function location(TPLNR) or the class name and the report should display the the class characteristics and resp. values. Is there a FM that i coud use?
please help.
many thanks.
seelan.sadiepu1 wrote:
When I set up Words with Friends on my Fire it asked for my username and password which from a previous reply to my inquiry above stated that the S 3 doesn't store due to privacy issues. I have tried all my usual combinations of usernames and passwords and my Fire won't let me access the game as it keeps telling me that one or the other is not correct. I have deleted the app from my Fire and re-downloaded it but have the same error comes up. I have accessed the Words with Friends support both on my phone and their website but there is no live chat. I might have to take both to a Verizon store. Also, my Fire won't let me access the game without a correct username and password. To say that I am frustrated would be an understatement as well I have tried everything I can think of with no luck! Thanks for any help you can give!
Did you use facebook to log in?
Verizon will not be able to help you retrieve any of the information you need. You will have to contact Zynga. -
Hi Friends
I am having performance issue for this function-module(HR_TIM_REPORT_ABSENCE_DATA) and one my client got over 8 thousend employees . This function-module taking forever to read the data. is there any other function-module to read the absences data IT2001 .
I did use like this .if i take out this F.M 'HR_TIM_REPORT_ABSENCE_DATA_INI' its not working other Function-module.please Suggest me .
call function 'HR_TIM_REPORT_ABSENCE_DATA_INI'
exporting "Publishing to global memory
option_string = option_s "string of sel org fields
trig_string = trig_s "string of req data
alemp_flag = sw_alemp "all employee req
infot_flag = space "split per IT neccessary
sel_modus = sw_apa
importing
org_num = fdpos_lines "number of sel org fields
tables
fieldtab = fdtab "all org fields
field_sel = fieldnametab_m. "sel org fields
To Read all infotypes from Absences type.
RP_READ_ALL_TIME_ITY PN-BEGDA PN-ENDDA.
central function unit to provide internal tables: abse orgs empl
call function 'HR_TIM_REPORT_ABSENCE_DATA'
exporting
pernr = pernr-pernr
begda = pn-begda
endda = pn-endda
IMPORTING
SUBRC = SUBRC_RTA
tables
absences = absences_01
org_fields = orgs
emp_fields = empl
REFTAB =
APLTAB =
awart_sel_p = awart_s[]
awart_sel_a = awart_s[]
abstp_sel = abstp_s[]
i0000 = p0000
i0001 = p0001
i0002 = p0002
i0007 = p0007
i2001 = p2001
i2002 = p2002
i2003 = p2003.
Thanks & Regards
Reddyguessing will not help you much, check with SE30 to get a better insight
SE30
The ABAP Runtime Trace (SE30) - Quick and Easy
what is the total time, what are the Top 10 in the hitlist.
Siegfried -
How to check for a function module with its description and functionality
Hi all,
How to check for a function module,with its description and its functionality,in detail how can I know the purpose of a particular function module,how to search for a function module which suits my requirement .Hi,
You can search a FM of your requirement by putting in the Key words and searching for a FM. Like * KEYWORD * and then pressing F4.
Say for example you need to search something regarding converstion.
Search for * CONVERT * and press F4.
If there is something specfic like converting date to something you can give
DATE * CONVERT *
OR
CONVERT * DATE * and press F4.
Once you narrow down your search you will have a Function module documentation inside the Function module. Please note that all the FMs willl not have documentation.
Regards,
Pramod -
Required to get class Charateristics and values for an functional location
Hi ,
As per the requirement ,i have to read the class characteristics and the corresponding values for an function location.I have functional location number ,and the various class names associated with fn.location. Any pointers would be helpful
Regards
Arun TFM BAPI_OBJCL_GETDETAIL
OBJECTKEY ?0100000000000011643
OBJECTTABLE IFLOT
CLASSNUM ZPMI_BLDG
CLASSTYPE 003
KEYDATE 29.07.2009
UNVALUATED_CHARS
LANGUAGE EN
Cheers!
Maybe you are looking for
-
A/R Invoice and Drafts.
Hi peoples, Where the SOB save draft for lots for A/R invoce? Thanks all.
-
N97 can no longer connect to ovi store via wlan??
Hi there since the recent update on the N97 i have not been able to connect to the ovi.store via wlan. before the update i was always asked if i wanted to connect via contract wap of my wireless network. I have gone all through the settings and there
-
'Count all rows' in Disco Plus?
Hi all - I can't find an option to Count All Rows in disco plus. This is something my users use all the time in Desktop - is it included in Plus? In Desktop, it is under menu item 'Sheet' Thanks! Scott
-
How to create select-options in my own screen?
Hi I create my screen and i wish to place select-options on screen. how to do that?
-
Smartview cascade button disabled
I'm having problems with cascade button in "oracle hyperion smartview for office, fusion edition", version 11.1.2.1.000. the cascade button is sometime not clickable. For that users the button is available when opening Excel Office for the first time