Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Multi-Rows from DUAL

Gerd VolbergApr 3 2007 — edited Nov 19 2010
I need an easy select from DUAL, which gives me more than one row.

e.g. 1000 rows or 4500 rows....


I know that one of the best solutions was something with an CONNECT BY PRIOR and a WHERE ROWNUM <= 1000 e.g.


But what was the complete statement?

thx 4 solutions
Gerd

Comments

spajdy

I'm not sure that CANCEL is valid command, but anyway create a simple text file <name>.sql and write all commands you want to run there. <name> - replace by any meaningful name Then run SQL*Plus log in and run you script file by @<name>

User_MV0PW

"CANCEL" is not a command, it's a response for "RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE;" command. I enter "RECOVER ..." command, I got a question "Specify log: {<RET>=suggested | filename | AUTO | CANCEL}", I should enter "CANCEL" as an answer for that question, but not as a command.

Billy Verreynne
Answer

You can try redirecting stdin (standard input) to your bash process.
E.g.

sqlplus "/ as sysdba" <<EOF
  recover ...
  cancel
  exit
EOF

EOF is simply a text token used to mark where stdin redirection need to cease.

Marked as Answer by User_MV0PW · Aug 24 2021
User_MV0PW

THANK YOU VERY MUCH!!! IT WORKS!!!

1 - 4
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Dec 17 2010
Added on Apr 3 2007
49 comments
57,825 views