|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > Question on: & |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|