How to use "while" statements in oracle?



How to use "while" statements in oracle?..

Answer / Madhup Kumar

In Oracle, you can use a 'LOOP' statement with an embedded 'EXIT' statement to create a while loop. Here's an example:n```sqlnDECLAREn counter NUMBER := 1;nBEGINn LOOPn IF counter > 10 THEN EXIT; END IF;n DBMS_OUTPUT.PUT_LINE(counter);n counter := counter + 1;n END LOOP;nEND;
``

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

How to define Data Block size ?

2 Answers  


What is Database Link ?

2 Answers  


How to import one table back from a dump file?

1 Answers  


Explain what are the different type of segments?

1 Answers  


What privilege is needed for a user to query tables in another schema?

1 Answers  


Why do I get java.lang.abstractmethoderror when trying to load a blob in the db?

1 Answers  


11. Display the client number and name and the client number and name of the person who referred that client.

1 Answers   Wipro,


I need to get the values of the previous quarter.how to do this?eg: if my cuurent month is may i need to get the datas of the month jan,feb,march.Can it be done in oracle.I tried with date function q but for the month jan its not retriving the previous quarter(oct-dec).how to solve this.plpz anyone help me?

2 Answers   Philips,


how to get the index id?

1 Answers   Cognizant, TCS,


What is oracle server autotrace in oracle?

1 Answers  


State the various uses of dbcc command?

1 Answers  


Can a View based on another View ?

3 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1803)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)