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:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old September 16th, 2004, 06:43 AM
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
Prompting in SQL Plus

I want to do a prompt for a date for a table update I am doing but am not sure of the syntax.


Update Table.name
SET STATUS = 'O'
where STATUS = 'C'
and IDS_REQUEST_DATE <= '01-JAN-02'


This update will be used multiple times so I wanted to go ahead and just have it aske for a date instaead of having to update the core file each time.

Any suggestions would be muxh appreciated.

Thanks

Reply With Quote
  #2  
Old September 16th, 2004, 07:41 AM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 5
Use bind variable, this can be defined by preceding & of any variable in your SQL statement.

Update Table.name
SET STATUS = 'O'
where STATUS = 'C'
and IDS_REQUEST_DATE <= '&r_date'

Reply With Quote
  #3  
Old September 16th, 2004, 08:19 AM
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
Worked great. Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Prompting in SQL Plus


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 4 hosted by Hostway