Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Using NumCachedCursors = 25 and SELECT INTO

4 posts in Delphi Last posting was on 2012-01-27 16:40:08.0Z
Markus Terbrack Posted on 2012-01-25 10:10:21.0Z
From: "Markus Terbrack" <terbrack@advantex.de>
Newsgroups: Advantage.Delphi
Subject: Using NumCachedCursors = 25 and SELECT INTO
Date: Wed, 25 Jan 2012 11:10:21 +0100
Lines: 1
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8117.416
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416
NNTP-Posting-Host: 85.8.92.125
Message-ID: <4f1fd4ea$1@solutions.advantagedatabase.com>
X-Trace: 25 Jan 2012 02:09:46 -0700, 85.8.92.125
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.Delphi:25633
Article PK: 1109212

Hi NG,

we are using the ads-version 10.10.0.25 with the setting NumCachedCursors =
25.
I am using the following code to select data into a table:
Qry := TAdsQuery.Create(nil);
try
Qry.SQL.Text := 'SELECT * INTO "\\adv-db\data\Reports" FROM TableX';
Qry.ExecSQL;
finally
Qry.Close;
Qry.AdsCloseSQLStatement;
Qry.Free;
end;

After that the table has to be moved but this is not possible because it is
still opened. (A windows error-message pops up.)

If i set NumCachedCursors to 0 i am able to move the table Reports.adt
without problems.

Has anyone an idea how i can close the table completly despite
NumCachedCursor is set to 25 so that it can be moved?

Regards Markus


Alex Wong Posted on 2012-01-25 18:16:26.0Z
Date: Wed, 25 Jan 2012 18:16:26 +0000 (UTC)
Message-ID: <9d18799595658cea969e9812463@devzone.advantagedatabase.com>
From: Alex Wong <someone@sybase.com>
Subject: Re: Using NumCachedCursors = 25 and SELECT INTO
Newsgroups: Advantage.Delphi
References: <4f1fd4ea$1@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Reader 1098.1
NNTP-Posting-Host: 10.6.193.123
X-Trace: 25 Jan 2012 10:15:49 -0700, 10.6.193.123
Lines: 40
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.Delphi:25634
Article PK: 1109215

Hi Markus,

Add the following line after AdsCloseSQLStatement;

Qry.AdsCloseSQLStatement;
Qry.AdsConnection.CloseCachedTables;

It forces the server to close all cached tables.

--
Alex

> Hi NG,
>
> we are using the ads-version 10.10.0.25 with the setting
> NumCachedCursors =
> 25.
> I am using the following code to select data into a table:
> Qry := TAdsQuery.Create(nil);
> try
> Qry.SQL.Text := 'SELECT * INTO "\\adv-db\data\Reports" FROM TableX';
> Qry.ExecSQL;
> finally
> Qry.Close;
> Qry.AdsCloseSQLStatement;
> Qry.Free;
> end;
> After that the table has to be moved but this is not possible because
> it is still opened. (A windows error-message pops up.)
>
> If i set NumCachedCursors to 0 i am able to move the table
> Reports.adt without problems.
>
> Has anyone an idea how i can close the table completly despite
> NumCachedCursor is set to 25 so that it can be moved?
>
> Regards Markus
>


Markus Terbrack Posted on 2012-01-27 07:17:20.0Z
From: "Markus Terbrack" <terbrack@advantex.de>
Newsgroups: Advantage.Delphi
References: <4f1fd4ea$1@solutions.advantagedatabase.com> <9d18799595658cea969e9812463@devzone.advantagedatabase.com>
In-Reply-To: <9d18799595658cea969e9812463@devzone.advantagedatabase.com>
Subject: Re: Using NumCachedCursors = 25 and SELECT INTO
Date: Fri, 27 Jan 2012 08:17:20 +0100
Lines: 1
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response
Content-Transfer-Encoding: 7bit
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8117.416
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8117.416
NNTP-Posting-Host: 85.8.92.125
Message-ID: <4f224f58@solutions.advantagedatabase.com>
X-Trace: 26 Jan 2012 23:16:40 -0700, 85.8.92.125
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.Delphi:25641
Article PK: 1109220

Hi Alex,

thanks for your reply.
To close all cached tables is a bit overhead in this situation. Would be
nice if it is possible to close exactly the table i want to move.
Maybe you can think of a new function that can do this. I believe this would
be very helpfull.

