I don't know of any other way to do this, expect by creating a function.
Example:

        Declare Function AssignVar(ByVal MyQuery As String) As String

        Function AssignVar(ByVal MyQuery As String) As String
                Run Command MyQuery & " Into TempTab"
                Fetch First From TempTab
                AssignVar TempTab.Col1
                Close Table TempTab
        End Function

'Now you only need the following statement:
        v_townname = AssignVar("Select TownName From TownTable Where
TownID=876")

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 28, 2002 9:44 AM
To: [EMAIL PROTECTED]
Subject: MI-L Selection into a variable


Hello,

Is there a way to have the result of a selection directly in a variable?
(when the selection brings back only one row)

For ex. instead of:
--------------
Dim v_townname As String

Select TownName From TownTable Where TownID=876 Into _tempTable

Fetch First From _tempTable
v_townname=_tempTable.TownName
---------------

Is there something faster?

Thanks,

David Berger

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to