| Hyderabad Jobs | Book Website | ![]() |
I Love Hyderabad | Hyderabad Colleges |
| Home | Business Emails | Hyderabad Classifieds | Contact Us | |
| 7 Wonders of Hyderabad | Web Hosting | Yellow Pages | Our Network | |
Advanced PowerBuilder
Format 2While considering format 2, you need to be prepared to handle user-defined parameters, even though you still can't get the results' set. Before executing the SQL statement, it has to be prepared using the PREPARE command. The syntax is as follows: PREPARE command FROM :string ; Here, string is an expression of the host language, that yields the character string representation of an SQL statement, and command is the name of an SQL variable, used to refer the prepared version of that SQL statement. The statement to be prepared can be any interactive SQL statement. An example for a Format 2 Dynamic SQL statement is shown below: Int lProductNo ; Date PriceDate ; Decimal Price LProductNo = 10 ; PriceDate = Today() ; Price = 120.43 PREPARE SQLSA FROM 'INSERT INTO "dba"."t_product_price1" VALUES (?,?,?)' ; EXECUTE SQLSA USING :LProductNo, :PriceDate, :Price ; If sqlca.sqlcode <> 0 Then
MessageBox( "ERROR", string( sqlca.sqlcode ) + &
SQLCA.SqlErrText )
End If
Return
Statements such as DECLARE CURSOR, OPEN, FETCH, CLOSE and so on can't be the subject for PREPARE, and the source form of a statement must not include UPDATE WHERE CURRENT OF, DELETE WHERE CURRENT OF or a statement terminator.
|
| Copyright © 1996 - 2006 HamaraShehar.com Pvt. Ltd. All Rights Reserved.
Domain Registration, Website Design, Website Hosting by HamaraShehar.com |