How to search for a new line character in sql
hi..i am using oracle 10g.
basically i am looking for usage of columns.I want to see which all columns are used in
joins.
this is the quey i have written.
but
if there a new line between WHERE ,AND those scenarios are ignored.how to take care of these new line characters?
SELECT DISTINCT s.TYPE, s.NAME, s.owner, table_name, column_name --,line,text
FROM all_source s, cols c, all_dependencies d
WHERE s.NAME = d.NAME
AND d.referenced_name = c.table_name
AND c.table_name = 'WSF_EDUCATION_ORGUNIT'
AND column_name ='ORGUNIT_TYPECODE_OID'
AND d.TYPE = s.TYPE
AND d.TYPE <> 'PACKAGE'
AND d.owner = s.owner ---FOR OVERLOADED OBJECTS
AND ( (UPPER (text) LIKE
'%' || 'AND' || '%' || column_name || ' ' || '=%'
OR (UPPER (text) LIKE
'%' || 'AND' || '%=' || ' ' || '%' || column_name
|| '%'
UNION ---if there is where
SELECT DISTINCT s.TYPE, s.NAME, s.owner, table_name,
column_name ----,line,text
FROM all_source s, cols c, all_dependencies d
WHERE s.NAME = d.NAME
AND d.referenced_name = c.table_name
AND c.table_name = 'WSF_EDUCATION_ORGUNIT'
AND column_name ='ORGUNIT_TYPECODE_OID'
AND d.TYPE = s.TYPE
AND d.TYPE <> 'PACKAGE'
AND d.owner = s.owner ---FOR OVERLOADED OBJECTS
AND ( (UPPER (text) LIKE
'%' || 'WHERE' || '%' || column_name || ' ' || '=%'
OR (UPPER (text) LIKE
'%' || 'WHERE' || '%=' || ' ' || '%' || column_name
|| '%'
)
Hi,
Not sure if I get it, but you can look for characters using the ascii and chr functions.
You can change them using replace:
A new line:
SQL> select ascii('
2 ') from dual;
ASCII('')
10(Just press enter between the quotes)
Example how to replace it with a space:
SQL> with t as ( -- generating test string:
2 select 'this string has
3 a new line' str from dual
4 )
5 --
6 -- actual query:
7 --
8 select str
9 , replace(str, chr(10), chr(32))
10 from t;
STR REPLACE(STR,CHR(10),CHR(32
this string has this string has a new line
a new lineIf that isn't clear of when I'm missing the point then please post some narrowes down examples of what you get now and your desired output. Remember to put the tag around any code example you're posting.
Similar Messages
-
New Line Character in SQL Query
Dear All,
I am wondering if some one tell me how to insert new line character in the SQL Query Output for example I need out put in the following format. Every line on new line.
The total count is:
Registration: 1111
Fees paid: 2222
Admission Done: 3333
Total:4000
Many thanksHi
SQL> select
2 'The total count is:
3 Registration: 1111
4 Fees paid: 2222
5 Admission Done: 3333
6 Total:4000
7 ' dummy_txt from dual
8 /
DUMMY_TXT
The total count is:
Registration: 1111
Fees paid: 2222
Admission Done: 3333
Total:4000
SQL>
SQL> select 'a'||chr(10)||'b' from dual;
'A'
a
b
SQL> T -
Can there is new line character in sql
help me including new lines in the o/p:
Create Table#Test(AccountIDint,Partneraccountint,PartnerNameVarchar(100),Partnerstatusvarchar(3))
Insert
into#TestSelect1,2,NULL,'Yes'
Select
CasewhenAccountID=1
Then'Account
Exists; 'else''End+
CasewhenPartneraccountisnotnullThen'check
fof the partnername; 'else''End+
Casewhenpartnername
isnullThen'update
the partname; 'else''End+
Casewhenpartnerstatus='Yes'Then'inform
partner about the status; 'else''End
From #test
o/p
Account Exists; check fof the partnername; update the partname; inform partner about the status;
Expected o/p : Account exist
check fof the partnername,
update the partname
inform partner about the status;
#TestJust return a set of messages and do the formatting in the front-end:
SELECT Q.AccountID ,
Q.MessageText ,
Q.OrderNo
FROM ( SELECT AccountID ,
'Account Exists' AS MessageText ,
1 AS OrderNo
FROM #test
WHERE AccountID = 1
UNION
SELECT AccountID ,
'check fof the partnername' ,
2
FROM #test
WHERE Partneraccount IS NOT NULL
UNION
SELECT AccountID ,
'update the partname' ,
3
FROM #test
WHERE partnername IS NULL
UNION
SELECT AccountID ,
'inform partner about the status' ,
4
FROM #test
WHERE partnerstatus = 'Yes'
) Q
ORDER BY Q.AccountID ,
Q.OrderNo; -
Replacing New Line character in a hexadecimal string in ECC5.0
Hi,
I am trying to create an XML document using ABAP.
I have created one DOM and later used the DOM to get the XML content into an internal table in form of Hexadecimal String. In that internal table(which contains XML in form of hexadecimal content), I want to search for the new line character and replace it by Space.
I have used class CL_XML_DOCUMENT to create such document.
Now, the keyword 'SEARCH' which searches the New Line character, works on the hexadecimal content of the internal table in 46C and I get an XML document. I get the position of the New Line in SY-FDPOS and can do whatever I want. But SEARCH on hexadecimal content is not permitted in ECC 5.0. I get a syntax error when I try to do so. Tried many options but could not succed.
Would apreciate if anyone can help in finding and replacing characters like new line, tab etc in a hexadecimal string.
Thanks.
Can anyoneHi!
When you say hexadecimal string, you mean variable - otherwise string (= character) operations would work?
Then you have to go for hex handling -> do it yourself. Make something like
data: lf type x value '0A',
sp type x value '20',
i type i.
I = 0.
while sy-subrc = 0.
if hex_string+i(1) = lf.
hex_string+i(1) = sp.
endif.
add 1 to i.
endwhile.
Regards,
Christian -
Handling new line character in XML
Hi,
Question : How can we specify new line character in xml ?
Explaination for use :
I have a xml structure like :
<?xml version="1.0" encoding="UTF-8"?>
<MT_ISO8583_XML_request>
<TRANSDETAILS>.
<TRANSACTIONAMOUNT>0000000000000000</TRANSACTIONAMOUNT>
<SYSAUDITNUMBER>225998394671</SYSAUDITNUMBER>
</TRANSDETAILS>
</MT_ISO8583_XML_request>
I am using Java mapping to convert xml to some satndard flat file format. It works fine for single message.
To handle multiple message i am using Multimapping split. Multimapping needs xml tags in traget structure also to split the message.
To achieve it without BPM, I want to take the whole content of my target file to one tag. When i do this i lost all the new line characters aslo. How can i preserve my new line character using XML ?
Regards
KulwinderAre you sure, that the nl characters are deleted?
They are usually not shown in the XML display.
You can also use an adapter module instead of a Java mapping. So you can do a split in mapping, but the conversion to the flat file in the adapter module. If you have already a Java mapping for this purpose, you can easily create an adapter module based on that Java code.
Regards
Stefan -
i am trying to load text into the BASIC TEXT of the material. The input file has matnr and the text. The file we loaded is fine. But in the text editor the # for new line character appears and this is causing problem while writing the text in a sapscript.
so i am trying to remove the # for the new line character while we load the file. i am using
data: c_tab like CL_ABAP_CHAR_UTILITIES=>CR_LF. to split the file and it is not being recognized. The input file is a tab delimited text file from excel. and it has " at the begining and ending.
thanks in advancethat is problem with Xls , If u have text with any Delimitors then u will get this kind of Stuff.
prabhu,peram then i will get in text file as "prabhu,peram".
Regards
Prabhu -
Want to know how to check for new line character in text file
Hi All,
I`m trying to read data from text file. However I`m not sure whether the data is in 1st line or nth line. Now I`m trying to read the text from the readline. But if text is "" and not NULL then my code fails. So I want to know how to check for new line character and go to next line to find the data. Please help.
Thanks
static int readandwriteFile(Logger logger,String filepath){
BufferedWriter out = null;
BufferedReader in = null;
File fr = null;
int get_count = 0;
try {
if(new File(filepath).exists())
fr= new File(filepath);
System.out.println("FileName: "+fr);
if(fr != null){
in = new BufferedReader(new FileReader(fr));
String text = in.readLine();
if(text != null){
get_count = Integer.parseInt(text);
in.close();
else{
get_count = 0;
else{
out = new BufferedWriter(new FileWriter(filepath));
out.write("0");
out.close();
} //Reading of the row count file ended.
catch(Exception e) {
e.printStackTrace();
finally {
try{ if (in != null) {
in.close();
if (out != null) {
out.close();
catch(Exception e) {
e.printStackTrace();
return get_count;
}You are calling the readline() only once which means you are reading only the first line from the file...
Use a loop (Do-While preferably)
do{
//your code
}while(text == "") -
How to insert new line character?
Hi all,
I have two lines to print.
out.println("Available number of columns="+cols);
out.println("Number of columns must be present=10");My problem is:
i want both the lines to be printed one below the other. But, it is displayed in one single line.....
Can anyone please tell me how to insert new line character?
I tried with \n, '\n' and \r\n but, in vain......
Thanks for your time.
Regards,
AshviniYou should never use "\n" directly.
The line separator character is different on different operating systems.
And putting quotes around it in your string will make absolutely no difference in the JSP.
To find out what the line separator is you should use System.getProperty("line.separator");
The JSPWriter and PrintWriter classes will automatically use this property with a println statement, so a println will always finish with a line separator.
The issue here was that HTML by default ignores all whitespace.
The solutions provided
- use a <br> tag instead of a carriage return
- use <pre> tags, which tells the browser not to ignore whitespace. That can be troublesome in JSP which generates a lot of extraneous carriage returns into the code.
Cheers,
evnafets -
New-line Character for a file opened in BINARY mode for O/P
Can anybody please tell me how to put a new-line charcter for each record in a file opened in Binary mode for O/p. I cant use text mode for other reasons in my scenario.
DATA: l_outdata TYPE xstring.
OPEN DATASET file FOR OUTPUT IN BINARY MODE.
Application logic to populate l_outdata
TRANSFER l_outdata TO file.
Any help, or attempt towards it will be duely rewarded,
Thanks in advance,
Sujit.hi sujit,
1. how to put a new-line charcter for each record
but how will you decide, at which POSITION,
to put the new line character, if u have opened the file in binary mode.
2. However, if u know the exact positions(s),
u can use CL_ABAP_CHAR_UTILITIES=>CR_LF
to insert the new line character,
regards,
amit m. -
How to use new line character?
Hi,
i am getting string value like this :
name john company
test1 position director sal
45000
i am getting this value in a string.
i want to display the value like below :
name john
company test1
position director
sal 45000
how to proceed on this ? can we use new line character here ? how can we use that? pls suggest me on this.
Regards,
PavaniHi Friend,
you can use the split method of String. to split that string base on space.
for Example
String st = "Jeetendra Kumar Choudhary";
String[] string = st.split(" ");
for (int j = 0; j < string.length; j++) {
System.out.println(string[j]);
By this way you can get the each word separately and you can concatenate it again in single string.if you need it.
Regards
Jeetendra. -
How can I add a new line item for production order?
HI all,
How can I add a new line item for production order through BAPI/FM? Thanks in advance.Hi Mil,
Unfortunetly SAP is not in front of me.
But if possible go to BAPI transaction , check for any production order's bapi for CHANGE purpose. Where you will be able to add your new line.
Reward if useful! -
ADF: how to insert new line character in column of VO?
Hi Everyone,
Im using Jdev 11G.
i have a VO with 5 columns displayed on the ADF page.(VO has total 8 columns)
1 column is the combination of 3 columns. i concatenated the 3 columns and added new line character after each column chr(13).
VO query is working very fine in Toad. the columnn displays each concatenated column value after a new line character but the same query is not working in ADF.
The column which is concatenating 3 columns and has to display with new line character is not displaying new line character its just concatenating the 3 values and displaying it on the page.
wat can be the solution for this in ADF?
Thank you.Setting escape="false" will allow putting html <BR> in the column and it will display ok however if your table allows export to excel the <BR> gets exported and displays as text in your exported file. Also & will export as & To prevent that, use your original text without the escape=false setting and insert LF or CR (10 or 13 character), then add inline style of white-space: pre-line; to column or to style class in your skin. That will cause all line feeds to wrap but will export to excel without mixing html in the export.
http://www.w3schools.com/cssref/pr_text_white-space.asp
Edited by: Don Kleppinger on Jan 14, 2013 4:06 PM -
New Line Character in OSB for sending email in proper format
Hi
We have a client requirement, where in we send an error email when ever an exception occurs in the OSB flow. We are using OSB 11g and we need to format the body within or before the publish activity using a replace activity something in the below manner (replace . in variable body (replace node contents))
fn:concat("Following Exception Occurred <NEW LINE>","ErrorCode: ",fn:data($fault/ctx.errorCode) etc etc)
Please tell us if there is a new line character available within OSB to format the email message. Please help its urgent. ThanksThanks a lot for the reply, but still in the email body, i see everything in one line (no enter0). I tried " ","",\n and CHR(13). All dont seem to work.
Also can you provide an example for 
: (Ampersandhash13colon)
Please help.
Regards
Amit Sachdev
Edited by: user638094 on Mar 8, 2011 12:01 AM -
How to remove new line character from query output?
Hi,
How to remove new line character from query output?
have tried select replace(column_name, CHR(10), ' ') from table_name.
Edited by: GreenHorn on Sep 11, 2008 12:53 AMPlease consider, that windows uses a sequence of chr13||chr(10) Unix uses only one character chr(10).
The new line character(s) may be OS-dependent.
You could consider both with:
replace(replace(column_name, CHR(13)||CHR(10), ' '),CHR(10),' ')
Hartmut
Edited by: hartmutm on 11.09.2008 01:32 -
I purchased iPhone 4S online for a new line. How do I activate?
I purchased iPhone 4S online on a new line. How do I activate?
Didn't receive it yet but was not sure how to get the new number for the new line. I didn't see the device on the verizon web site. Is it difficult to activate?
Maybe you are looking for
-
My iPod touch is downloading and updating apps very slow more than an hour.
My iPod touch 4th gen 32gb verson 4.3.1 is downloading and updating apps very slow more than an hour. I just got it a day ago and I backed up all my apps music and pictures and videos from iTunes. Few months ago I had an iPod touch but I lost it and
-
Hiding rows in Numbers for iPad - any update?
Several months ago, I asked the question 'how do I hide rows in Numbers for iPad' and the answer was that it's not possible, Has there been any change? Also, is it possible yet to show the row/column grid numbers/letters?
-
Add-Ons Manager Tab won't go away
Using Firefox 10.0.2 on a brand-new Mac Mini running Lion 10.7.3. Every time I open up Firefox, it opens in two side-by-side tabs. The one on the left is my home page; the one next to it says 'Add-Ons Manager' and it simply tells me the add-ons I've
-
How to Debug multiple Applets in a IDE
Hi, I am relatively new to Java. At work, I have a client-server style application where applets are deployed to the clients in an html page. Background:* The sequence is something like this: - Client goes to the relevant url - The returned html page
-
Has anyone tried to use bluetooth headsets in a school lab setting?
Our K-5 school has a lab of 30 Intel iMacs. We've had problems keeping wired headsets in good working condition and are looking to possibly replace them with bluetooth headsets. I am hoping someone has done this and can give a yes or no to this idea.