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