How to use escape character in update statement.
Hi All,
I'm trying to update table using following sql update statement, but everytime it's asking me for the input due to the '&' value in below sql.
UPDATE xyz_xyz
SET NAME = 'ABC & PQR'
WHERE ID = (SELECT ID
FROM abc_abc
WHERE NAME = 'C & PQR');Please let me know how to use escape character syntax or let me know if there is any alternative solution.
Thanks,
Vishwas
Hi,
By default, & marks a substitution variable name.
If you're not using substitution variables in that statement (or, if this is in PL/SQL, in that entire package or procedure) then the easiest thing to do is just diable substitution variables; then & will be a normal character:
SELECT DEFINE OFF
UPDATE xyz_xyz
SET NAME = 'ABC & PQR'
WHERE ID = (SELECT ID
FROM abc_abc
WHERE NAME = 'C & PQR');
SET DEFINE ONIf you can't do that, then & is always taken literally if it comes right before a single-quote, so you could say:
UPDATE xyz_xyz
SET NAME = 'ABC &' || ' PQR'
WHERE ID = (SELECT ID
FROM abc_abc
WHERE NAME = 'C &' || ' PQR');There is a SQL*Plus "SET ESCAPE" command, too, but if you use it, you have to worry about whether the escape character is to be taken literally or not.
SET ESCAPE \Yet another alternative is to make some other character, such as ~, mark the substitution variables:
SET DEFINE ~Read all about them in the SQL*Plus manual.
http://download.oracle.com/docs/cd/B28359_01/server.111/b31189/ch2.htm#sthref103
Similar Messages
-
Using Escape character in UPDATE statement
SELECT REPLACE
( REPLACE
( REPLACE( REPLACE( REPLACE( REPLACE( BODY, '<STARTOFLINK>' )
, '<ENDOFLINK>' )
FROM ARTICLEI need to use the above in an UPDATE statement to remove some HTML tags from a CLOB column. However when I run the script it asks for the substitution variables for the '&' characters. I've tried "ESCAPE '\'" but I think you can only use that with a like operand.
Any suggestions?
Message was edited by:
Terrible
As you can see the HTML tags have been converted in this post!! I'm trying to remove:
& amp;
& quot;
& ndash;
& #039;This may help;
SQL> create table t (col1 varchar2(200))
Table created.
SQL> insert into t values('<STARTOFLINK>')
PL/SQL executed.
SQL> insert into t values('<ENDOFLINK>')
PL/SQL executed.
SQL> insert into t values(chr(38) || 'amp;')
PL/SQL executed.
SQL> insert into t values(chr(38) || 'quot;')
PL/SQL executed.
SQL> insert into t values(chr(38) || 'ndash;')
PL/SQL executed.
SQL> insert into t values(chr(38) || '#039;')
PL/SQL executed.
SQL> insert into t values('<STARTOFLINK>link<ENDOFLINK> '
|| ' AMP:' || chr(38) || 'amp;'
|| ' DQT:' || chr(38) || 'quot;'
|| ' DASH:'|| chr(38) || 'ndash;'
|| ' SQT:' || chr(38) || '#039;')
PL/SQL executed.
SQL> select * from t
col1
<STARTOFLINK>
<ENDOFLINK>
<STARTOFLINK>link<ENDOFLINK> AMP:& DQT:" DASH:– SQT:'
7 rows selected.
SQL> select regexp_replace(
regexp_replace(
regexp_replace(
regexp_replace(
regexp_replace(col1, '<.*OFLINK>',NULL),
chr(38) || 'amp;', chr(38)),
chr(38) || 'quot;', chr(34)),
chr(38) || 'ndash;', chr(45)),
chr(38) || '#039;', chr(39))
new_col from t
NEW_COL
AMP:& DQT:" DASH:- SQT:'
7 rows selected.Message was edited by:
MScallion
The SELECT * values were not as they are displayed due to HTML conversions. -
How to use rownum=2 in update statement ?
Hi all,
we are migrating the data from mainframe to oracle. migration team extracted the data into flat file. we are using this flat file to load in oracle.Finacle have menu option to load data from flat file to corresponding oracle tables.whenever i given this flat file to Menu it will give error report like below if any rows have error.
here "A/c. Opening Matrix" is the error.
error report:-
A/c. Opening Matrix
The Above Error Was For record No: 1
A/c. Opening Matrix
The Above Error Was For record No: 2
we are extracting and storing all the error message and corresponding record no in shell script as below.
err_msg=`echo ${error_msg[i]}`
rec_num=`echo ${error_msg[i]}| cut -d: -f2`
we need to update the upload status either upload success or failure and error message in upload history table. iam writing the update statement as below.
update statement:-
update upld_hist set upld_status='ERR' ,upld_err='$err_msg' where rownum=$rec_num;
This is statement is updating only for rownum=1. other than this it is not updating the table. Please suggest me how to update the rows based on rownum?
Thanks,
Venkat Vadlamudi868591 wrote:
Hi all,
we are migrating the data from mainframe to oracle. migration team extracted the data into flat file. we are using this flat file to load in oracle.Finacle have menu option to load data from flat file to corresponding oracle tables.whenever i given this flat file to Menu it will give error report like below if any rows have error.
here "A/c. Opening Matrix" is the error.
error report:-
A/c. Opening Matrix
The Above Error Was For record No: 1
A/c. Opening Matrix
The Above Error Was For record No: 2
we are extracting and storing all the error message and corresponding record no in shell script as below.
err_msg=`echo ${error_msg[i]}`
rec_num=`echo ${error_msg[i]}| cut -d: -f2`
we need to update the upload status either upload success or failure and error message in upload history table. iam writing the update statement as below.
update statement:-
update upld_hist set upld_status='ERR' ,upld_err='$err_msg' where rownum=$rec_num;
This is statement is updating only for rownum=1. other than this it is not updating the table. Please suggest me how to update the rows based on rownum?
Thanks,
Venkat VadlamudiUse Analytic ROW_NUMBER() ..
http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions156.htm#i86310 -
How to escape & symbol in Update statement
Hi all,
How to escape & symbol in Update statement..
Below is my update statement which contains lot of & symbols...
UPDATE ContentItem SET ContentData =
'<:'
where ContentItemId = 398
if i run this query it asks input value for lt..
Can anyone give the suggestions please.. Its very urgent..
Cheers,
Moorthy.GSHey all,
Thanks for your reply.
But i am getting error for below statement
set define off;
UPDATE ContentItem SET ContentData =
'<?xml version="1.0" encoding="utf-16"?>
<contentItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="398" resizable="false" contentTypeId="15" parentContentTypeId="0" sortOrder="0" width="0" height="0" xsltFileId="" createDate="0001-01-01T00:00:00" startDate="2006-12-06T00:00:00" endDate="2010-12-31T00:00:00" publishedDate="0001-01-01T00:00:00" CategoryId="0" DotNetClassType="HPCi.OnlineContentDelivery.Core.ContentItem" DotNetAssVersion="1.0.0.0">
<title>Executive_Photos</title>
<CampaignName />
<files />
<textItems>
<textItem type="" linkName="" linkUrl="" identifier="Body" dataDocFileId=""><?xml version="1.0" encoding="utf-16"?>
<contentItem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" id="40" contentTypeId="10" parentContentTypeId="0" sortOrder="0" createDate="0001-01-01T00:00:00" startDate="2006-04-04T00:00:00" endDate="2006-05-06T00:00:00" publishedDate="0001-01-01T00:00:00" DotNetClassType="HPCi.OnlineContentDelivery.Core.ContentItem" DotNetAssVersion="1.0.0.0">
<title>Image Gallery</title>
<files />
<textItems>
<textItem type="" linkName="" linkUrl="" identifier="Body" dataDocFileId="" xsltFileId=""><!-- BEGIN CODE FOR THE TOP CONTROL -->
<script language="javascript" type="text/javascript">
function showImage(sImgId, sTargetImgPath)
document.getElementById("imgLargeImage").src = sTargetImgPath;
</script>
<div id="topThumbContainer" style="float:left; width:100%;">
<div id="divThumbs" style="float:left;">
<table>
<tr>
<td width="84px" >
<div id="divThumbImage1" class="divThumbImage" onClick="javascript:showImage(''ThumbImg1'', ''Images/bio/BobMetz_lg.jpg'');">
<img id="ThumbImg1" src="Images/bio/BobMetz_sm.jpg" width="63" height="85" />
</div>
<div id="divThumbText1" style="text-align:center;">Bob Metz</div>
</td>
<td>
<div id="divThumbImage3" class="divThumbImage" onClick="javascript:showImage(''ThumbImg3'', ''Images/bio/Crawford_lg.jpg'');">
<img id="ThumbImg3" src="Images/bio/Crawford_sm.jpg" width="63" height="85" />
</div>
<div id="divThumbText3" style="text-align:center;">David Crawford</div>
</td>
</tr>
<tr>
<td width="84px" >
<div id="divThumbImage2" class="divThumbImage" onClick="javascript:showImage(''ThumbImg2'', ''Images/bio/JamieGallo_lg.jpg'');">
<img id="ThumbImg2" src="Images/bio/JamieGallo_sm.jpg" width="63" height="85"/>
</div>
<div id="divThumbText2" style="text-align:center;">Jamie Gallo</div>
</td>
<td >
<div id="divThumbImage4" class="divThumbImage" onClick="javascript:showImage(''ThumbImg4'', ''Images/bio/Mayfield_lg.jpg'');">
<img id="ThumbImg4" src="Images/bio/Mayfield_sm.jpg" width="63" height="85"/>
</div>
<div id="divThumbText4" style="text-align:center;">Arlene Mayfield</div>
</td>
</tr>
<tr>
<td width="84px" >
<div id="divThumbImage5" class="divThumbImage" onClick="javascript:showImage(''ThumbImg5'', ''Images/bio/Turnbull_lg.jpg'');">
<img id="ThumbImg5" src="Images/bio/Turnbull_sm.jpg" width="63" height="85" />
</div>
<div id="divThumbText5" style="text-align:center;">Robert Turnbull</div>
</td>
<td>
<div id="divThumbImage6" class="divThumbImage" onClick="javascript:showImage(''ThumbImg6'', ''Images/bio/hessels_lg2.jpg'');">
<img id="ThumbImg6" src="Images/bio/hessels_sm2.jpg" width="63" height="85" />
</div>
<div id="divThumbText6" style="text-align:center;">Jane T. Hessels</div>
</td>
</tr>
<tr>
<td width="84px" >
<div id="divThumbImage7" class="divThumbImage" onClick="javascript:showImage(''ThumbImg7'', ''Images/bio/bauz_lg.jpg'');">
<img id="ThumbImg7" src="Images/bio/bauz_biopic.jpg" width="63" height="85" />
</div>
<div id="divThumbText7" style="text-align:center;">Melanie Wernick</div>
</td>
<td>
<div id="divThumbImage8" class="divThumbImage" onClick="javascript:showImage(''ThumbImg8'', ''Images/bio/child_lg.jpg'');">
<img id="ThumbImg8" src="Images/bio/child_biopic.jpg" width="63" height="85" />
</div>
<div id="divThumbText8" style="text-align:center;">Mike Child</div>
</td>
</tr>
<!--<tr>
<td>
<div id="divThumbsRight">
<img src="Images/AG5_About_Us_Photo_Gallery_Camera.gif" alt="Image of Camera" border="0" height="150" />
</div>
</td> -->
</tr>
</table>
</div>
</div>
<!-- END CODE FOR THE TOP CONTROL --></textItem>
<textItem type="" linkName="" linkUrl="" identifier="NameTitle" dataDocFileId="" xsltFileId="">Images</textItem>
</textItems>
</contentItem></textItem>
</textItems>
</contentItem>'
where ContentItemId = 398
Error is "SQL Error: ORA-01704: string literal too long"
My contentdata column is CLOB datatype.
Pls help me....
Moorthy.GS -
Urgent Help - in using Escape character
hai,
i have problem in using escape character..
can anyone help me out in the same...
sb.append(<jsp:getProperty name="resume_main" property="name"/>);
//error i am getting is -- Missing term, ')' expected.
pl help me out in using the escape character in the above statement.
thanx in advance
regards
koeltry
sb.append("<jsp:getProperty name='resume_main' property='name'/>");
or
sb.append("<jsp:getProperty name=\"resume_main\" property=\"name\"/>");
both will work -
Can I use a select and update statement in a single jsp file?
I want to update the BUY table everytime I would add a SELL transaction.....I want to minus the stocks that I sold to those that Ive bought before.....
note: I used a seperate table in BUY and SELL transaction
After I Have added a transaction, I want to update the buy table. This is my problem, can I used both SELECT and UPDATE statement at the same time in a single jsp file for example like this:
select * from test, test1;
update test
set total_shares=total_shares-Stotal;
where stock_code=Scode AND name_broker=Sbroker;
Can i have both of these statements in the same jsp file in oder to update the buy table?
Or can anyone suggest how can process that update?THANKS!
--------------------Can i have both of these statements in the same jsp file in oder to update the buy table?Yes. But wouldn't it have been easier just to try it?
-
How to use escape characters in expdp
Hi All,
Am exporting the dump by using expdp as follows
expdp XXXXX/YYYYYY schemas=XXXXX INCLUDE=TABLE:\"LIKE('EXT_%')\" directory=DUMPDIR1 dumpfile=XXXXX_18-Dec-2012.dmp logfile=exp_XXXXX_18-2012.log
rocessing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/TRIGGER
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "XXXXX"."EXT_COLLATERAL" 556.5 KB 2543 rows
. . exported "XXXXX"."EXT_CUSTOMER" 184.1 KB 1210 rows
. . exported "XXXXX"."EXT_ACCOUNT" 142.8 KB 1116 rows
. . exported "XXXXX"."EXT_CUSTOMER_IDENTIFICATION" 126.6 KB 1210 rows
. . exported "XXXXX"."EXT_LN_ACCOUNT" 111.3 KB 965 rows
. . exported "XXXXX"."EXT_LN_ACCT_DISBRSMNT_EVENT" 102.5 KB 965 rows
. . exported "XXXXX"."EXT_PERSON" 108.7 KB 1210 rows
. . exported "XXXXX"."EXT_DP_ACCOUNT_SUMMARY" 77.92 KB 151 rows
. . exported "XXXXX"."EXT_LN_ACCOUNT_DISBURSEMENT" 100.4 KB 965 rows
. . exported "XXXXX"."EXTENSION_BASIS_TYPE_REF" 5.296 KB 3 rows
. . exported "XXXXX"."EXTERNAL_BANK" 11.23 KB 40 rows
. . exported "XXXXX"."EXTERNAL_BANK$AUD" 12.73 KB 42 rows
. . exported "XXXXX"."EXTRACTION_SVCE_REF" 5.289 KB 2 rows
. . exported "XXXXX"."EXT_DP_ACCOUNT" 24.64 KB 151 rows
. . exported "XXXXX"."EXT_DP_ACCOUNT_INTEREST" 37.72 KB 151 rows
. . exported "XXXXX"."EXTERNAL_SMS" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_BLOCK" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_CHARGE" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_CHARGE_SUMMARY" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_CHARGE_TIER" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_CHEQUE_BOOK_ORDER" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_CHEQUE_INVENTORY" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_RELATIONSHIP" 0 KB 0 rowsit export fine.. But my requirement is needs to export tables start with EXT_%
here expdp exports all table starting with EXT% how to specifies escape character in export option.
excepted result
. . exported "XXXXX"."EXT_COLLATERAL" 556.5 KB 2543 rows
. . exported "XXXXX"."EXT_CUSTOMER" 184.1 KB 1210 rows
. . exported "XXXXX"."EXT_ACCOUNT" 142.8 KB 1116 rows
. . exported "XXXXX"."EXT_CUSTOMER_IDENTIFICATION" 126.6 KB 1210 rows
. . exported "XXXXX"."EXT_LN_ACCOUNT" 111.3 KB 965 rows
. . exported "XXXXX"."EXT_LN_ACCT_DISBRSMNT_EVENT" 102.5 KB 965 rows
. . exported "XXXXX"."EXT_PERSON" 108.7 KB 1210 rows
. . exported "XXXXX"."EXT_DP_ACCOUNT_SUMMARY" 77.92 KB 151 rows
. . exported "XXXXX"."EXT_LN_ACCOUNT_DISBURSEMENT" 100.4 KB 965 rows
. . exported "XXXXX"."EXT_DP_ACCOUNT" 24.64 KB 151 rows
. . exported "XXXXX"."EXT_DP_ACCOUNT_INTEREST" 37.72 KB 151 rows
. . exported "XXXXX"."EXT_ACCOUNT_BLOCK" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_CHARGE" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_CHARGE_SUMMARY" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_CHARGE_TIER" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_CHEQUE_BOOK_ORDER" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_CHEQUE_INVENTORY" 0 KB 0 rows
. . exported "XXXXX"."EXT_ACCOUNT_RELATIONSHIP" 0 KB 0 rowsThanks
Sami.expdp XXXXX/YYYYYY schemas=XXXXX INCLUDE=TABLE:\"LIKE('EXT\\_%')\" directory=DUMPDIR1 dumpfile=XXXXX_18-Dec-2012.dmp logfile=exp_XXXXX_18-2012.log
or
expdp XXXXX/YYYYYY schemas=XXXXX INCLUDE=TABLE:\"LIKE('EXT\_%')\" directory=DUMPDIR1 dumpfile=XXXXX_18-Dec-2012.dmp logfile=exp_XXXXX_18-2012.log its not working which gives the following error
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 0 KB
ORA-39165: Schema XXXXX was not found.
ORA-39168: Object path TABLE was not found.
ORA-31655: no data or metadata objects selected for job
Job "XXXXX"."SYS_EXPORT_SCHEMA_01" completed with 3 error(s) at 10:30:13when i gives EXCLUDE option then it working but it also exporting all tables
expdp XXXXX/YYYYYY schemas=XXXXX EXCLUDE=TABLE:\"LIKE('EXT\\_%')\" directory=DUMPDIR1 dumpfile=XXXXX_19-Dec-2012.dmp logfile=exp_XXXXX_19-Dec-2012.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 133.1 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/TABLESPACE_QUOTA
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/SEQUENCE/SEQUENCE
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/COMMENT
Processing object type SCHEMA_EXPORT/PACKAGE/PACKAGE_SPECany idea or suggestion?
Thanks
Sami -
Export Data Using Escape Character
Hi All
I have got a requirement where i need to export data from oracle with escape character.
eg. I am using a delimiter 237(í) and if the same character is present in data it should be escaped by escape character eg. /.
Once this file will get created i need to load this file in Netezza database which supports escape character.
Data in oracle table
FirstName Lastname Designation
abc xyz mnz
def ghío pqr
Data should be exported like below
FirstnameíLastnameíDesignation
abcíxyzímnz
defígh/íoípqr
Thanks.943994 wrote:
Thanks for the reply. I am new to Oracle and i am not able to find any command for exporting data in Oracle. I know we can do it manually using select statement but in that case we need to replace this delimiter with escape character and delimiter for all char fields.
In netezza we can directly do that without this. Please see below example and let me know if any such thing is present in Oracle.
SQL> CREATE EXTERNAL TABLE '/temp/test.csv' USING (REMOTESOURCE 'ODBC' DELIMITER 236 DATESTYLE 'YMD' DATEDELIM '-' TIMESTYLE '24HOUR' TIMEDELIM ':' MAXERRORS 0 ESCAPECHAR '\' NULLVALUE '' ) AS SELECT * FROM temp;
.CSV file created by above command:
abcíxyzímnz
defígh/íoípqr
Thankshttp://docs.oracle.com/cd/E11882_01/server.112/e22490/et_params.htm#sthref1293 -
How to use "where" clause in modify statement
Hi
can any1 telll me is it possible to use a where clause in a modify statemetn. I want to use modify statemetn to insert a new recoed in a database table.
Regards
Sabahuddin AhmedMODIFY itab - itab_lines
Syntax :
... itab FROM wa TRANSPORTING comp1 comp2 ... WHERE log_exp.
With these additions the MODIFY statement assigns the content of the comp1 comp2 ... components of the wa work area specified after TRANSPORTING to all lines in the itab table that meet the logical condition log_exp. The wa work area must be compatible with the line type of the internal table.
The TRANSPORTING addition has the same effect as changing individual lines. The WHERE addition can only be specified together with the TRANSPORTING addition. After WHERE, any logical expression can be specified in which the first operand of each individual comparison is a component of the internal table. All logical expressions are therefore possible, with the exception of IS ASSIGNED, , and IS SUPPLIED. It is not possible to dynamically specify a component using bracketed character-type data objects.
While for standard tables and hashed tables all lines in the internal table are checked for the logical expression of the WHERE statement, for sorted tables, optimized access can be achieved by checking at least one opening part of the table key for parity using AND linked queries in the logical expression.
Example
Change the contents of the planetype component for all lines in the sflight_tab internal table in which this component contains the value p_plane1 to the value p_plane2.
PARAMETERS: p_carrid TYPE sflight-carrid,
p_connid TYPE sflight-connid,
p_plane1 TYPE sflight-planetype,
p_plane2 TYPE sflight-planetype.
DATA sflight_tab TYPE SORTED TABLE OF sflight
WITH UNIQUE KEY carrid connid fldate.
DATA sflight_wa TYPE sflight.
SELECT *
FROM sflight
INTO TABLE sflight_tab
WHERE carrid = p_carrid AND
connid = p_connid.
sflight_wa-planetype = p_plane2.
MODIFY sflight_tab FROM sflight_wa
TRANSPORTING planetype WHERE planetype = p_plane1.
reward if useful -
How to use where clause with get statement in LDB programs
Hi All,
I am using logical databse in my report program.I am not getting how to use the where clause in the get statement is it possible to use?or if not possible only option is we should filter it after get statment is right?Can you please some body throw some idea on this?
Regards
MaheshHi,
Reffer these links
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm
/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases
reward if helpful
Thanks,
Suma. -
How to Parse Escape Character(&) with JSP Include URGENT
Hi,
I guess anyone could help me out.
I have a JSP file where I am including another JSP file and setting parameter for that include file. Among those parameters one of the parameter is having a value having ampersand with it. like R&D. In such case am i getting following error.
I dont know how should I get rid of this &.
I tried converting it to amp; even tried \\& also tried using escape("R&D"). But no success. Can you guys help
Code:
<jsp:include page="../hottopics/controller_hottopics1.jsp" flush="true">
<jsp:param name="UserID" value="<%=username%>" />
<jsp:param name="kmsid" value="<%=kmsid%>" />
<jsp:param name="department" value="<%=department%>"/>
<jsp:param name="location" value="<%=location%>"/>
<jsp:param name="supportorg" value="<%=supportorg%>"/>
<jsp:param name="supportflag" value="<%=supportflag%>"/>
</jsp:include>
department : R&D
Error :
java.lang.IllegalArgumentException
at javax.servlet.http.HttpUtils.parseQueryString(HttpUtils.java:151)
at org.apache.tomcat.facade.RequestDispatcherImpl.addQueryString(RequestDispatcherImpl.java:546)
at org.apache.tomcat.facade.RequestDispatcherImpl.doInclude(RequestDispatcherImpl.java:388)
at org.apache.tomcat.facade.RequestDispatcherImpl.include(RequestDispatcherImpl.java:270)
at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:414)
at ITHelpAlerts_0002dv_00034._0002fITHelpAlerts_0002dv_00034_0002fgadget_0002ejspgadget_jsp_7._jspService(_0002fITHelpAlerts_0002dv_00034_0002fgadget_0002ejspgadget_jsp_7.java:210)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServlet.java:130)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:282)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
at org.apache.tomcat.core.Handler.service(Handler.java:287)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
at java.lang.Thread.run(Thread.java:534)Okay, not surprising. Like I said, the & has special meaning in URLs, to seperate one parameter from the next. Perhaps you should thing about using request attributes instead of parameters:
request.setAttribute("department", "R&D");
//then on recieving side
String department = (String)request.getAttribute("department"); -
Delete adjacent duplicates how to use in the below select statement
hi i have a problem
i am suing the below select statement
SELECT a~extno
a~guid_lclic " for next select
e~ctsim
e~ctsex
*revised spec 3rd
f~guid_pobj
f~amnt_flt
f~amcur
f~guid_mobj
e~srvll "pk
e~ctsty "PK
e~lgreg "PK
INTO TABLE gt_sagmeld
FROM /SAPSLL/LCLIC as a
INNER JOIN /sapsll/tlegsv as e on elgreg = algreg
inner join /sapsll/legcon as f on fguid_lclic = aguid_lclic " for ccngn1 selection
inner join /sapsll/corcts as g on gguid_pobj = fguid_pobj
where a~extno in s_extno.
sort gt_sagmeld by guid_lclic lgreg ctsty srvll GUID_POBJ GUID_MOBJ.
delete adjacent duplicates from gt_sagmeld comparing guid_lclic lgreg ctsty srvll GUID_POBJ GUID_MOBJ .
now i am confused how to use delete adjacent dupliacate and on which fields
as first table /sal../lclic primary key is guid_lclic
and it is joined to table
legcon by guid_lclci ( not a primary key here)
legcon primary key is guid_legcon
and table 3 legsv by lgreg (pk here)
table 3 has tow more primary key srvll and ctsty also
NOW MY QUESTIO IS TAHT IS I USE ABOVE DELETE ADJACENT STATMENT IT FETCHES 20 LAKH RECORDS
I WANT TO REDUCE IS LET ME KNOW ON WHAT fields i need to use delete adjacen duplicates
or use comparing all fields?
regards
Arorahi sudha
if u see my select statement is contains four Primary keys
srvll
lgreg
ctsty
guid_lclic
but the next table connected to this table legcon is by guid_pobj and anothe table by guid_mobj
and if i take this gt_sagmeld to another temp table and i find abt 10 lakh uniques guid_pobj
similary 6 lakh guid_mobj so the next slect is hanpering because of this
not COMING TO OUR POINT IF I SORT ONLY BY OUR PRIMARY KEYS NOT TAKING INTO ACCOUNT TEH GUID_POBJ AND GUID_MOBJ
THE ENTRIES ARE VERY LESS BUT IF I TAKE INOT ACCCOUNT IN GT_SAGMELD THE ENTRIES ARE ABT 20 LAKH
SO I AM NOT SURE WHETHER TO TAKNE GUID_POBJ AND GUID_MOBJ INOT ACCOUNT FOR DELECTING ADJACENT DUPLICATES?
HENCE THE QUESTION OF ON WHICH FIRLD DELETE OR COMPARING ALL FIELDS I USE? -
Please help how to use WITH query in UPDATE
Hi Experts,
Please help me.
Thanks.Not sure about your required output. But try using WITH clause query inside SET clause of UPDATE statement.
UPDATE SALES_REVENUE SR
SET
(SR.TODAY_REV,
SR.TODAY_MARGIN,
SR.TODAY_UNIT
) =
(WITH result_sum_temp
AS(
SELECT SALE_ID, IN_TEAM, 1 SALE_FLAG, loc, seg,
SUM(REV * rate) AS sum_rev,
SUM(MARGIN * rate) AS sum_mar,
SUM(UNIT) AS SUM_UNIT
FROM SALES
WHERE (IGNORED IS NULL OR IGNORED <> 'Y')
AND SALE_SPOT = 7
AND SALE_ID = 375
AND SALE_MODEL = 'D'
AND IN_TEAM IS NOT NULL AND loc IS NOT NULL
GROUP BY SALE_ID, IN_TEAM, loc, seg
UNION ALL
SELECT SALE_ID, OUT_TEAM, 2 SALE_FLAG, loc, seg,
SUM(REV * rate) AS sum_rev,
SUM(MARGIN * rate) AS sum_mar,
SUM(UNIT) AS SUM_UNIT
FROM SALES
WHERE (IGNORED IS NULL OR IGNORED <> 'Y')
AND SALE_SPOT = 2
AND SALE_ID = 375
AND SALE_MODEL = 'D'
AND OUT_TEAM IS NOT NULL AND loc IS NOT NULL
GROUP BY SALE_ID, OUT_TEAM, loc, seg)
(SELECT t.sum_rev, t.sum_mar, t.sum_unit
FROM result_sum_temp t
WHERE SR.SALE_ID = t.SALE_ID
AND SR.team_id = t.team_id
AND SR.SALE_FLAG = t.SALE_FLAG
AND SR.SEG = t.seg
AND SR.loc = t.loc
AND t.SALE_ID = 255)
WHERE SR.SALE_SPOT = 890
AND SR.SALE_ID = 255
AND (SR.SALE_ID, SR.team_id, SR.sale_flag, SR.SEGMENT, SR.LOB) IN
(SELECT SALE_ID,
team_id,
sale_flag,
seg,
loc
FROM result_sum_temp)); -
Using Escape character for Multi character delimiter for flat files in IKM
Hi
I have an IKM using Jython, it is working fine for single character delimiter. But as per requirement I have to use multicharacter delimiter ;" (semi colon and double quotes).
I am taking this into variable using
filesep = "<%=snpRef.getSrcTablesList("", "[SFILE_SEP_FIELD]", "", "")%>"
but it is giving lexical error.
Can anybody help me with the use of escape character in current scenario?
Any other suggestions are also appreciated.
Thanks
AnkitHello,
A small tweak may solve your problem:
Instead of :
CONCATENATE wa_condstr ' bukrs = ' pa_bukrs INTO wa_condstr SEPARATED BY space.
Use:
CONCATENATE wa_condstr ' bukrs = ' 'PA_BUKRS' INTO wa_condstr SEPARATED BY space.
Then use this in SELECT.
Anyways for your answer the escape character for apostrophe is an apostrophe )
Try this you will understand:
DATA:
V_STR TYPE STRING VALUE ''''.
WRITE: V_STR.
BR,
Suhas -
Updating a column using deleted/inserted during update statement execution
I need to capture the old value while update statement is executed. I can not insert into temp table (there are many samples online where you can use OUTPUT clause to insert data in same table or another temp table)
something like
declare @count table
id int,
changed varchar (50)
insert into @count (id,changed) values (2,'T')
insert into @count (id,changed) values (3,'T')
insert into @count (id,changed) values (4,'T')
select * from @count
UPDATE @count
SET id=5,
Changed = GETDATE() -- here instead of date, I want to get inserted.id and deleted.id
OUTPUT inserted.id,
deleted.id
where id = 2
SELECT *FROM @count
Any help on this will be very much appreciated....I am not sure to follow your question but you can get the old value just by doing:
UPDATE @count
SET id=5,
Changed = id
OUTPUT inserted.id,
deleted.id
WHERE id = 2;
since SQL Server uses all-at-once operations.
Microsoft SQL Server 2012 T-SQL Fundamentals
http://shop.oreilly.com/product/0790145321978.do
AMB
Some guidelines for posting questions...
Maybe you are looking for
-
Need a stop watch to use in Captivate 7.
https://workspaces.acrobat.com/app.html#d=vtyrbwFWIniJ4b01F2g84A was suggested, but an error message appears when I try to import it into Captivate 7. Says it's an invalid widget.
-
I created this full walkthru for people who upgrade / or replace their hard drive / SSD drive on the Lenovo Yoga 2 Pro or other Lenovo products that has the Nova button - One Key recovery solution. I did this on my Yoga 2 Pro. So it should work perfe
-
Simple animation software for Arch?
Can anyone suggest a simple animation program for Linux; something similar to AnimationShop for windows. I know there's gimp-GAP, but that seems to be fairly advanced for my purposes. I just want to be able to string together images into .gif or vi
-
About what can i do for building exchange server
hi , i want to know any thing about building new exchange server in my comapny and i want to know some issues about this - if i build this server in my company and buy server hardware how much of the exchange licence that support 50000 users and al
-
Acrobat 8.1.3 bug take 2
I had an issue a few weeks back that wouldn't allow me to copy and paste anything. Upon my IT's departments failure to find a fix for the issue, my computer was re-imaged. Everything has been going well until this morning when Acrobat Pro updated to