• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

What is an SQL procedure

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Martin Vajsar wrote:I'm still not sure what are you asking about. Do you want a more in-depth explanation of how storing SQL queries in properties file works?



I just want to know what SQL Procedures are and why it is used...!!
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since you were actually asking two questions, I've split it into a separate topic. Next time please UseOneThreadPerQuestion.

SQL procedures, usually called stored procedures, are a piece of code stored and executed inside the database. Different databases use different languages for stored procedures, for example MS SQL Server uses Transact-SQL, and Oracle uses PL/SQL. Plain SQL commands and queries can usually be easily embedded into the stored procedure. Stored procedures are part of the database schema. A Java application would typically call a stored procedure which was created in the database by a setup script, for example. It is possible to create a new stored procedure from Java, but certainly not usual. JDBC has a special escape sequence for calling a stored procedure, because the exact syntax used to call it may differ among databases.

The most important reason to use a stored procedure is (in my opinion) to move processing to the database, so a to avoid transferring large amounts of data from database to application and back over the network. There are other valid reasons, such as concentrating DB specific features inside stored procedures, so that in case of migration to another database just the stored procedures would have to be ported.

Wikipedia has some more information on stored procedures.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic