Replace function in JDeveloper 3.2
Hi JDev Team:
Are there any global replace functions in JDev 3.2, for instance I have one word, say 'aaaa', in all of my projct files, .jsp, .java, .... I like to replace with 'bbbb'.
Thanks
The JDeveloper Editor provides Search & Replace functionality for files.
What I typically do is
Select menu: Search | Search Source Path...
Enter Search String and Change Source path
and other fields and press Start
Then the Navigator displays a Search tab which lists all files with the matching string.
Double click on first file in navigator and
select menu Search | Replace
In this dialog enter your search, replace, and other options-
In the Options, If you do not want to be prompted, do not check the Prompt on replace option.
Select the Scope of Global
Selectg the Origin of Entire
When you are ready press the Multiple button to make multiple replacements.
When you are done with this file,
Press Ctrl-S to Save the file
Press Ctrl-F4 to close the window
Double click on the Next File
Press Ctrl-R to invoke the Search | Replace dialog.
You should not need to change any options.
Press Alt-M to select the Multiple Button!
While this may seem more complex then a simple Sed / Perl / Python script, it is more controllable, flexible and user friendly.
Besides, you may learn a few JDeveloper tricks.
Good Luck,
-John
Similar Messages
-
SQL replace function in JDeveloper
In SQL*Plus I run the following queries...
select last_name, phone_number from employees
LAST_NAME PHONE_NUMBER
Chung 650.505.1876
Dilly 650.505.2876
Gates 916.764.6600
select last_name, replace (phone_number, '.', '-') from employees
LAST_NAME REPLACE(PHONE_NUMBER
Chung 650-505-1876
Dilly 650-505-2876
Gates 916-764-6600
If I try to use the "REPLACE" function in the JDeveloper by editing the sql statement in the view object editor and run the page the results returned for the phone number column on the page are blank.
How can I substitute a dash for the period on the page?Try using AS:
select last_name, replace (phone_number, '.', '-') AS phone_number from employees
In this case is recommended for your VO a read only query. -
Search & Replace function in Files?
Does there exist a "Search & Replace String" function for Files IO? ...preferable RandomAccessFile.
Or do I have to make my own parser from scratch.
Anyone know of free code that exists somewhere? This seems like a function that someone must have made at least or has a use for.
Thanks for any! :)
rasmasyeanThe JDeveloper Editor provides Search & Replace functionality for files.
What I typically do is
Select menu: Search | Search Source Path...
Enter Search String and Change Source path
and other fields and press Start
Then the Navigator displays a Search tab which lists all files with the matching string.
Double click on first file in navigator and
select menu Search | Replace
In this dialog enter your search, replace, and other options-
In the Options, If you do not want to be prompted, do not check the Prompt on replace option.
Select the Scope of Global
Selectg the Origin of Entire
When you are ready press the Multiple button to make multiple replacements.
When you are done with this file,
Press Ctrl-S to Save the file
Press Ctrl-F4 to close the window
Double click on the Next File
Press Ctrl-R to invoke the Search | Replace dialog.
You should not need to change any options.
Press Alt-M to select the Multiple Button!
While this may seem more complex then a simple Sed / Perl / Python script, it is more controllable, flexible and user friendly.
Besides, you may learn a few JDeveloper tricks.
Good Luck,
-John -
Can I use Replace function in a decode??
Hello,
I am trying to use replace function inside a Decode Function,
Here is how I am doing it:
select
SUBSTR (
DECODE (
IH.DRVD_ALT_MAIL_ADDR_PRIM_FLAG,
'N',
REPLACE (
ih.subs_addr_1
|| ' '
|| ih.subs_addr_2
|| ' '
|| ih.subs_city
|| ','
|| ih.subs_state_code
|| ' '
|| ih.subs_zip_code,
'Y',
REPLACE (
IH.PRINT_ALT_MAIL_ADDR_LINE_1
|| ' '
|| IH.PRINT_ALT_MAIL_ADDR_LINE_2
|| ' '
|| IH.PRINT_ALT_MAIL_ADDR_LINE_3
|| ' '
|| IH.PRINT_ALT_MAIL_ADDR_LINE_4
|| ' '
|| IH.PRINT_ALT_MAIL_ADDR_LINE_5
|| ' '
|| IH.PRINT_ALT_MAIL_ADDR_LINE_6,
) 1,
50
address from x
Can anyone please tell me what am I doing wrong here, It always gives me an error about missing a right parenthesis.
Thanks in advance.Hi Jimmy,
Looks like you are missing the first comma in the SUBSTR function
SELECT SUBSTR (
DECODE (
ih.drvd_alt_mail_addr_prim_flag,
'N', REPLACE (
ih.subs_addr_1
|| ' '
|| ih.subs_addr_2
|| ' '
|| ih.subs_city
|| ','
|| ih.subs_state_code
|| ' '
|| ih.subs_zip_code,
'Y', REPLACE (
ih.print_alt_mail_addr_line_1
|| ' '
|| ih.print_alt_mail_addr_line_2
|| ' '
|| ih.print_alt_mail_addr_line_3
|| ' '
|| ih.print_alt_mail_addr_line_4
|| ' '
|| ih.print_alt_mail_addr_line_5
|| ' '
|| ih.print_alt_mail_addr_line_6,
), -- HERE
1,
50
address
FROM xRegards
Peter -
Replace() function doesn't work in Application Designer?
I'm using PeopleSoft Application Designer 8.51. I'm trying to do a simple Replace function so I can escape single quotes rather than allow them to blow up the sql query.
&deptid = Replace(&deptid, "'", "''");
App Designer chokes when I hit Save: "Invalid function parameter type. (2,19)"
According to the docs I'm using this correctly: http://docs.oracle.com/cd/E26239_01/pt851h3/eng/psbooks/tace/book.htm?File=tace/htm/tace14.htm#H4095
Even if I try to execute the example right out of the documentation, I get the same error: REPLACE("StringFun", "Fun", "Number");
Is this a bug in app designer? REPLACE is a super common thing, it's not something obscure. How can this not work?
Thanks in advance.I figured this out. “Replace” is a strange duck function that relies on offsets. “Substitute” is the magic I needed, works just like I was expecting Replace to work. The documentation I was reading on Replace was for “ PeopleSoft Analytic Calculation Engine” rather than peoplecode. I’ll pay closer attention to that next time. Maybe this will help someone else...
-
Replace function not working for XML CLOB data
Hi all,
I am generating XML using DBMS_XMLGEN in oracle 10g. After generating the XML, I am replacing the ROW tags with appropriate tag name using REPLACE function. Sometimes the tag name is not replaced correctly.
Eg.I am replacing </Cargo_ROW> with </CargoDetail>. But sometimes in one xml, this tag is coming as </CargoDetROW> or </CargoDetaiW>. The XML size is always huge and the same tag is repeated so many time in the loop and in the same XML, only one tag will be replaced incorrectly. This also not happening for all XMLs.
If any one knows the cause about this problem or solution, please share the same.
thanks,Yes Anton, you are right..
It was typecasting problem
replace supports clob
Check this out
SQL> declare
2 xmldata clob;
3 Begin
4 xmldata:='<Message transaction_log_id="" extraction_date="25/11/09 09:52:03 AM" versio
5 <Transaction>
6 <TransactionType>ORIGINAL</TransactionType>
7 <ControlNumber>60022449779</ControlNumber>
8 <BookingHeader>
9 <PortCodeOriginal>GBSOU</PortCodeOriginal>
10 <Contact>.</Contact>
11 <PhoneContact>.</PhoneContact>
12 </BookingHeader>
13 <PartyInformation>
14 <PartyDetails>
15 <PartyId>10002866</PartyId>
16 <Type>SHIP</Type>
17 <Name1>L LTD.</Name1>
18 </PartyDetails>
19 </PartyInformation>
20 <Cargo>
21 <CargoDetROW>
22 <CargoHeader>
23 <CargoReceivedSeqNo>600015391790</CargoReceivedSeqNo>
24 <CargoId>RW9330P013948</CargoId>
25 </CargoHeader>
26 <CargoDimensions>
27 <Length>1</Length>
28 <Width>2</Width>
29 </CargoDimensions>
30 </CargoDetail>
31 <CargoDetROW>
32 <CargoHeader>
33 <CargoReceivedSeqNo>600015391791</CargoReceivedSeqNo>
34 <CargoId>RW9330P01394AA</CargoId>
35 </CargoHeader>
36 <CargoDimensions>
37 <Length>2</Length>
38 <Width>2</Width>
39 </CargoDimensions>
40 </CargoDetail>
41 <Cargo_ROW>
42 <CargoHeader>
43 <CargoReceivedSeqNo>600015391792</CargoReceivedSeqNo>
44 <CargoId>RW9330P01322</CargoId>
45 </CargoDetaiW>
46 <CargoDimensions>
47 <Length>1</Length>
48 <Width>2</Width>
49 </CargoDimensions>
50 </Cargo_ROW>
51 </Cargo>
52 </Transaction>
53 </Message>';
54 xmldata:=to_clob(regexp_replac(xmldata,'</Cargo_ROW>|</CargoDetaiW>|</CargoDetROW>','</CargoDetail'));
55 xmldata:=to_clob(regexp_replace(xmldata,'<Cargo_ROW>|<CargoDetaiW>|<CargoDetROW>','<CargoDetail>'));
56 dbms_output.put_line(xmldata);
57 end;
58 /
<Message transaction_log_id="" extraction_date="25/11/09 09:52:03 AM"
version="1.0">
<Transaction>
<TransactionType>ORIGINAL</TransactionType>
<Contro
lNumber>60022449779</ControlNumber>
<BookingHeader>
<PortCodeOriginal>GBSOU</Por
tCodeOriginal>
<Contact>.</Contact>
<PhoneContact>.</PhoneContact>
</BookingHead
er>
<PartyInformation>
<PartyDetails>
<PartyId>10002866</PartyId>
<Type>SHIP</Ty
pe>
<Name1>L
LTD.</Name1>
</PartyDetails>
</PartyInformation>
<Cargo>
<CargoDetail>
<CargoHea
der>
<CargoReceivedSeqNo>600015391790</CargoReceivedSeqNo>
<CargoId>RW9330P01394
8</CargoId>
</CargoHeader>
<CargoDimensions>
<Length>1</Length>
<Width>2</Width>
</CargoDimensions>
</CargoDetail>
<CargoDetail>
<CargoHeader>
<CargoReceivedSeq
No>600015391791</CargoReceivedSeqNo>
<CargoId>RW9330P01394AA</CargoId>
</CargoHe
ader>
<CargoDimensions>
<Length>2</Length>
<Width>2</Width>
</CargoDimensions>
<
/CargoDetail>
<CargoDetail>
<CargoHeader>
<CargoReceivedSeqNo>600015391792</Carg
oReceivedSeqNo>
<CargoId>RW9330P01322</CargoId>
</CargoDetail>
<CargoDimensions>
<Length>1</Length>
<Width>2</Width>
</CargoDimensions>
</CargoDetail>
</Cargo>
</Transaction>
</Message>
PL/SQL procedure successfully completed.
SQL> Twinkle
Edited by: Twinkle on Nov 26, 2009 6:05 PM -
Prolem in CLOB replace function
Hi,
I am working on Oracle 10g (release 2).
Currently facing problem in replace function
My given patterns are
Replace(+string+, varchar2, clob)
Replace(+String+, clob, clob)
In both casese, I'm getting ORA-22828 error.
Can anyone please suggest the solution.
Thanks.Please see
http://asktom.oracle.com/pls/asktom/f?p=100:11:3388795154384573::::P11_QUESTION_ID:1533006062995 -
Replacement function modules/method for obsolete Funtion Modules in ECC 6.0
We are working on Upgrade Project and need your help in finding the replacement Function module/ Methods for following obsolete Function Modules:
1. GET_FIELDTAB
2. WS_EXCEL
3. HR_DISPLAY_BASIC_LIST
4. LOG_SYSTEM_GET_RFC_DESTINATION
5. HELPSCREEN_NA_CREATE
6. TR_RELEASE_COMM
Thank in Advance.
Sarita.
Edited by: Sarita Yalamati on Mar 28, 2008 1:23 PMHi sarita,
for GET_FIELDTAB use 'DDIF_NAMETAB_GET'..here is sample code
CALL FUNCTION 'GET_FIELDTAB'
EXPORTING
LANGU = SY-LANGU
TABNAME = C_STRUCTURE_NAME
WITHTEXT = ' '
TABLES
FIELDTAB = IDFIES
EXCEPTIONS
INTERNAL_ERROR = 01
NO_TEXTS_FOUND = 02
TABLE_HAS_NO_FIELDS = 03
TABLE_NOT_ACTIV = 04.
Replacement :
CALL FUNCTION 'DDIF_NAMETAB_GET'
EXPORTING
TABNAME = C_STRUCTURE_NAME
ALL_TYPES = ' '
LFIELDNAME = ' '
GROUP_NAMES = ' '
UCLEN =
IMPORTING
X030L_WA =
DTELINFO_WA =
TTYPINFO_WA =
DDOBJTYPE =
DFIES_WA =
LINES_DESCR =
TABLES
X031L_TAB =
DFIES_TAB = IDFIES
EXCEPTIONS
NOT_FOUND = 1
OTHERS = 2
For WS_EXCEL use GUI_DOWNLOAD.. here is sample code
CALL FUNCTION 'WS_EXCEL'
EXPORTING
FILENAME = 'D:\FILE1.xls'
SYNCHRON = ' '
TABLES
DATA = itab
EXCEPTIONS
UNKNOWN_ERROR = 1
OTHERS = 2
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Repalcement :
data : l_filename type string.
l_filename = 'D:\FILE1.xls'.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = l_filename
FILETYPE = 'ASC'
IMPORTING
FILELENGTH =
TABLES
DATA_TAB = itab
FIELDNAMES =
EXCEPTIONS
FILE_WRITE_ERROR = 1
NO_BATCH = 2
GUI_REFUSE_FILETRANSFER = 3
INVALID_TYPE = 4
NO_AUTHORITY = 5
UNKNOWN_ERROR = 6
HEADER_NOT_ALLOWED = 7
SEPARATOR_NOT_ALLOWED = 8
FILESIZE_NOT_ALLOWED = 9
HEADER_TOO_LONG = 10
DP_ERROR_CREATE = 11
DP_ERROR_SEND = 12
DP_ERROR_WRITE = 13
UNKNOWN_DP_ERROR = 14
ACCESS_DENIED = 15
DP_OUT_OF_MEMORY = 16
DISK_FULL = 17
DP_TIMEOUT = 18
FILE_NOT_FOUND = 19
DATAPROVIDER_EXCEPTION = 20
CONTROL_FLUSH_ERROR = 21
OTHERS = 22
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD CL_GUI_FRONTEND_SERVICES=>EXECUTE
EXPORTING
DOCUMENT = 'D:\FILE1.xls'
APPLICATION =
PARAMETER =
DEFAULT_DIRECTORY =
MAXIMIZED =
MINIMIZED =
SYNCHRONOUS =
OPERATION = 'OPEN'
EXCEPTIONS
CNTL_ERROR = 1
ERROR_NO_GUI = 2
BAD_PARAMETER = 3
FILE_NOT_FOUND = 4
PATH_NOT_FOUND = 5
FILE_EXTENSION_UNKNOWN = 6
ERROR_EXECUTE_FAILED = 7
SYNCHRONOUS_FAILED = 8
NOT_SUPPORTED_BY_GUI = 9
others = 10
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF. -
Bulk Replacements using Replace function in oracle 8i
Hi All,
Iam using oracle 8i version and i need to use Replace function for bulf replacements i mean i need to replace around 250 rows. So please anyone suggest me how to proceed
on this request as iam using oracle 8i version.
Thanks!
SriniWrite one update statement.
The where condition is the filter what rows need to be touched.
The SET condition will do the data change. For example it could use the REPLACE function if that is what it is needed.
One single update statement over 20 rows would mean the task is done in BULK. 20 single updates that each handle one row would mean it is row by row = slow by slow processing. -
Replace Function in Cold Fusion
Hello All,
The code below does the following: It finds an item in Spanish (in this case it's GetBasket.options, 2) and add `SPA` to the SKU code.
<cfif ListContains(GetBasket.options, 2)><option value="2"><cfset basketsku = GetBasket.SKU & "SPA"></option></cfif>
How do I do the following?
The SKU code is a 5 digit code for all languages. For example: the SKU code in English is 902013, but the SKU code for Spanish is 903013. As you can see the 3rd number is being replaced with 3. It will be standard for all items in Spanish. How do I modify the code above to replace the 3rd number with 3?
Thank you all very much in advance!not sure if you found an answer to this question but if you use the Replace function you can do this.
Replace(DB.value, 2, 3 ) -
Hi,
I have a database in TT Release 7.0.3.1.0 and other in Release 11.2.2.4.0. I need use replace sql function over Release 7.0.3.1.0.
I know that it not apply in this version but I've tried with ttIsqlCS in node with TT11 through connection in database TT7 but I received this error:
ttIsqlCS database_test_R7
Command> select replace('asjkhdfkhaskdh','a','1') from dual;
2818: Unknown function REPLACE
The command failed.
Command> version;
TimesTen Release 11.2.2.4.0
Any idea ??
Thanks in advance.
Babs.Hi Babs,
I am afraid that you are out of luck. SQL is implemented in the TimesTen engine/libraries not in the ttIsql client. Since 7.0 SQL does not have th REPLACE() function there is no way to execute that in 7.0 regardless of the client you use. You'll need to find some other option to accomplish what you require (maybe upgrade the 7.0 database to 11.2.2?).
Chris -
REPLACE function in PSP for formatting
Hi everyone,
<p>I am coding PL/SQL server pages at the moment and am trying to produce an onscreen report.
<br>I was just wondering if it is possible to use the REPLACE function to replace a part of a string with the same thing but in bold?
for example, I have tried:
<p>
htp.p('<TD WIDTH="43%" valign="top" align="left">'||REPLACE(var_comments,'''TEST''',||'<b>TEST</b>'||')'||'</TD>'); <p>but it isn't working. I just wanted to check it was possible and if so, where am I going wrong??
<p>
Thanks in advance!This will work:
htp.p('<TD WIDTH="43%" valign="top" align="left">'||REPLACE(var_comments,'''TEST''',||'<b>TEST</b>'||')'||'</TD>');I also suggest generating your table HTML using the htp.table... procedures. -
Hi All,
I using replace in my package and facing this issue.
In my code i have temp fields 1 to 15.
so when i use replace function to replace :temp1 value it also replaces value of :temp11.
:temp1 = some checks
:temp2 = some checks
:temp9 = some checks
:temp10 = some checks
till temp15
Any Solutions for this?
Thanks.like for example :
i want to replace the value of temp1 field with 10 and temp10, temp11 ...with some other values.
in code it will
/*temp1*/
if ('10') = some value then
some actions;
end if;
/*temp10*/
if ('10'0) = some value then -- value of temp1 gets replaced here
end if; -
Hi all, i am new to this forum and i hope everyone is doing great.
I have a question on CLOB objects.
I am working on Oracle 8i and i have CLOB object coming from DB2 data base.
Can i apply Replace or Translate function on CLOB data? Because i have special characters like %$^@#. I want to replace all these.
Can anyone help me .
Thanks in Advance.Hi
This article uses DBMS_LOB to mimic the standard replace function for a CLOB. It's for 9i but it may be worth a try to see if it will work on 8i too.
http://www.astral-consultancy.co.uk/cgi-bin/hunbug/doco.cgi?11080
Hope this helps -
Hi all, sry for post sql problens in APEX forum, but i realy need help for this...
I´m trying to replace : for , to make a select where in () with more then one value... but the replace function its not work with more then 1 value...
like this
select name from vw_requerente where id_cliente in REPLACE(:P5000_CLIENTE,':',',')in that item has this value: 71:72:73 , but all i get is a ORA: INVALID NUMBER, how can i make a replace function to work with this?
tnks alot and sry my english.He also posted this in the pl/sql forum and received some good advice there:
replace function help
Especially the tom kyte blog portion:
[http://tkyte.blogspot.com/2006/06/varying-in-lists.html]
Thank you,
Tony Miller
Webster, TX
Maybe you are looking for
-
Order Change vs Order Display in VA05
Does anyone know what would cause an R/3 originated order to open from a VA05 list in Change mode, while a CRM originated order would open from the same listing in Display mode? The orders are the for the same customer, and same order type, however t
-
Satellite L40: How do I recover files from Hard Drive
Hi Can anyone help me please. About one week ago I started experiencing a clicking sound coming from my Satellite L40 laptop. My laptop froze and when I restarted it, I was directed to the system setup with a message at the bottom saying "Pri Master
-
Hoe to provide a download help for the user
hi all How to provide a download help for users, i.e. if i select download radia button and if i place cursor on file path it should provide the user to select what ever the drive and folder he needs can any body help asap. regards reddy.
-
Can you embed HTML code into a Captivate project?
Hi there. Is it possible to embed HTML code into a project? I can't find any options to do it. I'm using Captivate 7. Thanks.
-
How to get domain name in java code/custom security provider
Hi all, I've developed a custom security provider and deployed it in WL_HOME/server/lib/mbeantypes folder. I also have multiple domain created and running in the same machine. now if a user logs in from a specific domain, say, t3://localhost:7005, ho