Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 22nd, 2004, 01:34 PM
Jag1 Jag1 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 10 Jag1 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question on: &

I have an update SQL witten that will add a code to a field where a request type is in list. Prob is that one of the request types has an '&' in its text. This is causing the SQL to prompt for input. How to I get the data filtered and treat the '&' as part of the string?

Example:

Update PS_IDS_RQST_TYPE
Set IDS_UNCL_PROP_TYPE = '44'
where IDS_RQST_TYPE_CD in ('ADC','ADV','AGN','ASO','B&O','BC','CED');


Thanks

Reply With Quote
  #2  
Old September 22nd, 2004, 05:25 PM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,308 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 5 h 20 m 49 sec
Reputation Power: 48
It has a 'appear' at runtime, not during parse time
use CHR(38).
Code:
('ADC','ADV','AGN','ASO','B'||CHR(38)||'O','BC','CED');


This may cause issues for the optimizer. You may have to resort to PL/SQL and use bind variables.

Isn't there a validation table for those values? You could use a sub-select
Code:
where something in 
(select valid_values from myvalidation)

Last edited by jim mcnamara : September 22nd, 2004 at 05:28 PM.

Reply With Quote
  #3  
Old October 17th, 2004, 11:08 AM
mj72 mj72 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 5 mj72 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
A little late I know but in addition you can change the "define variable" character in SQL*Plus to something different than &.

Use: SET DEFINE OFF to turn off variable substitution all together or: SET DEFINE ? to change it to a question mark.

Martin

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Question on: &


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT