realbasic-nug
[Top] [All Lists]

Re: Prepare Statements in Realbasic

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Prepare Statements in Realbasic
From: Norman Palardy <npalardy at great-white-software dot com>
Date: Mon, 30 Jul 2007 11:22:11 -0600
Delivered-to: listarchive at realsoftware dot com
Delivered-to: realbasic-nug at lists dot realsoftware dot com
References: <20070730170145 dot 5C3347961C1 at mail dot verex dot com>
On 30-Jul-07, at 11:01 AM, joe at strout dot net wrote:

> On Jul 30, 2007, at 12:28 UTC, rb at natgine dot org wrote:
>
>> No, I mean prepared statements.
>>
>> e.g.
>>
>>
> http://dev.mysql.com/tech-resources/articles/4.1/prepared- 
> statements.html
>
> Oh, that.  You could use that through SQL:
>   <http://dev.mysql.com/doc/refman/5.0/en/sqlps.html>


The ONLY thing to remember is that ANY statement that returns data is  
used with SQLSElect

        mysqldb.sqlexecute("PREPARE stmt_name FROM ""SELECT name FROM  
Country WHERE code = ?""")

        mysqldb.sqlexecute("SET @test_parm = ""FIN""")

        dim rs as RecordSet = mysqldb.SQLSSelect("EXECUTE stmt_name USING  
@test_parm")

However, unless the statement is pre-optimized it's not much better than

        dim rs as RecordSet = mysqldb.SQLSSelect("SELECT name FROM Country  
WHERE code = ""FIN"" ")

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>