The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
sed query gopsman Shell Programming and Scripting 4 02-03-2009 02:41 AM
Query in awk raguramtgr UNIX for Dummies Questions & Answers 1 08-31-2004 05:38 AM
Query In awk raguramtgr UNIX for Dummies Questions & Answers 1 08-27-2004 11:00 AM
RPM Query silvaman UNIX for Advanced & Expert Users 1 08-15-2003 07:56 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-06-2006
Lindarella Lindarella is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 12
& in SQL query

I have a script that looks for all jobs that contain a particular calendar.

Some of the calendars have '&' in them and sql freaks out when it encounters that.. is there a way around this?

I have tried:

select job_name from job where run_calendar='1&15dom'
select job_name from job where run_calendar='1\&15dom'


Any help is much appreciated...

Linda
  #2 (permalink)  
Old 10-06-2006
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
Which database is it? MySQL does not seem to have this problem.
  #3 (permalink)  
Old 10-06-2006
mona's Avatar
mona mona is offline
Registered User
  
 

Join Date: Nov 2005
Location: Singapore
Posts: 96
Are you running this in SQL Plus. & is a substitution variable in Oracle. The only way to prevent substitution in SQL Plus is by setting define off.

Run SET DEFINE OFF before running the SQL command
  #4 (permalink)  
Old 10-09-2006
Lindarella Lindarella is offline
Registered User
  
 

Join Date: Jul 2006
Posts: 12
Thanks!

I did a "set escape \" in sqlplus and then I was able to backslash the literal...
Sponsored Links
Closed Thread

Bookmarks

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:08 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0