Using substring function in the Universe
What is the correct syntax of using the substring function in the Universe?
I need to extract the numbers and decimal between the #'s, and the character length varies:
From: DOE, JOHN Added the following entry to work history:
A1S#0.25#
To: 0.25
Please help! Thanks!
There are ticket details in the text - I replaced certain letters with x, o, or a. I thought you would need the total number of characters in the text.
0.25#"
DOE, JOHN A Xddxd xxx xxllxwOIg xIxxI xx wxxk xOXxxxI:
A1S#0.25#"O xxxxd Oxck xxxm CJ, xx XxOd xxxx wx xxx XuppxXxd xx Ox gxxxOIg xlxxxX xI xxOX. Xx, xxx quxXxOxI xxmxOIX wxxx xx dx Ixw? XOxxxx wx mxkx xxx dxcOXOxI xx OgIxxx xxOX cxIdOxOxI xId xxvx Ox xxmxvxd xxxm XmxxxX, xx wx xxI xx xxXxxxcx xxp xxlkxxX xId Xxx Ox wx cxI Xxxp Xxmx xx xxx xxxxxOc, xx wx xxdxx x OOggxx cOxcuOx xx xxIdlx xxx OuxXxX wOxxxux xII dxxpX. O'll xxI xx xuI xxOX OI mxIxgxmxIx xId xxx xxXx xx xxx xxxm xx Xxx wxOcx wxI wx wxIx xx gx".
1#"
DXX, JXXN X XddXd xxX xxllxAxng XnxrN xx Axrk xxAxxrN:
A1S#1#"X dxn'x AXX xxxA xn AxnAxrd. X AxA gxxng xx AxXAk xxX xnxXrxxAX xx AXX xx ApxkXA xn xxrxugxpux AXrX xbAXrvXd xA xxA bXXn AuggXAxXd, xxAXvXr, xxA nxx xn AxnAxrd. X AxXAkXd Dxrx xnd dxn'x AXX xnN xndxAxxxxn xxxx xxxA xA xn xnN xlxrI grxupA xxr xxrXAxxld Ixnxxxrxng, Ax X'I AxndXrxng AxXrX xxX xlxrI xA AxIxng xrxI. Xx Axuld bX xxxx xxXrX xA nx xnxXnxxxn xx bX xlxrIxng xn xxxA xx xll xnd xxX xlxrIA Axuld bX AxIxng xrxI xn xld Ixnxxxrxng AxurAX xxxx xA nx lxngXr vxlxd (xX, xxxA AlxppXd xxrxugx xxX ArxAkA AxIXxxA). X AXnx xn XIxxl xx AurxxA JxnXA xx AXX xx xX Axn xXll Axxx xxX AxurAX xx xxX xlxrI xA (xX, Axxx Ixnxxxrxng ANAxXI xAxuxllN gXnXrxxXd xxX xlxrI)."
0.5#
DOE, JOHN A Xaaxa xax OolloxixI xxxIx xo xoIk aisxoIx:
A1S#.05# "XIxxsOxIIixI xo IXS XixI x quxux OoI xaaixioxxl ixOoIoxxiox xxa Ixcoooaxxioxs."
Similar Messages
-
Using substring function in the dashboard prompt
Hi,
I want to use a function in the dashboard prompt.
Example: Subject Area:Paint --> Products --> Color
I want to take second letter of color, describe a label for it and use this label in prompt. The formula is below;
CASE WHEN (SUBSTRING(Products.Color FROM 2 FOR 1) = 'a') THEN 'AAA' ELSE 'BBB' END
Dashboard prompt should list 3 choices; All choices, AAA, BBB.
When selecting AAA in the prompt, these colors should be listed in the request; Carriage House Red, Dante, Manchester Red.
I created a dashboard prompt (add a function) and a request. When selecting AAA in the prompt, it sends "AAA" as prompt, not sends "a". So I couldn't reach the result.
Is it possible? Could anyone help me ASAP?
Thanks & Best Regards,Create a column in the logical layer using the same formula that you described. Then use the new column in the prompt. Then add the new column to the report as 'is prompted'.
-
How to use Substring function with Case statement.
Hello Everyone,
I have one requirement where I have to use substring function on the field for report criteria.
E.G.
I have Branch Name Field where I have all branch names information, Now some of the branch names are too big with some extension after the name .
now i want to substing it but the character length varies for each branch.
so is there any way where we can use case statement where we can define that if branch name character are exceeding some value then substing it with this length.Try something like this:
CASE WHEN LENGTH(tablename.Branch_Name) > n THEN SUBSTRING(...) ELSE tablename.Branch_Name END
where n is the number of characters you want to start the break. -
Using substr function loses index. Query tune help
Hi
when i use substr function in the join condition it loses index and the query is slow. How to fix this problem or tune this query. These are the lines in the query.
and substr(a.invoice_num,1,9) = l.invoice_num
and substr(c.invoice_num,1,9) = mgr_apprv_lst.user_key
and substr(c.invoice_num,1,9) = pbl_apprv_lst.user_key
select
pap.full_name employe_name,
k.SEGMENT1 ||'.' ||k.segment2 Cost_Center,
a.invoice_num Invoice_Number,
b.item_description Line_Item,
b.amount Amount,
cc.trx_id Corporate_Card_Transaction_Id,
cc.transaction_date Date_Charge_Incurred,
cc.posted_date Date_Charge_Posted_To_USBank,
cc.creation_date Date_Posted_To_IExpense,
a.creation_date Expense_Report_Creation_Date,
l.report_submitted_date Expense_Report_Submitted_Date,
mgr_apprv_lst.activity_begin_date Managers_Approval_Begin_Date,
mgr_apprv_lst.activity_end_date Managers_Approval_End_Date,
pbl_apprv_lst.activity_begin_date AP_Approval_Begin_Date,
pbl_apprv_lst.activity_end_date AP_Approval_End_Date,
e.check_date Payment_Date_To_USBank,
e.check_number Payment_Number,
mgr_apprv_lst.activity_result_display_name Managers_Process_Result,
pbl_apprv_lst.activity_result_display_name AP_Process_Result
from
ap_checks_all e,
ap_invoice_payments_all d,
ap_invoices_all c,
ap_expense_report_headers_all a,
ap_credit_card_trxns_all cc,
per_all_people_f pap,
ap_expense_report_headers_all l,
ap_expense_report_lines_all b,
gl_code_combinations k,
(select ias1.user_key,
ias1.activity_result_display_name,
ias1.activity_begin_date,
ias1.activity_end_date
from wf_item_activity_statuses_v ias1,
(select c1.invoice_num
from ap_checks_all e1,
ap_invoice_payments_all d1,
ap_invoices_all c1
where trunc(e1.check_date) between nvl(:From_Date, trunc(e1.check_date))
and nvl(:To_Date, trunc(e1.check_date))
and e1.org_id = 141
and e1.void_date IS null
and d1.check_id = e1.check_id
and c1.invoice_id = d1.invoice_id) inv_lst1
where ias1.item_type = 'APEXP'
and ias1.user_key = inv_lst1.invoice_num
and ias1.activity_name = 'AP_MANAGER_APPROVAL_PROCESS') mgr_apprv_lst,
(select ias2.user_key,
ias2.activity_result_display_name,
ias2.activity_begin_date,
ias2.activity_end_date
from wf_item_activity_statuses_v ias2,
(select c2.invoice_num
from ap_checks_all e2,
ap_invoice_payments_all d2,
ap_invoices_all c2
where trunc(e2.check_date) between nvl(:From_Date, trunc(e2.check_date))
and nvl(:To_Date, trunc(e2.check_date))
and e2.org_id = 141
and e2.void_date IS null
and d2.check_id = e2.check_id
and c2.invoice_id = d2.invoice_id) inv_lst2
where ias2.item_type = 'APEXP'
and ias2.user_key = inv_lst2.invoice_num
and ias2.activity_name = 'AP_PAYABLES_APPROVAL_PROCESS') pbl_apprv_lst
where
trunc(e.check_date) between nvl(:From_Date, trunc(e.check_date))
and nvl(:To_Date, trunc(e.check_date))
and e.org_id = 141
and e.void_date IS null
and d.check_id = e.check_id
and c.invoice_id = d.invoice_id
and a.invoice_num = c.invoice_num
and a.source = 'CREDIT CARD'
and a.employee_id = nvl(:Emp_id,a.employee_id)
and a.report_header_id = b.report_header_id
and cc.trx_id = b.credit_card_trx_id
and pap.person_id = a.employee_id
and pap.effective_start_date <= trunc(sysdate)
and pap.effective_end_date >= trunc(sysdate)
and k.code_combination_id = b.code_combination_id
and k.segment2 between nvl(:From_Cost_Center,k.segment2)
and nvl(:To_Cost_Center,k.segment2)
and substr(a.invoice_num,1,9) = l.invoice_num
and substr(c.invoice_num,1,9) = mgr_apprv_lst.user_key
and substr(c.invoice_num,1,9) = pbl_apprv_lst.user_keyHi
If I understood correctly your logic, and if the columns involved are of type varchar2, you can use the like operator:
and a.invoice_num like l.invoice_num || '%'
and c.invoice_num like mgr_apprv_lst.user_key || '%'
and c.invoice_num like pbl_apprv_lst.user_key || '%'In this case, Oracle will be able to use the indexes. If they are numeric, you need to do something like:
and a.invoice_num between l.invoice_num * 1000000
and l.invoice_num * 1000000 + 999999I hope this makes sense...
Luis -
SUBSTR function in the where clause
HI
I want to get a number of 15 digits from a column where the user only know the last 10 digits.
So that when the user enter a number with 10 digits, only the record of that specific number should be displayed.
And then when the user did not enter any number all the records in the table should be displayed.(this part works fine)
The problem is: when the user enters any last digits( last, second last, thirth last and so on) the records which satisfy this are retrieved, which is not supose to be the case.
I' am trying to use the substr function in the where clause but I'm not sure if it's working or not becasue the result of the query is just the same as before i used the substr.
Thanksbetter to pad with '*' me thinks in case u have a number ending with 0's:
1 select empno,ename
2 from emp
3* where empno like '%'||lpad('&1',2,'*')
SQL> /
Enter value for 1: 0
old 3: where empno like '%'||lpad('&1',2,'*')
new 3: where empno like '%'||lpad('0',2,'*')
no rows selected
SQL> /
Enter value for 1: 00
old 3: where empno like '%'||lpad('&1',2,'*')
new 3: where empno like '%'||lpad('00',2,'*')
EMPNO ENAME
7900 JAMES
SQL> /
Enter value for 1:
old 3: where empno like '%'||lpad('&1',2,'*')
new 3: where empno like '%'||lpad('',2,'*')
EMPNO ENAME
7369 SMITH
7499 ALLEN
7521 WARD
7566 JONES
7654 MARTIN
7698 BLAKE
7782 CLARK
7788 SCOTT
7839 KING
7844 TURNER
7876 ADAMS
EMPNO ENAME
7900 JAMES
7902 FORD
7934 MILLER
14 rows selected. -
Using substring function with error
Hi Guys,
I have a source field with 1200 characters which need to map to multiple target segments for 132 count of this source field.
This is not a mandatory field so it sometimes come without any value.
I am using substring function to breakout the string for every 132 characters and mapped to the target segments.
There are two problems, first it seems that if source is blank, there will be error.
Second, if source field come with only eg. 300 characters, error will also occurs.
I have searched thru SDN and try some of the UDF but to no avail.
Appreciate your guidance on this problem.
Regards
FNGH Rahul,
I have tried your quote but face some syntax error as follows
Function calculate, Line 6:
cannot find symbol symbol : method length() location: class java.lang.String[] j = input.length();
Function calculate, Line 26:
cannot find symbol symbol : method subString(int,int) location: class java.lang.String[]
result.addValue(input.subString(0,EndIndex)); ^
Function calculate, Line 34:
cannot find symbol symbol : method subString(int,int) location: class java.lang.String[] result.addValue(input.subString(StartIndex,EndIndex)); ^
Function calculate, Line 40:
cannot find symbol symbol : method subString(int,int) location: class java.lang.String[] result.addValue(input.subString(StartIndex,EndIndex)); ^ Note: /usr/sap/D03/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd66a3a60002911e09ba9e41f132d6b68/source/com/sap/xi/tf/_MM_MT_COMS_TO_ZME_CRE_CHG_CONTRACT_.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /usr/sap/D03/DVEBMGS00/j2ee/cluster/server0/./temp/classpath_resolver/Mapd66a3a60002911e09ba9e41f132d6b68/source/com/sap/xi/tf/_MM_MT_COMS_TO_ZME_CRE_CHG_CONTRACT_.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 4 errors -
How to use SQL functions in the queries
hey guys i wanna know how to use SQL functions in the queries is it possible or not .
Hi,
Wat exactly that set values are?
those from sql query?
How to use count():
The COUNT() function returns the number of rows that matches a specified criteria.
SQL COUNT(column_name) Syntax
The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column:
SELECT COUNT(column_name) FROM table_name
SQL COUNT(*) Syntax
The COUNT(*) function returns the number of records in a table:
SELECT COUNT(*) FROM table_name
SQL COUNT(DISTINCT column_name) Syntax
The COUNT(DISTINCT column_name) function returns the number of distinct values of the specified column:
SELECT COUNT(DISTINCT column_name) FROM table_name
The IN function helps reduce the need to use multiple OR conditions.
The syntax for the IN function is:
SELECT columns
FROM tables
WHERE column1 in (value1, value2, .... value_n); -
How to use db2 function in the HQL
hello
i am newbie to hibernate, now i am choosing a solution for my project, in this project, it use db2 function in the sql clause as follow:
insert into idstool.access(userid,node,password) values('userid','nodename',encrypt('password','nodename'));
i wonder if i can implement such function by using hibernate, that is if hibrenate can use the db2 function, or user-defined sql functions? if yes, how?
thanks for any helpsI think you'll find that you can do this through HQL. You also have the option of invoking a stored procedure or invoking native SQL in tandem with the normal Hibernate options.
-
Is it ok to buy student version of CC and i use it mainly for the University ... But i sometimes design (Logos, Posters .. etc..) for my friends and other peoples and i charge them for it ? ... is legal ? because i really care about this small details.
You are allowed to use student/teacher version for commercial purposes.
Education FAQ -
Substring Function without the length!
I know I have seen this before, but cannot find it when searching.
I need to do something similar to the Substring function, where I start from position 4, but the length behind this position is variable. Due to the IDOC it only passes the value...
I think I possibly saw a UDF for this somewhere - unless I can use some standard mapping!
It is probably very simple - but it is late in the day and my eyes are square! = )
<i> I need a drink......</i>
Can anyone help?
Message was edited by:
Barry NeavesFor substring function, you have 1 input and 2 parameters (you set the parameters by double-clicking the function box).
I also didn't understand how you can pass the output of length function two 2nd parameter of substring function (since it is a parameter and not an expected input).
You could always create a UDF...
public String UDSubstring(String a,String b,String c,Container container){
int d = Integer.parseInt(b);
int e = Integer.parseInt(c);
if ((e == 0) && (a.length() >= d)) {
return a.substring(d);
else if ((e > d) && (a.length() >= e)) {
return a.substring(d, e);
else return "";
They don't bite, you know...
Regards,
Henrique.
<b>Edit:</b> followed by Michal's correction... -
REGEXP_REPLACE: How to use a function over the found strings?
Hello,
Consider the following:
select regexp_replace('A1BBCCA2BBCC', '(A.)', '[\1]')
from dual
'[A1]BBCC[A2]BBCC'Now I try to put a function on the replaced strings:
select regexp_replace('A1BBCCA2BBCC', '(A.)', lower('[\1]'))
from dual
'[A1]BBCC[A2]BBCC'The result is the same i.e. the function lower has been executed with my reg. expression as a parameter, not the result strings. How can I execute the function passing as a parameter not the reg. expression but the strings, that have been found? (Of course, my real need is to use a custom function, not "lower").
Thanks in advance.
Best Regards,
BeroetzI'm sure there must be a simpler way, but this is my first thought... (although strictly speaking in this example I could get rid of the lower function and just include 'a' hardcoded.)
SQL> ed
Wrote file afiedt.buf
1 with t as (select 'A1BBCCA2BBCC' as txt from dual)
2 -- end of data
3 select replace(sys_connect_by_path(lower('A'||substr(x,1,1))||substr(x,2),','),',') as x
4 from (
5 select REGEXP_SUBSTR(txt, '[^A.]+', 1, level) as x, level rn
6 from t
7 connect by level <= length(regexp_replace(txt,'[^A.]*'))
8 )
9 where connect_by_isleaf = 1
10 connect by rn = prior rn+1
11* start with rn = 1
SQL> /
X
a1BBCCa2BBCC
SQL> -
Writing more than one channel to a file using Xaincnbg VI from the Universal Library
Hi,
Could anyone help me with writing more than one channel to a file? I am using the Universal Library version 5.40 with LabView 7.0 with the Xaincnbg VI.
With one channel everything in my program works beautifully, but when I add another channel and graph and wire it to the Write LVM only one channel ends up being written to the file. It seems like there should be some function that works to add the two output arrays or something of the sort, but I can't seem to find it.
If anyone has come across this problem or knows of how it might be solved, I would really like to hear about it!
ThanksOops, forgot to attach the files...
And, pics of the VI's, in case you don't have LV8.2
Message Edited by LabViewGuruWannabe on 05-22-2007 06:15 PM
Attachments:
subAIN.vi 24 KB
AnalogDataExample.vi 118 KB
AnalogDataExamplePics.zip 172 KB -
Trouble using a function in the where clause
Hello,
I am using a function found at ask.tom.oracle.com which converts a long data type to a character. The function is returning an error when it is placed in the where clause. The sql statement , error message and the function from ask tom are shown below. Does anyone know how to fix this?
<pre>
SELECT A.FLDPHYSICAL,
A.FLDEXPOSURE,
A.FLDDATEDUE,
A.FLDDATELAST,
A.FLDEMPLOYEE,
B.FLDBDATE,
B.FLDMAILSTOP,
B.FLDREC_NUM,
B.FLDLNAME,
B.FLDMI,
B.FLDFNAME,
B.FLDBDATE,
B.FLDDEPT,
B.FLDSTATUS,
B.FLDSSN,
B.FLDHOMEPHON,
B.FLDWORKPHON,
B.FLDID,
B.FLDDIVISION
FROM REQEXAM A,
EMPLOYEE B,
EMPLOYEE_MEMO C
WHERE A.FLDEMPLOYEE = B.FLDREC_NUM
AND b.flduserstr = c.fldrec_num
AND OHM_PKG.GET_LONG('EMPLOYEE_MEMO', 'FLDDATA', C.ROWID) LIKE '%CDL YES%'
AND A.FLDDATEDUE > '01/01/1900'
AND A.FLDPHYSICAL ='CDP'
ORDER BY B.FLDDIVISION,
B.FLDLNAME,
B.FLDFNAME,
B.FLDMI,
A.FLDDATEDUE
The error message
Error at Command Line:26 Column:4
Error report:
SQL Error: ORA-00904: "OHM_PKG"."GET_LONG": invalid identifier
00904. 00000 - "%s: invalid identifier"
create or replace
PACKAGE OHM_PKG AS
/* TODO enter package declarations (types, exceptions, methods etc) here */
function getlong( p_tname in varchar2,p_cname in varchar2,p_rowid in rowid ) return varchar2;
END OHM_PKG;
create or replace
PACKAGE BODY OHM_PKG AS
function getlong( p_tname in varchar2,p_cname in varchar2,p_rowid in rowid ) return varchar2 as
l_cursor integer default dbms_sql.open_cursor;
l_n number;
l_long_val varchar2(4000);
l_long_len number;
l_buflen number := 4000;
l_curpos number := 0;
begin
dbms_sql.parse( l_cursor,
'select ' || p_cname || ' from ' || p_tname ||
' where rowid = :x',
dbms_sql.native );
dbms_sql.bind_variable( l_cursor, ':x', p_rowid );
dbms_sql.define_column_long(l_cursor, 1);
l_n := dbms_sql.execute(l_cursor);
if (dbms_sql.fetch_rows(l_cursor)>0)
then
dbms_sql.column_value_long(l_cursor, 1, l_buflen, l_curpos ,
l_long_val, l_long_len );
end if;
dbms_sql.close_cursor(l_cursor);
return l_long_val;
end getlong;
END OHM_PKG;
</prev>Remove the '_' from the function's name as below:
AND OHM_PKG.GETLONG('EMPLOYEE_MEMO', 'FLDDATA', C.ROWID) LIKE '%CDL YES%' -
Anyone use this function in the spreadsheet?
Hi Folks,
I've used the equivalent of the BITLSHIFT function in programming but never in the spreadsheet, can anyone tell me an application of this in the spreadsheet. This function is new in 2013.
TIA,
Shane
If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Cheers, Shane DevenshireHi Folks,
I've used the equivalent of the BITLSHIFT function in programming but never in the spreadsheet, can anyone tell me an application of this in the spreadsheet. This function is new in 2013.
TIA,
Shane
If this answer solves your problem, please check Mark as Answered. If this answer helps, please click the Vote as Helpful button. Cheers, Shane Devenshire
This now appears to have been answered over here:-
http://answers.microsoft.com/en-us/office/forum/office_2013_release-excel/anyone-every-used-this-function/34c4de8b-19ae-45e0-829a-26ab1075bf16 -
New to FIOS TV Multi-room DVR - Should I be able to use DVR functions from the other HD STBs?
We just converted from Directv (three DVRs) to FIOS TV and am hoping I didn't make a huge mistake: The sales agent I spoke to said that the Multi-room DVR (Motorola QIP-7216-1) and non-DVR STB would enable me to get the same features I had with my Directv setup so each user could Stop/Start/Record programming from their own remote. Unless I'm doing something wrong, I can only perform DVR control functions from the real DVR. I can view recorded programming on the non-DVR STBs but pressing record for a live broadcast or trying to select a show to record from the guide doesn't work.
I have the ActiontecGen2 MOCA connected MI424WR router, three HD STBs (Motorola 7000), one standard definition STB and the DVR.Tomd514 wrote:
We just converted from Directv (three DVRs) to FIOS TV and am hoping I didn't make a huge mistake: The sales agent I spoke to said that the Multi-room DVR (Motorola QIP-7216-1) and non-DVR STB would enable me to get the same features I had with my Directv setup so each user could Stop/Start/Record programming from their own remote. Unless I'm doing something wrong, I can only perform DVR control functions from the real DVR. I can view recorded programming on the non-DVR STBs but pressing record for a live broadcast or trying to select a show to record from the guide doesn't work.
I have the ActiontecGen2 MOCA connected MI424WR router, three HD STBs (Motorola 7000), one standard definition STB and the DVR.
As you've found, you can only create recordings from the DVR. If you want each room to have the ability to schedule recordings, then you need a separate DVR in each room.
The FiOS Motorola DVRs cannot access recordings stored on other DVRs.
If you are the original poster (OP) and your issue is solved, please remember to click the "Solution?" button so that others can more easily find it.
Maybe you are looking for
-
Trying to make a purchase on itunes and keep getting prompted to verify account information. I've done this and when i click done, it says to fix errors; i repeat the process then it says to contact apple support. Any ideas or other experiences wit
-
Simply: Firefox Sync doesn't work after upgrade to 5.0.
-
XSQL-003 Error with jakarta-tomcat-4.0.3
I am trying to set up the XSQLServlet on JBuilder7 using jakarta-tomcat-4.0.3 as the development server. I downloaded and carefully follwed the installation instructions for Tomcat 3.1 and 3.2 although the bat files have changed considerably. Set cla
-
DIfferent # of rows return using select * & select count(*)
In debugging some code (OWB generated PL/SQL) I came across the situation where by a query with count(*) returns a value of 600 rows. The same where clause using select * reports only 300 rows selected. There are 600 rows to select. Any ideas why the
-
How can a Java app validates and accepts a server certificate?
Hi, I got a Java 1.6 client, running on JBoss 6, which is required to make SSL connection to LDAP server. The first time when the Java client makes a secure ldap connection to LDAP Server, the server will send a certificate to the client. Once the cl