Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: SQL Server
Expertise: Beginner
Oct 26, 1999

Limited Dynamic SQL

Question:
I am a technical copywriter currently writing a fact sheet for a software company providing DB2 SQL support. They have something they want to call "limited dynamic SQL."

Here's a description:

    Flexible SQL lets developers add SQL text strings to SQL statements. With "Limited Dynamic SQL", natural host variables can also be added. These variables are set by the program dynamically and interpreted at runtime.
Is this an appropriate term? (The people who came up with the term are German.)

Answer:
That is the sum of my understanding of what dynamic SQL does. It allows a third- or fourth-generation language to use SQL in line in its code, and keeps placeholder variables in the host language to accept the results of the query.

Host variables (usually signified by a preceding colon, as in ":MyVar") are placeholders for the results of a prepared SQL query.

The application sets up a query string and sends it to the server (PREPARE). The statement is then parsed, compiled, and made ready for execution.

This gives the application the advantage of a compiled parameterized procedure to run, which is quicker than if it were not prepared. When the statement returns, the host variables hold the data.

With that said, I do not see the limitation in the vendor's implementation of dynamic SQL, since what you describe is the essence of using SQL in some other procedural language.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date