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 November 6th, 2004, 12:09 AM
chuaypeng chuaypeng is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2004
Posts: 1 chuaypeng User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Prompt/Accept

Hi,

I need help.

I am new in SQL+ and wanted to write a program to exact some datas. I want to ask for 2 prompts which user has to key in the inputs. Here is a sample of the coding.

accept datefrom date format 'dd/mm/yyyy' prompt 'Enter date from format dd/mm/yyyy' : '
accept dateto date format 'dd/mm/yyyy' prompt 'Enter date to format dd/mm/yyyy: '
select....

order by employee_no

save data.sql replace

see...I do this in notepad and paste it in command line..then it gaves me error after the first accept command...

what would it be the error then? after analyse for a few times, I found that when i copy and paste...the first accept will prompt and the second accept goes to the first prompt...
something like that...

accept datefrom date format 'dd/mm/yyyy' prompt 'Enter date from format dd/mm/yyyy' : '
Enter date from format dd/mm/yyyy : accept dateto date format 'dd/mm/yyyy' prompt 'Enter date to format dd/mm/yyyy: '
error.......

So what can I do? Pls help.

Thanks.
CP

Reply With Quote
  #2  
Old November 8th, 2004, 07:51 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: 6
Below is a query that is working fine:

Code:
accept deptno_from number prompt 'Enter department# :'
accept  deptno_to   number prompt 'Enter department# :'
SELECT * FROM emp
WHERE deptno >= &deptno_from
AND deptno <= &deptno_to
ORDER BY deptno


I saved this code in a file called dept.sql and run it using following command at SQL prompt

SQL>@dept.sql

It asks me department number for each prompt.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Prompt/Accept


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 2 hosted by Hostway
Stay green...Green IT