All Forums Database
25 Mar 2013
Stored Procedure Vs Bteq

Hi All,
Could any one tell the advantages and disadvantages of using SP and Bteq basically a comparison of both and the scenario
when one is prefered over another
My general understanding is the that unless there is need for conditional programming mostly Bteq is preferred
please help in understanding the two and when to choose one over the other
 
Thanks
R.Rajeev

26 Mar 2013

Hi All,
Can anyoone please provide some insight on the above question
looking forward !!
Thanks
R.Rajeev

27 Mar 2013

Hi All,
Any help on the above would be very useful.
looking forward
Thanks
R.Rajeev
 

sudheer51 7 posts Joined 03/13
01 Apr 2013

"BTEQ" (Basic Teradata Query) is a tool (Client) to compose queries (and to see results).
 
Where as "StoredProcedure" is a subroutine (a concept) in SQL.
 
These two cannot be compared.., Its like, comparing between "Dell" and "Adobe Photoshop"

If at first you don't succeed; call it version 1.0

02 Apr 2013

Hi Sudheer
Thanks for getting back !
Yeah i understand Bteq is a tool but what i meant was a comparison of the Bteq scripts and SP
there are things which can be accomplished using both a Bteq script in batch mode as well a SP , in that
case how does one weigh both and choose one over the other
 
Regards
R.Rajeev

sudheer51 7 posts Joined 03/13
02 Apr 2013

@Rajeev:
 
I got your query now.
I am also a newbie in teradata.. May be we shall wait for some one to answer..
 
Anyone there to answer the query???

If at first you don't succeed; call it version 1.0

Adeel Chaudhry 773 posts Joined 04/08
03 Apr 2013

Few coming in my mind would be ....
 
BTEQ script:
Simplistic conditional logic
No exception handling
Runs on CLI connection
No concept of parameters
 
SP:
Complex conditional logic
Exception handlers
Pre-compiled
Parameters supported
Physical object in Database
Requires respective rights (depends on usage i.e. SQL used in SP)
 
If you have a repeated set of same SQL to be ran over and over again .... BTEQ is usually preffered due to ease of use and maintainability and also because BTEQ has been there since the early days of Teradata.
 
Whereas .... SP is for more dynamically variant scenarios where you wish to retain control based on the input. It is precompiled and no SQL parsing is required.
 
Both have alot of similar traits to offer .... but it comes to the comfort of the solution provider as well for selecting among the both.
 
HTH!

-- If you are stuck at something .... consider it an opportunity to think anew.

You must sign in to leave a comment.