How to get 2 values of occurrence of the string?
Hello
I have given as below, so I need to get only 2nd value (between - value) and also give me simple ways
Select 112181-3769-3687 double
Select 11495-3677-3653 double
Select 1128-7608-7328 double
Select 114-3477-3953 double
Need the output of a
3769
3677
7608
3477
So I tried with the query below
SELECT Substr (Substr ('11495-3677-3653', Instr ('11495-3677-3653', '-') + 1),
(Substr ('11495-3677-3653', Instr ('11495-3677-3653', '-') + 1))
DE dual
Getting ORA-00907: missing a closing parenthesis error
Thank you
994122 wrote:
Thank you Kiss,
the regular expression is not simple code? as below
regexp_substr (str, ' [^-] +', 1, 2) second_value_regexp_substr
Anyway thanks Kiss...
Yes its simple and looks elegant. But when it comes to Normal performance of SQL functions are much better than the regular expression.
Tags: Database
Similar Questions
-
How to get local values using the API of Java OLAP?
http://download.Oracle.com/docs/CD/E14072_01/OLAP.112/e10794/overview-summary.html#Vals
The third part of a unique value is the local value. In the previous example, the local value is CY2001, which is the identifier for the year 2001 in the overall scheme. Java Oracle OLAP API has the classes and methods that you can use to get the local values of dimension members. See the descriptions of the classes MdmPrimaryDimension and MdmDimensionMemberInfo for more information on the unique values and the.
How to get local values for a dimension or hierarchy or a level using Java OLAP API?
I can not find how...
For example, I would like to get the list of members for each level (in my application: countries, States, cities)
Thanks in advance,
JPThe following code assumes that you have an object MdmPrimaryDimension, dimension and a sense of routine, dumpCursor(), that takes an oracle.olapi.data.Source object.
Find the objects of metadata
Hierarchy of MdmLevelHierarchy = dimension.getDefaultHierarchy ((MdmLevelHierarchy));
MdmAttribute localValue = dimension.getLocalValueAttribute ();
The list of levels of= hierarchy.getLevels (); Print the members of each level
for (MdmHierarchyLevel level: levels)
{
System.out.println ("Level" + level.getName ());
System.out.println ();
Source querySource = localValue.getSource () .joinHidden (level.getSource ());
dumpCursor (querySource);
}In general, it is more common to want to print descriptions of members. For this, you can replace
MdmAttribute localValue = dimension.getLocalValueAttribute ();
with
MdmAttribute valueDesc = dimension.getValueDescriptionAttribute ();
How would you say
Source querySource = valueDesc.getSource () .joinHidden (level.getSource ());
For the "description" and "local value".
Source querySource = localValue.getSource () .join (valueDesc.getSource ()) .joinHidden (level.getSource ());
-
Get a value of gray of the pipette?
Today, someone asked me how to retrieve a value of gray with the pipette and get value from color to grayscale (K only) in another document CMYK.
As we know, the eyedropper tool gives color space RGB, at least for raster images. So, fine, I get a gray rectangle with RGB:
Now, how can I convert this to grey? I can't find a reasonable way. CMYK conversion gives me 35/28/28/0, which is useles.
Conversion to L * ab gives me 69/0/0, which seemed promising, but it's also the kind of a dead-end:
In Illustrator, I have a choice of greyscale:
Then, below the dodging on Illustrator, is it a reasonable way to get the equivalent gray value of InDesign?
I suppose you could write a script that uses the mathematics of color math... goal is difficult, and it is easy to screw it up.
Of course, there is a hint of irony color science fun than if we try to go the other way, say, 39.0% K in RGB, we get 169/171/174. I guess that it relates to color profiles and whatnot (as does why Illustrator and InDesign can not end up with the same numbers).
In any case, advice or of the convenient workarounds?
Would be really nice if ID had 'Gray levels' option like Illustrator...
I have usually just go to the separations preview and read...
-
Re: Font book.
I chose "restore standard fonts" by mistake. How to get back on my selection. The Cancel button is grayed out so I can't cancel it. Any suggestions? Thanks in advance!
If you click on 'Restore the standard fonts', fonts that are not included in the OS X systems is placed in a "fonts folder (deleted) next to the fonts folder.
/ Library/Fonts
-
Hello:
How to configure contextual events publish several values of payload?
On click of a button, I'm declaritively publish a contextual event, which works very well when a single value is passed to the event handler.
My event handler method has the signature of:
eventHandler (String)
But now I also have an oracle.jbo.domain.Number, so my new eventHandler looks like this:
eventHandler (Number, String)
How to pass two values during editing of the event and how to place the payload with multiple values for the new eventHandler?
All article or code would be greatly appreciated.
Thanks for the help.You define a bean holding your values and pass an instance of the bean as a payload...
Timo
-
How to count impact / number of occurrence of a string
Hello
If I start with this:
WITH approval_tbl AS (SELECT 123456 docno, 'SUBMIT' action_code, '02-MAY-2013 13:09:55' action_date, 0 seq FROM DUAL UNION ALL SELECT 123456, 'RESERVE', '02-MAY-2013 13:09:55', 1 FROM DUAL UNION ALL SELECT 123456, 'APPROVE', '02-MAY-2013 14:59:47', 2 FROM DUAL UNION ALL SELECT 123456, 'APPROVE', '02-MAY-2013 16:25:14', 3 FROM DUAL) SELECT * FROM approval_tbl WHERE action_code = 'APPROVE';
I wish I could count the number of the impact of each action_code "APPROVE", where the first "APPROVE" impact / occurrence with a SEQ of '2', would have a number of impact of '1', and the following, with a SEQ 3, would be the 2nd impact / occurrence of the string "APPROVE" and therefore would have a number of the impact of the '2 '.
I don't know if my sample data are too basic to be able to generate that info?
Any advice would be much appreciated.
Thank you!
Hello
Do you want results as follows:
A_NUM DOCNO ACTION_ ACTION_DATE SEQ
---------- ---------- ------- -------------------- ----------
1 123456 APPROVE 2 MAY 2013 14:59:47 2
2 123456 APPROVED MAY 2, 2013 16:25:14 3
where the a_num column is generated by the query?
You can use the ROW_NUMBER analytic function for this:
SELECT ROW_NUMBER () OVER (ORDER BY seq) AS a_num
, a.*
Of approval_tbl one
WHERE action_code = 'APPROVE '.
ORDER BY seq - if desired
;
-
Replace only first occurrence in the string
Hello
Have we not function in sql where in only the first occurrence in the string is replaced by the desired string.
Example:
original string: "Oracle is the best. Oracle is awesome"
Now, I need to change only the first occurrence of the oracle
changing string: "replaced is the best." Oracle is awesome"
do we not have any function to do?regexp_replace (str, '(Oracle)', 'Replace', 1, 1)
as in
SQL> with test as 2 (select 'Oracle is the best. Oracle is great' str from dual) 3 select regexp_replace (str, '(Oracle)', 'Replace', 1, 1) str 4 from test 5 / STR ------------------------------------ Replace is the best. Oracle is great
-
How to get a ledger_id before release of the report by using FND_PROFILE. Value
Hi all, I am developing a customized using 10 g generator report. How can I get Ledger_id before release of the report by using FND_PROFILE. VALUE(). I tried with this V_LEDGER_ID: = FND_PROFILE. VALUE('GL_SET_OF_BKS_ID'). But it does not work. Please let me know how to get the legder_id using FND_PROFILE. VALUE before release of the report. Thanks, I'm glad.
What version of oracle apps?
have you used the user exist in your report?
Try using the outputs of the user and P_CONC_REQUEST_ID
-
How to get previous value of an attribute in the VOImpl file?
Hi all
I want to compare if the current value of the attribute VO A1 is equal to the previous value of the A1 when the value of this attribute A1 gets changed, how to get the previous value of the A1?
I know that in the VORowImpl file I can use this.getA1 () which returns me the current value of the A1, but I don't know how me may return the previous value?
Appreciate your help in advance!
Thank you
YvettegetPostedAttribute the value of the attribute as it was queried from the database.
Here is an example written in EmployeesImpl/** * Sets
value
as the attribute value for Salary. * @param value value to set the Salary */ public void setSalary(BigDecimal value) { Object attribute = getPostedAttribute((EmployeesImpl.SALARY)); if(attribute!=null) System.out.println("Attribite value " + attribute); //this will give you the value as it was in the data base before you modified it. else System.out.println("attribute value is null"); setAttributeInternal(SALARY, value); } -
How to get exact values.
Hi Forum,
I'm trying to get the page Width and Height of margin as a text in the slug area.
When I have less pagewidh with pagemargin, I am getting the values in fractions like that.
for example. 177.43999999.
When I draw a rectangle box to check the width and height, the spectacle of palette measures exactly like that... 177,44
How can I get the exact values I see in the measurement palette...
var myTextFrame = myDocument.textFrames.add ();
with (myDocument.pages.item (0) .marginPreferences) {}
Save the current default value of the margin preferences application.
var myY1 = top;
var left = myX1;
var low = myY2;
var right = myX2;
Set the default value of the margin preferences application.
var mWidth = parseFloat (myPageWidth - myX1 - myX2);
var mHeight = parseFloat (myPageHeight - myY2 - myY1);
myTextFrame.contents = "Ratio: y = 1.75 x - final size work = (H)" + myPageHeight + "mm (W) x" + myPageWidth + "mm work set at 25% of the final format = (H) 2410mm (W) x 1370mm Live area = (H)" mHeight + "mm (W) x" + mWidth + 'mm'; "
}
Thanks in advance for the help...
Thank you.
Math.Round () always round to the nearest whole number (integer). So suggestion of Jarek use Math.round in a particular way... it is not rounded mWidth directly - it is multiplying mWidth by 100, rounded to the nearest integer and then dividing by 100. This gives you exactly 2 decimal places of accuracy. If you want 1 decimal place, use 10 instead of 100. If you want 3 decimals, use 1000.
Point number to a general routine to round off a float to an individual is the number of decimal places:
rounding to a number of decimal places (tomaxxi)
Number.prototype.doRound = {function (roundDec)}
var roundMulit = Math.pow(10,roundDec);
return Math.round(this*roundMulit) /roundMulit;
};
If you put the above code snippet at the beginning of your script, and then in the main part of your script you can just do this:
mWidth = mWidth.doRound (3);
If you want to round up more than 3 decimal places.
As a general rule, you want to only do this in the user interface code, because there is a good chance that the will (in this case mWidth) number of rounding precision, not LOSE GAIN accuracy, when you round to a number of digits after the decimal point. (Explain exactly why this is true, it's a discussion more).
-
How to get custom values of the vCenter
Hi guys
I need an idea!
I have for my follow-up to get personalized information about vCenter environment, but are of this info are not in the default CR.
If my client is a server linux with vSphereCLI installed and the server a W2k8 installed vCenter 4.1.
My idea was to define a custom on the server vCenter Server attribute and fill it with my technical information.
Y at - it an option to query this custom value of vCenter, via the CLI from the linux server?
lusts
stony007_de
NP.
If you find this information useful, please give points to "correct" or "useful".
=========================================================================
William Lam
VMware vExpert 2009,2010
VMware VCP3, 4
VMware VCAP4-DCA
VMware scripts and resources at: http://www.virtuallyghetto.com/
Introduction to the vMA (tips/tricks)
Getting started with vSphere SDK for Perl
VMware Code Central - Scripts/code samples for developers and administrators
If you find this information useful, please give points to "correct" or "useful".
-
How to get a second y axis in the xy graph
Hello
I know that there are some issues around this topic. But if someone can give a step by step description visible value, how to get a second axis please? I spent a few hours trying to figure that out. LabView online said: "... drag the name of signal in data view", others say "right-click on axis y and choose 'duplicate'"and I can't find one of these options. " Help, please.
Thank you in advance.
Benjamin
Hello
Here is a small video that opens with vlc or mediaplayerclassic.
Concerning
-
How to call a value of preference in the XSLT file
Hi all
How to call a value preference (which is defined in bpel already) in the XSLT?
Can someone help me please
Kind regards
Villeneuve ch
Get the value of preference and and check out the post below to pass as a parameter
http://www.albinsblog.com/2012/07/passing-parameter-to-XSLT-in-SOA-11g.html#.UjfqfMZmiSo
Concerning
Albin I
-
How to set point values when redirecting to the same page.
I just create a button to redirect I want to redirect to the same page and place 2 elements on the page to the same value they had before the redirection.
But I can not write:
Place these items: P1_Permit_Number, P1_Fishing_Year
With these values: & P1_Permit_Number, & P1_Fishing_Year.
Because there are no values in session state, because a shipment has not been done.
So, how can I do this?
I know how to get the values stored in the elements, for example, $v ('P1_PERMIT_NUMBER')
but where should I put this command? It is not allowed under the "with these values.
And I don't really want to make a button "submit" and create a process that says:
P1_PERMIT_NUMBER: = $v ('P1_PERMIT_NUMBER'), because that would complicate the page too - I already have other branches and the process on the pages which conditions have to be modified so that they do not work in this scenario.
Thank you.Hello
The syntax seems correct to me. Your summers of uppercase element names?
Try:
alert("Here"); var permitNumber = document.getElementById('P1_Permit_Number').value; alert(permitNumber); var fishingYear = document.getElementById('P1_Fishing_Year').value; alert(fishingYear); var url = 'f?p=&APP_ID.:1:&APP_SESSION.:Vessel_Display:::P1_Permit_Number,P1_Fishing_Year:' + permitNumber + ',' + fishingYear; alert(url): window.location.href = url;
All alerts MUST display expected values. Doesn't it?
Andy
-
DROID: How to get rid of several icons on the homepage email?
I have two icons of mail on my homepage and wants to get rid of one of them. I only email service so that they are pointing to the same service. Anyone know how to get rid of these?
You can remove icons on your homescreen by long pressing the icon until you feel a mood and then by dragging the icon to the trash (when the menu tab is usually, the icon turns red when sound over the trash).
I hope this helps!
Maybe you are looking for
-
Linux for Portege 2010 SD card reader driver / controller
HelloI use Ubuntu Linux 6.10 on my Portege 2010. Things seem to work well, but I'm unable to download a driver for my SD card unit.Issues related to the:1. where can I find it?2 - is the SD card controller in this support of laptops SD Host Controlle
-
Lenovo Y50 only using Intel graphics when connected to the TV with HDMI output
I recently bought a Lenovo
-
How can I make visible user library folder in my user/home folder
How can MacBook Pro, OS X El Capitan (10.11.2), I make visible user library folder in my user/home folder
-
How to change custom automation measurement scales explore?
I created a custom scale incorrect in MAX, and I want to change it. But when I click on icon key next to the level name in the drop-down menu, nothing happens. I created a different scale with a different name, so I can use that one, but if things
-
Could not reconnect all network drives
My laptop is getting the message "Could not reconnect all network drives", at startup. I'm running Windows XP, service pack 3. I have a 'Z' allocated network drive, which is marked 'memory_card '. Must this drive be connected? If so, what are the ste