Article View: borland.public.cppbuilder.database.ado
Article #5116Re: Problem with "Select Into" query
From: Formentz
Date: Mon, 16 Jul 2001 08:10
Date: Mon, 16 Jul 2001 08:10
43 lines
2165 bytes
2165 bytes
Hi Guy,
the select into statement needs a table name, which it will create and
insert the records.
ou can't use a parameter to specify a table name, so you'll need to put the
table name in the SQL statement :
AnsiString TableName="something";
Form1->Query1->SQL->Add("SELECT Field1 INTO "+TableName+" FROM Table1
WHERE Field2 = :parameter1");
For your second question, it seems strange that it doesn't clear the SQL
property, you can try to do
Form1->Query1->SQL->Text="";
instead of Clear and see if it works.
HTH
Ciao
Formentz
"Guy" <guy_kariv@hotmail.com> ha scritto nel messaggio
news:3b51671e_1@dnews...
> Hi,
> I wrote a "Select into" query and it doesn't work. (The parameters were
> defined properly at design time)
>
> The query:
>
> Form1->Query1->Parameters->ParamByName("parameter1")->Value =
Name;
>
> Form1->Query1->Close();
> Form1->Query1->SQL->Add("SELECT Field1 INTO :parameter2 FROM
> Table1 WHERE Field2 = :parameter1");
> Form1->Query1->Open();
>
> And I've got the following error message during executing Open command:
> invalid host/bind variable name
>
>
> Can somebody help me please?
>
> Thanks,
> Guy
>
>
Technical Details
Message-ID:
<3b52a043_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3b51671e_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,91b15c90acaec3bd X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2001-07-16 01:09:31 PST From: "Formentz" <francesco@leotron.com> Newsgroups: borland.public.cppbuilder.database.ado References: <3b51671e_1@dnews> Subject: Re: Problem with "Select Into" query Date: Mon, 16 Jul 2001 10:10:13 +0200 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 NNTP-Posting-Host: 62.122.23.110 Message-ID: <3b52a043_1@dnews> X-Trace: dnews 995270723 62.122.23.110 (16 Jul 2001 01:05:23 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!dnews