replacement of the same value in a string variable values
If I have a string:"%s is %s that I'm talking about."
and - I want to replace the instances with DIFFERENT values %s... What is the best way to do it.
I thought of her analysis in separate using substr and instr chains, but I don't know if that's an exaggeration or not.
Replace is ideal but - it replaces all occurrences of if - you can indicate just replace the first occurrence of a value, and the second with one another (i.e. If the result after replacement of the string above was supposed to be "it's the chain that I'm talking about"
Any help is appreciated.
Thank you
Hello
wtlshiers wrote:
If I have a string:"%s is %s that I'm talking about."
and - I want to replace the instances with DIFFERENT values %s... What is the best way to do it.
Whenever you have any questions, please post CREATE TABLE and INSERT statements for some examples of data and the results desired from these data.
Explain how you get these results from these data.
Always say what version of Oracle you are using (for example, 11.2.0.3.0).
See the FAQ forum {message identifier: = 9360002}
I thought of her analysis in separate using substr and instr chains, but I don't know if that's an exaggeration or not.
Depending on your needs, you may need to do this.
Replace is ideal but - it replaces all occurrences of if - you can indicate just replace the first occurrence of a value, and the second with one another (i.e. If the result after replacement of the string above was supposed to be "it's the chain that I'm talking about"
As you say, REPLACE replaces all occurrences. There is no way to say (for example) to change only the first.
REGEXP_REPLACE, is much more flexible. There is no option for giving a specific occurrence, but you won't even have this feature. You want maybe just something like
REGEXP_REPLACE ( '%s is the %s I am referring to'
, '(.*)%s(.*)%s(.*)'
, '\1This\2string\3'
)
Depends on your data and your needs.
Are the new values (e.g. 'This' and 'chain') fixed, or if they can change from one line to the other?
You will always have 2 (or certain known number) of ' %s in the original string?
'%' Always report something that needs to be replaced? If not, how can you tell when he does and when it doesn't?
Of ' always come right after "%"? If this is not the case, what are the possibilities, and what the different characters?
Tags: Database
Similar Questions
-
Is it possible that I can select an object or objects that have a value of mixed CMYK or Grayscale, and then select a Spot color and it will keep the same value of midtones as before?
For example, I have an object that is C: 0 M: 0 Y: 0 k: 20 and I select Reflex Blue. What is happening is it change my object to 100% Reflex Blue. Is there a way to change to automaitically Reflex Blue 20%?
Another example, I have 3 objects, one is 20 k: the second is 40 k: and the third is KC: 85. I want to select all the objects in three at the same time, select Yellow PANTONE and get them to change yellow PANTONE 20, 40 yellow PANTONE and PANTONE yellow 85.
Is there a way to do it or I will always have to manually edit each element?
Thanks for the help.
Select the elements to recolor
Edit > edit colors > redefine > follow my screenshots
I love clicking this button under the entitlement, one place for everything that you color reduction settings.
Use tinted scale. Exact will give you 100% of the color. The exact word is confusing here, this means that the color of the destination (100% of everything that the color you choose), not a version tinged scale.
Unfortunately I do not know how to get the exact values of blacks to convert the exact values of spot color. Scale of hues will you get you get you close enough for what you need. In my example that a black 89% converts a 84% of the place, so no exact but alteast I have a range of shades, and sometimes the results are better than accurate, depends on your art.
Here are my before and after.
-
All channels to HAVE it have the same value
I use the example for a multichannel AI aiex2.cpp read with mseries NI6280 devices.
This example works for a lane, but other chains have the same value
For example: I put 5 Volt on the first string, and then the other channel are 5 Volt too.
What should I consider in the configuration?
Hello Beilei,
I think that you run in theghost of the question. The other strings that you use are connected to the earth when you connect the first channel to 5V? If the other channels are floating, they will read the same value as the first string... 5V.
Steven T.
-
All channels to HAVE it have the same value - NI PCI-6221 and NI PCI-6229
Hello
I use the aiex1.cpp example for a multi-channel read with the devices mseries 6221 and 6229.
This example works for a lane, but other chains have the same value (difference of +-0.001 Volt).
For example: I put 5 Volt on the first string, and then the other channel are 5 Volt too.
What should I consider in the configuration?
Heiko Hello!
your description looks like the effect you are having 'ghosts '.
For more information about ghost images and how to get rid of, check out these links:
http://digital.NI.com/public.nsf/allkb/73CB0FB296814E2286256FFD00028DDF?OpenDocument
and
http://digital.NI.com/public.nsf/allkb/C6C7DE575301A379862572DD00480A01?OpenDocument
Best regards
Moritz M.
-
Only GET records that have the same values of field has the same value in field B
Have a hard time with below, please help.
Here's the situation:
create table cord (identification NUMBER, CM VARCHAR2 (3), PM VARCHAR2 (2));
insert into string values (1, '002', 'H1');
insert into string values (2, '006', 'H1');
insert into string values (3, '004', 'H2');
insert into string values (4, '006', 'H2');
insert into string values (5, '004', 'H3');
insert into string values (6, '004', 'H3');I just need to select the folders which, for the SAME value of PM have the same value in CM, in example above, those are recordings with ID (5,6).
1 and 2 fail because for them CM and PM are different for the same H1, similar on the 3 and 4.
I don't know if this will help but records are always in 'pairs', which means that there are no cases as
7. '004' | H4
8. ' 006' | H4
9. '005' | H4
Any ideas are much appreciated.
Thank you
See if the following can help...
select id,cm,pm from( select t.* ,count(1) over(partition by cm,pm) cnt from testt t ) where cnt>1;
-
get the index of the same values in table
Hi guys,.
I'm trying to get the index of array elements with the same value but it can solve mine.
my case is:
array1 = [1,2,3,4]; <-here are the names of the pages, always in the order of CSA (these table I used only to check the results of my work, probably will not be for you but maybe...)
array2 = [1,1,2,2,2,3,4,4,4]; <-these numbers are random, but always in the CSA order (these are the names of pages for items in table 3)
array3 = [a, b, g, i, f, e, c, h, d]; <-these are all the values of the elements I want to work with later. number of articles is still the same as in array2, their indexes are corresponding.
array4 = [];
I need to remove array3 everything, but one of each issue of array2 (as I will remove duplicates) or push to array4 an article of array3 for each number of the array array2 (as I'm going to ignore duplicates)
don't know is my desc is clear enough, but the result I get is:
ex. [a, g, e, c]
above example for each number of array2 array3 items, but do not have to be first, can be second or third if etc exist, but have to be alone.
I thought that if I get duplicate values, the index in the array array2 and delete this index in array3 will get what I want, but can not solve.
You will appreciate all help.
Thank you
Try something like this:
var array2 = [1,1,2,2,2,3,4,4,4]; var array3 = ["a","b","g","i","f","e","c","h","d"]; var tempArray = []; var resultArray = []; var n , x ; for(var n=array2.length-1;n>=0;n--) { var string = ""+array2[n]; tempArray[string] = array3[n]; } for(x in tempArray) { resultArray.push(tempArray[x]); } resultArray.reverse(); // a,g,e,c
Hope, that helps.
Uwe
-
Photos with the same values of position...
I have a picture with the edited/customized position values (scale, rotation, inclination, perspective, disort, warp)... I have some photos that will be on the different layers and I want that they have the same values as the first (it's stupid to do the same thing with 10 photos...) I tried to duplicate the layers and replacement is contained, but values are lost, so the photos appear in the normal position...
So how can guys, I do this?
For this to work properly, all images must be of the same size and resolution.
- Integrate the file of the first image.
- Layer > Smart object > convert to smart object
- Edit > free transform and establish the size, position and orientation... .OK
- Cmd + J to create a layer of dupe
- Layer > Smart Object > replace content
- Choose the following image > replace
Repeat steps 4-6
-
Need to show the same values in all jspx pages
Hello.
I use jdeveloper 11.1.1.5
I had created a jspx pages such as dept.jspx and emp.jspx
I've been using this in my jspx page
The bindings.return.inputValue will return the value of the code below<af:outputText value="#{bindings.return.inputValue}" binding="#{pageFlowScope.backing_dept.ot1}" id="ot1"/>
My scenario is that I need to display the same value in emp.jspxpublic String checkLoginCredentials1(String p_user,String p_pwd) { System.out.println(p_user + " " + p_pwd); ApplUsersVOImpl vo = (ApplUsersVOImpl)this.getApplUsers1(); /*set the bind variable value*/ vo.setNamedWhereClauseParam("p_user",p_user.toUpperCase()); vo.setNamedWhereClauseParam("p_pwd",p_pwd.toUpperCase()); vo.executeQuery(); int rowCount=vo.getEstimatedRangePageCount(); System.out.println("rowCount="+rowCount); if(rowCount==0) { throw new JboException("Password doesn't match"); } return "Welcome"+ " " + p_user.toUpperCase(); }
I had created a task flow frm dept.jspx to emp.jspx and emp.jspx to dept.jspx
I tried the same XML file in my emp.jspx
But while I m browsing frm emp.jspx to dept.jspx there are doesnot.,.<af:outputText value="#{bindings.return.inputValue}" binding="#{pageFlowScope.backing_emp.ot1}" id="ot1"/>
This means that for the faces-config. XML (the standard JSF configuration file), there is no scope spanning application except for the scope of the session. This does not mean that you should not use extended session if you use faces - config.Xml.
However, you have been advised to use the workflow and no faces - config.Xml.
-
Satellite P300-156 - and the button Return give the same values
Hello
I have a satellite P300-156, and it has a numeric keypad.
I have problems because the Enter key and the Return key give the same values. I believe that it is incorrect.
Can anyone help.Key on the numeric keypad should give an input it does.
the Enter key on the main keyboard should give a carriage return value, but it gives an input value.Usually this does not cause a problem, but with software like photo shop that makes the distinction between a carriage return and a hard fall it does not work.
Can someone help me please
Thank you
Hello
To my eyes the entry and return keys are the same keys that provides the same functionality.
I really put t know why you believe that there is something not rightBy the way; Check if you are using the latest version of the BIOS!
-
inputText and ouputText does not display the same value
Hello
JDev 11.1.2.4
On my page, I have an inputText and outputText bound to the same link of the attribute. The bind value is defined in a value change listener, and then the two components are updated. Say I put in 2009 for the PeriodFrom, the inputText remains empty, but the outputText shows the 2009. How is possible that the two items related to the same link does not show the same value.
< af:inputText value = "#{bindings." PeriodFrom.inputValue}"required =" #{bindings. " PeriodFrom.hints.mandatory}.
columns = "#{bindings." PeriodFrom.hints.displayWidth}"shortDesc =" #{bindings. " PeriodFrom.hints.tooltip}"id ="id1 ".
autoSubmit = "true" simple = "true" >
< f: validator binding = "#{bindings." PeriodFrom.validator} "/ >"
< / af:inputText >
< af:outputText value = "#{bindings." PeriodFrom.inputValue}"id ="ot3"clientComponent ="true"/ >
Furthermore, I tried to get the RichInputText component and call a getValue on it, and the value returned is 2009. I'm completely lost.
Thank you
I made the fragment of page from scratch. I discovered why the update does not work. This is because the selectOneChoice is inside an af:subform. If I remove the subform, the update works correctly.
shortDesc = "#{bindings." StdcntyCode.hints.tooltip}"id ="soc2"simple ="true"autoSubmit = 'true '.
valueChangeListener = "#{pageFlowScope.identificationSessionEditBean.countryValueChangeListener}" > "
columns = "#{bindings." PeriodFrom.hints.displayWidth}"shortDesc =" #{bindings. " PeriodFrom.hints.tooltip}"id ="id1 ".
autoSubmit = "true" simple = "true" >
columns = "#{bindings." PeriodTo.hints.displayWidth}"shortDesc =" #{bindings. " PeriodTo.hints.tooltip}"id ="id2 ".
autoSubmit = "true" simple = "true" >
-
SQL: fill the same value, until it gets another NOT NULL value
It's my main table
CREATE TABLE MAIN (EMPNO INTEGER, DATE OF EFF_DT);
INS IN HAND VALUES(1,'2013-01-01');
INS IN HAND VALUES(1,'2013-03-01');
INS IN HAND VALUES(1,'2013-05-01');
INS IN HAND VALUES(1,'2013-07-01');
INS IN HAND VALUES(1,'2013-09-01');
INS IN HAND VALUES(1,'2014-01-01');
It's my table of choiceCREATE TABLE LKP (EMPNO INTEGER, TYPE_CD VARCHAR (10), EFF_DT DATE);
INS IN LKP VALUES(1,'A','2013-01-01');
INS IN LKP VALUES(1,'B','2014-01-01');My query:
SALT
M.EMPNO AS MAIN_EMP,
M.EFF_DT AS MAIN_DT,
L.TYPE_CD
HAND M LEFT JOIN LKP L ON M.EMPNO = L.EMPNO AND M.EFF_DT = L.EFF_DTResult:
MAIN_EMP MAIN_DT TYPE_CD
2013-01-01 1A
1 01-03-2013?
1 05-01-2013?
1 01-07-2013?
1 01-09-2013?
2014-01-01 1, BExpected result: (I need to get the same value, until I have a new value of research)
MAIN_EMP MAIN_DT TYPE_CD
2013-01-01 1A
2013-03-01 1A
2013-05-01 1A
2013-07-01 1A
2013-09-01 1A
2014-01-01 1, BPlease help me in this regard.
Concerning
KVB
RaminHashimzade wrote:
For 11g (ignores null values)
SELECT M.EMPNO AS MAIN_EMP,
M.EFF_DT AS MAIN_DT,
NVL (L.TYPE_CD, lag(L.TYPE_CD ignore nulls) over (partition by M.EMPNO of M.EFF_DT order)) TYPE_CD
HAND M
LEFT JOIN LKP L
ON M.EMPNO = L.EMPNO
AND M.EFF_DT = L.EFF_DT
order by 2
----
Ramin Hashimzade
It's not only 11g, which is also 10g
-
Find the same value in different columns
Hello
I'm trying to figure out how I would get the same value in the same row but in different columns. For example, in the table sometimes report the name is the same as the description. I would like to find all the lines where this is the case.
Thank you
Name of the report Description Date Time Report 1 Report 1 Delalande TTTT Report 2 Billing report Delalande TTTT Report 3 Report 3 Delalande TTTT Hello
Is that what you want?
SELECT *- or whatever the columns that you want to
FROM table_x
WHERE description = report_name
;
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) for all of the tables involved and also publish outcomes from these data.
Explain, using specific examples, how you get these results from these data.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).See the FAQ forum: https://forums.oracle.com/message/9362002
-
GL CCID have the same values for Segment
Is it possible that two different code_combination_id in the same GL_Code_Combination table has the same values for segment.
It is, when I run the accounts payable balance report trial of the responsibility of the PA, its follow-up of the transactions ID associated with only 1 and not both.
But, here, for the same Chart_of_Accounts_Id, we can see that there are two Code_combination_id entries, with the same values for segment.
Can you please let me know if this is possible?
For example: I'm running the following queries and Segment1, Segment2, Segment3, Segment4, 12855 CCId values Segment5 is the same as Segment1, Segment2, Segment5, Segment4, Segment3 to 13402.
Select CODE_COMBINATION_ID, CHART_OF_ACCOUNTS_ID,
SEGMENT1, SEGMENT2 SEGMENT3, SEGMENT4, ENABLED_FLAG, SEGMENT5,
* of the GL_CODE_COMBINATIONS where CODE_COMBINATION_ID = 12855
Select CODE_COMBINATION_ID, CHART_OF_ACCOUNTS_ID,
SEGMENT1, SEGMENT2 SEGMENT3, SEGMENT4, ENABLED_FLAG, SEGMENT5,
* of the GL_CODE_COMBINATIONS where CODE_COMBINATION_ID = 13402
CCID - Segment1, Segment2, Segment3, Segment4, Segment5
-----------------------------------------------------------------------------------------------
12855 01 000 2220 00000 000
13402 01 000 2220 00000 000
I hope you understand.
Thank you
BobHi Bob,
Can you please check the id of chart of accounts for the two combinations...
Concerning
MuthuPublished by: Muthu on April 30, 2013 02:10
-
repeating subforms can you script to stop the same value being selected more than once
I have a LiveCycle form with a subform that is repeated when the first field (text field 2 characters) requires the entry of a code between 01 and 99. You can script so that you cannot enter the same value of code more than once?
Here's a code in Formcalc that works for you. Put it in the output of the textfield event.
In this example, the page is called myPage and textField is called TextField1. Rename them as you need.
indexCount var = 0
var thisIndex = $. parent.index
While (indexCount< thisindex)="">
If (myPage [indexCount]. TextField1 is myPage [thisIndex]. TextField1) then
xfa.host.messageBox ("you already used this number")
$ = ""
endif
indexCount = indexCount + 1
endwhile
-
CFQUERY returns always the same value
< name cfquery = "qryGetMAXID" datasource = "#Request.DSN #" >
SELECT
MAX (FLEET_CON_ID) + 1 as MaxFleetId
Of
CONFIGURATION
< / cfquery >
< cfset intFLEET_CON_ID = #qryGetMAXID.MaxFleetId #/ >
< name cfquery = "qryAddOperator" datasource = "" #Request.DSN # "result = 'test' >"
INSERT INTO
CONFIGURATION
(FLEET_CON_ID,
COL2,
COL3,
COL4)
VALUES
(#intFLEET_CON_ID #,)
"ADD OPERATOR."
"#strCode, #
("#strName #")
< / cfquery >
the qryGETMAXID query always returns the same value as 18703. I inserted a few values in the database directly. the query should return 18705. When I run the same query in SQL Developer, it returns the correct value. I've not cached the query.
Please help me.
Thanks in advance
Dan and Wolfshade,
Thanks for the problem.
I found the problem, then that I insert into the database, I didn't do it. He was thus the same value.
Sorry...
Maybe you are looking for
-
Need help
-
Satellite A200 - cannot playe DVD using WMP or Real player
Hello Two days ago I installed XP (I have vista before) and before that I got the drivers on the Toshiba site but it seems that not all drivers available! Problem is when I want to play a DVD with media player or real player it say there do not have
-
Losing files encryption ranging from NTFS to FAT32 or FAT16?
I was wondering if encrypted files created on NTFS formatted drives lose encryption if moved to FAT32 or FAT16 formatted drives?
-
Published video segments are blurred
I creaated a DVD for 30 minutes with the help of MMM, it contains photos and video clips, the video clips appear flat and fuzzy but also I think that the posterization. How can I fix this problem?
-
Parallel trick works not.
HelloI'm trying to update a table using the parallel indicator but the plan of the explain command shows that the DML does not use the suspicion. I also changed my session to enable parallel DML - ALTER SESSION ACTIVATE PARALLEL DML.-create the table