Kind regards
Markus

"Alex Wong" <someone@sybase.com> schrieb im Newsbeitrag
news:9d18799595658cea969e9812463@devzone.advantagedatabase.com...

> Hi Markus,
>
> Add the following line after AdsCloseSQLStatement;
>
> Qry.AdsCloseSQLStatement;
> Qry.AdsConnection.CloseCachedTables;
>
> It forces the server to close all cached tables.
>
> --
> Alex
>
>> Hi NG,
>>
>> we are using the ads-version 10.10.0.25 with the setting
>> NumCachedCursors =
>> 25.
>> I am using the following code to select data into a table:
>> Qry := TAdsQuery.Create(nil);
>> try
>> Qry.SQL.Text := 'SELECT * INTO "\\adv-db\data\Reports" FROM TableX';
>> Qry.ExecSQL;
>> finally
>> Qry.Close;
>> Qry.AdsCloseSQLStatement;
>> Qry.Free;
>> end;
>> After that the table has to be moved but this is not possible because
>> it is still opened. (A windows error-message pops up.)
>>
>> If i set NumCachedCursors to 0 i am able to move the table
>> Reports.adt without problems.
>>
>> Has anyone an idea how i can close the table completly despite
>> NumCachedCursor is set to 25 so that it can be moved?
>>
>> Regards Markus
>>
>
>


Alex Wong Posted on 2012-01-27 16:40:08.0Z
Date: Fri, 27 Jan 2012 16:40:08 +0000 (UTC)
Message-ID: <9d18799595d88ceaaeecaf68dd4@devzone.advantagedatabase.com>
From: Alex Wong <someone@sybase.com>
Subject: Re: Using NumCachedCursors = 25 and SELECT INTO
Newsgroups: Advantage.Delphi
References: <4f224f58@solutions.advantagedatabase.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=iso-8859-1; format=flowed
X-Newsreader: JetBrains Omea Reader 1098.1
NNTP-Posting-Host: 10.6.193.123
X-Trace: 27 Jan 2012 08:39:26 -0700, 10.6.193.123
Lines: 68
Path: solutions.advantagedatabase.com
Xref: solutions.advantagedatabase.com Advantage.Delphi:25642
Article PK: 1109221

Hi Markus,

I should be a bit more clear on my last reply. The CloseCachedTables forces
the server to close all cached tables ON THE PARTICULAR CONNECTION. Yes,
it is a bit expensive because if the connection is to be used to execute
other SQL statements, those tables will need to be physically opened again.
It defeats the optimization of having frequently used table cached.

You can avoid the expenses by using a dedicated connection for this specific
process.

--
Alex

> Hi Alex,
>
> thanks for your reply.
> To close all cached tables is a bit overhead in this situation. Would
> be
> nice if it is possible to close exactly the table i want to move.
> Maybe you can think of a new function that can do this. I believe this
> would
> be very helpfull.
> Kind regards
> Markus
> "Alex Wong" <someone@sybase.com> schrieb im Newsbeitrag
> news:9d18799595658cea969e9812463@devzone.advantagedatabase.com...
>
>> Hi Markus,
>>
>> Add the following line after AdsCloseSQLStatement;
>>
>> Qry.AdsCloseSQLStatement;
>> Qry.AdsConnection.CloseCachedTables;
>> It forces the server to close all cached tables.
>>
>> --
>> Alex
>>> Hi NG,
>>>
>>> we are using the ads-version 10.10.0.25 with the setting
>>> NumCachedCursors =
>>> 25.
>>> I am using the following code to select data into a table:
>>> Qry := TAdsQuery.Create(nil);
>>> try
>>> Qry.SQL.Text := 'SELECT * INTO "\\adv-db\data\Reports" FROM TableX';
>>> Qry.ExecSQL;
>>> finally
>>> Qry.Close;
>>> Qry.AdsCloseSQLStatement;
>>> Qry.Free;
>>> end;
>>> After that the table has to be moved but this is not possible
>>> because
>>> it is still opened. (A windows error-message pops up.)
>>> If i set NumCachedCursors to 0 i am able to move the table
>>> Reports.adt without problems.
>>>
>>> Has anyone an idea how i can close the table completly despite
>>> NumCachedCursor is set to 25 so that it can be moved?
>>>
>>> Regards Markus
>>>