<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.talis.com/tdn" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>Talis Developer Network - reservation popularity - Comments</title>
 <link>http://www.talis.com/tdn/node/1126</link>
 <description>Comments for &quot;reservation popularity&quot;</description>
 <language>en</language>
<item>
 <title>Ah.. makes sense now.  
The</title>
 <link>http://www.talis.com/tdn/node/1126#comment-660</link>
 <description>&lt;p&gt;Ah.. makes sense now.  &lt;/p&gt;
&lt;p&gt;The way I understood it from the TDN article was that rowcount didn&#039;t work at all on prism, that&#039;s why I was trying to find various workarounds for the &#039;top x&#039; type of query.&lt;/p&gt;
&lt;p&gt;Cheers&lt;br /&gt;
Mark&lt;/p&gt;
&lt;p&gt;http://www.wirral-libraries.net/&lt;br /&gt;
http://www.stembystem.co.uk/&lt;/p&gt;
</description>
 <pubDate>Thu,  8 May 2008 10:44:38 +0100</pubDate>
 <dc:creator>markhughes</dc:creator>
 <guid isPermaLink="false">comment 660 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>rowcount and prepared searches</title>
 <link>http://www.talis.com/tdn/node/1126#comment-659</link>
 <description>&lt;p&gt;There are two types of prepared searches - Offline and Online.&lt;/p&gt;
&lt;p&gt;In Offline prepared searches the results are extracted into a table from a script that is run once and so rowcount can be used. &lt;/p&gt;
&lt;p&gt;The Online prepared searches are run &#039;live&#039; when accessed by a user and those have issues with using rowcount.&lt;/p&gt;
&lt;p&gt;Some queries are better suited to the Offline approach because of the performance implications of the query.  A top x type of query is likely to be one where the performance would not be suitable for an on-line prepared search even given the rowcount issue.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Brian Crampton&lt;br /&gt;
Developer, Talis&lt;/p&gt;
</description>
 <pubDate>Thu,  8 May 2008 08:48:36 +0100</pubDate>
 <dc:creator>Brian Crampton</dc:creator>
 <guid isPermaLink="false">comment 659 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>Set rowcount in prepared search</title>
 <link>http://www.talis.com/tdn/node/1126#comment-658</link>
 <description>&lt;p&gt;Brian,&lt;/p&gt;
&lt;p&gt;I see from a few forum posts that &#039;set rowcount&#039; seems to work in a prism prepared search, but the TDN article says it doesn&#039;t.  Is there a problem using it in prism?&lt;/p&gt;
&lt;p&gt;Cheers&lt;br /&gt;
Mark&lt;/p&gt;
&lt;p&gt;http://www.wirral-libraries.net/&lt;br /&gt;
http://www.stembystem.co.uk/&lt;/p&gt;
</description>
 <pubDate>Wed,  7 May 2008 16:21:52 +0100</pubDate>
 <dc:creator>markhughes</dc:creator>
 <guid isPermaLink="false">comment 658 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>reservation popularity</title>
 <link>http://www.talis.com/tdn/node/1126#comment-655</link>
 <description>&lt;p&gt;The problem is that the SS_reservations table does not exist and this command will not create that table for you.&lt;/p&gt;
&lt;p&gt;if you change the SQL to&lt;/p&gt;
&lt;p&gt;SET ROWCOUNT 50&lt;br /&gt;
SELECT RL.TARGET_ID &quot;WORK_ID&quot;, COUNT(RL.RESERVATION_ID) &quot;FIGURES&quot;&lt;br /&gt;
into #SS_reservations&lt;br /&gt;
FROM RESERVED_LINK RL, RESERVATION R&lt;br /&gt;
WHERE RL.TYPE = 1&lt;br /&gt;
AND RL.RESERVATION_ID = R.RESERVATION_ID&lt;br /&gt;
AND R.CREATE_DATE &amp;gt;= DATEADD(DAY, -90, GETDATE())&lt;br /&gt;
GROUP BY RL.TARGET_ID&lt;br /&gt;
ORDER BY COUNT(RL.RESERVATION_ID) DESC&lt;/p&gt;
&lt;p&gt;It will create a temporary table called #SS_reservations (The hash indicates a temporary table.)&lt;/p&gt;
&lt;p&gt;By temporary I mean that within an isql session that table is available to be used so&lt;/p&gt;
&lt;p&gt;select * from #SS_reservations&lt;/p&gt;
&lt;p&gt;will work until you exit from isql and it won&#039;t exist for anyone else of for you if you start another isql session.&lt;/p&gt;
&lt;p&gt;A temporary table is held in temp_db database so you need to be careful that you don&#039;t fill it or the logs up.&lt;/p&gt;
&lt;p&gt;The SQL above is unlikely to do that but care needs to be taken.&lt;/p&gt;
&lt;p&gt;What you need to do is create the SS_reservations table in prod_talis first.&lt;/p&gt;
&lt;p&gt;e.g.&lt;br /&gt;
create table SS_reservations (&lt;br /&gt;
 WORK_ID   ID           NOT  NULL,&lt;br /&gt;
 FIGURES   smallint          NULL)&lt;br /&gt;
go&lt;br /&gt;
grant all on SS_reservations to public&lt;br /&gt;
go&lt;/p&gt;
&lt;p&gt;The smallint is upto 32,768 so should be big enough.  Use INT (2^31) if not.&lt;/p&gt;
&lt;p&gt;The trouble is that I now think with more consideration that with the SQL you have you may have to change the options on prod_talis to allow bulk data load but this would cause problems with transaction logging so would have to be done carefully e.g. the options changed, the script run, the options changed back and then a full dump done to allow transaction logging to start. &lt;/p&gt;
&lt;p&gt;There are talis scripts that require these changes but this may be more than you want to do.&lt;/p&gt;
&lt;p&gt;A different syntax will still log the transactions (the SS_reservations table still needs to be created) so allow the insert to work.&lt;/p&gt;
&lt;p&gt;insert into SS_reservations (WORK_ID,FIGURES)&lt;br /&gt;
SELECT RL.TARGET_ID &quot;WORK_ID&quot;, COUNT(RL.RESERVATION_ID) &quot;FIGURES&quot;&lt;br /&gt;
FROM RESERVED_LINK RL, RESERVATION R&lt;br /&gt;
WHERE RL.TYPE = 1&lt;br /&gt;
AND RL.RESERVATION_ID = R.RESERVATION_ID&lt;br /&gt;
AND R.CREATE_DATE &amp;gt;= DATEADD(DAY, -90, GETDATE())&lt;br /&gt;
GROUP BY RL.TARGET_ID&lt;br /&gt;
ORDER BY COUNT(RL.RESERVATION_ID) DESC&lt;br /&gt;
go&lt;/p&gt;
&lt;p&gt;Note: you would need to remove any data from the SS_reservations table first.&lt;/p&gt;
&lt;p&gt;As I said before all this type of changes to the db need to be done with great care as they are not covered by Support and done at your own risk.&lt;/p&gt;
&lt;p&gt;You don&#039;t want to fill your transaction logs or tempdb and affect anything the whole system.&lt;/p&gt;
&lt;p&gt;Thanks  &lt;/p&gt;
&lt;p&gt;Brian Crampton&lt;br /&gt;
Developer, Talis&lt;/p&gt;
</description>
 <pubDate>Thu, 17 Apr 2008 18:20:10 +0100</pubDate>
 <dc:creator>Brian Crampton</dc:creator>
 <guid isPermaLink="false">comment 655 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>Code</title>
 <link>http://www.talis.com/tdn/node/1126#comment-654</link>
 <description>&lt;p&gt;Thanks Brian,&lt;/p&gt;
&lt;p&gt;I was trying your code:&lt;/p&gt;
&lt;p&gt;SET ROWCOUNT 50&lt;br /&gt;
SELECT RL.TARGET_ID &quot;WORK_ID&quot;, COUNT(RL.RESERVATION_ID) &quot;FIGURES&quot;&lt;br /&gt;
into SS_reservations&lt;br /&gt;
FROM RESERVED_LINK RL, RESERVATION R&lt;br /&gt;
WHERE RL.TYPE = 1&lt;br /&gt;
AND RL.RESERVATION_ID = R.RESERVATION_ID&lt;br /&gt;
AND R.CREATE_DATE &amp;gt;= DATEADD(DAY, -90, GETDATE())&lt;br /&gt;
GROUP BY RL.TARGET_ID&lt;br /&gt;
ORDER BY COUNT(RL.RESERVATION_ID) DESC&lt;/p&gt;
&lt;p&gt;Cheers&lt;br /&gt;
Mark&lt;/p&gt;
&lt;p&gt;http://www.wirral-libraries.net/&lt;br /&gt;
http://www.stembystem.co.uk/&lt;/p&gt;
</description>
 <pubDate>Thu, 17 Apr 2008 15:09:37 +0100</pubDate>
 <dc:creator>markhughes</dc:creator>
 <guid isPermaLink="false">comment 654 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>inserting data into a table</title>
 <link>http://www.talis.com/tdn/node/1126#comment-652</link>
 <description>&lt;p&gt;You shouldn&#039;t need to grant permissions but could you let me have the SQL statement/s you were using and I&#039;ll have a look.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Brian Crampton&lt;br /&gt;
Developer, Talis&lt;/p&gt;
</description>
 <pubDate>Wed, 16 Apr 2008 15:55:17 +0100</pubDate>
 <dc:creator>Brian Crampton</dc:creator>
 <guid isPermaLink="false">comment 652 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>Brian,
I was tinkering with</title>
 <link>http://www.talis.com/tdn/node/1126#comment-651</link>
 <description>&lt;p&gt;Brian,&lt;/p&gt;
&lt;p&gt;I was tinkering with this on the MIS server, but gave up when it said&lt;/p&gt;
&lt;p&gt;&quot;You can&#039;t run SELECT INTO in this database. Please check with the Database&lt;br /&gt;
Owner.&quot;&lt;/p&gt;
&lt;p&gt;Out of curiosity... how would I get round this?  How would I grant permissions to &#039;select into&#039; a table?&lt;/p&gt;
&lt;p&gt;Cheers&lt;br /&gt;
Mark&lt;/p&gt;
&lt;p&gt;http://www.wirral-libraries.net/&lt;br /&gt;
http://www.stembystem.co.uk/&lt;/p&gt;
</description>
 <pubDate>Wed, 16 Apr 2008 15:39:40 +0100</pubDate>
 <dc:creator>markhughes</dc:creator>
 <guid isPermaLink="false">comment 651 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>Thats&#039;s great Brian.  We</title>
 <link>http://www.talis.com/tdn/node/1126#comment-646</link>
 <description>&lt;p&gt;Thats&#039;s great Brian.  We have just ordered the new BusinessObjectsXI, so I may go down that route.  I&#039;ll probably be in touch for advice when things are up and running.&lt;/p&gt;
&lt;p&gt;Cheers&lt;br /&gt;
Mark&lt;/p&gt;
&lt;p&gt;http://www.wirral-libraries.net/&lt;br /&gt;
http://www.stembystem.co.uk/&lt;/p&gt;
</description>
 <pubDate>Thu, 10 Apr 2008 11:17:13 +0100</pubDate>
 <dc:creator>markhughes</dc:creator>
 <guid isPermaLink="false">comment 646 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>prism reservation popularity</title>
 <link>http://www.talis.com/tdn/node/1126#comment-645</link>
 <description>&lt;p&gt;If you were going to go down the route of a new table to hold the top 50 which is then accessed via the prepared searches then I would be inclined to do the whole process all in one go rather than having to manipulate text files.&lt;/p&gt;
&lt;p&gt;The example below assumes that a table has been created in prod_talis called SS_reservations with the right shape e.g. attributes WORK_ID, FIGURES of the right datatype.&lt;/p&gt;
&lt;p&gt;SET ROWCOUNT 50&lt;br /&gt;
SELECT RL.TARGET_ID &quot;WORK_ID&quot;, COUNT(RL.RESERVATION_ID) &quot;FIGURES&quot;&lt;br /&gt;
into SS_reservations&lt;br /&gt;
FROM RESERVED_LINK RL, RESERVATION R&lt;br /&gt;
WHERE RL.TYPE = 1&lt;br /&gt;
AND RL.RESERVATION_ID = R.RESERVATION_ID&lt;br /&gt;
AND R.CREATE_DATE &amp;gt;= DATEADD(DAY, -90, GETDATE())&lt;br /&gt;
GROUP BY RL.TARGET_ID&lt;br /&gt;
ORDER BY COUNT(RL.RESERVATION_ID) DESC&lt;/p&gt;
&lt;p&gt;This could be set up in the cron to run from a script and then the prepared search could be pointed at the SS_reservations table.&lt;/p&gt;
&lt;p&gt;I&#039;m not sure of all the implications so I would advise any testing on the MIS server first. &lt;/p&gt;
&lt;p&gt;Also there is the usual caveat that any changes to the prod_talis database on the live server should be done with great care in case of damaging the database for Alto and that you would be responsible.&lt;/p&gt;
&lt;p&gt;Another option, depending on how you wanted to view the data might be to use Desktop Intellligence to generate the report.  This report can be saved in html format that could be saved to a location on a web server and then accessed from a URL. &lt;/p&gt;
&lt;p&gt;In the latest version (XI) the document can be scheduled to run and write the output in html format to a disk location automatically.&lt;/p&gt;
&lt;p&gt;There are some limitations particularly in terms of the look but it might be useful.  I can go into more details if required. &lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Brian Crampton&lt;br /&gt;
Developer, Talis&lt;/p&gt;
</description>
 <pubDate>Wed,  9 Apr 2008 16:10:24 +0100</pubDate>
 <dc:creator>Brian Crampton</dc:creator>
 <guid isPermaLink="false">comment 645 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>Rowcount in prepared search</title>
 <link>http://www.talis.com/tdn/node/1126#comment-644</link>
 <description>&lt;p&gt;Brian,&lt;/p&gt;
&lt;p&gt;If I wanted to do something like &#039;the top 50 whatever&#039;, as there is no rowcount facility in prism, would the following be possible???&lt;/p&gt;
&lt;p&gt;Say I did a Prepared search, say as an example for reservations....listing ALL reservations.  This would create a table like SS_reservations in the database.  &lt;/p&gt;
&lt;p&gt;Would it then be possible to then write an external script (like the one you did above) that would produce the data in a text file.&lt;/p&gt;
&lt;p&gt;Then could I take this textfile data, extract the &#039;top 50 rows, clear the existing data from the SS_reservations table and then pop the new data in there - Via a cron job?  So there would be no &#039;manual&#039; inputting of data into a secondary script...&lt;/p&gt;
&lt;p&gt;Would this be possible?&lt;/p&gt;
&lt;p&gt;Cheers&lt;br /&gt;
Mark&lt;/p&gt;
&lt;p&gt;http://www.wirral-libraries.net/&lt;br /&gt;
http://www.stembystem.co.uk/&lt;/p&gt;
</description>
 <pubDate>Fri,  4 Apr 2008 15:10:44 +0100</pubDate>
 <dc:creator>markhughes</dc:creator>
 <guid isPermaLink="false">comment 644 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>Prism Prepared Searches</title>
 <link>http://www.talis.com/tdn/node/1126#comment-595</link>
 <description>&lt;p&gt;Hi Brian,&lt;br /&gt;
Its the bit about running the script outside of prism,  then manually entering the results in another script.&lt;br /&gt;
I recognise the words but at this point of my Talis experience the meaning escapes me.&lt;br /&gt;
I really think I will pass on this one,  thanks anyway. &lt;/p&gt;
&lt;p&gt;Russell&lt;/p&gt;
</description>
 <pubDate>Thu, 27 Sep 2007 16:09:37 +0100</pubDate>
 <dc:creator>Russell Hall</dc:creator>
 <guid isPermaLink="false">comment 595 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>Prism Prepared searches</title>
 <link>http://www.talis.com/tdn/node/1126#comment-594</link>
 <description>&lt;p&gt;With which bit of the process was there a problem?&lt;/p&gt;
&lt;p&gt;By the way the following version of the SQL in the article is better formed. It does not use a subquery.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;SET ROWCOUNT 20&lt;br /&gt;
SELECT RL.TARGET_ID, COUNT(RL.RESERVATION_ID)&lt;br /&gt;
FROM RESERVED_LINK RL, RESERVATION R&lt;br /&gt;
WHERE RL.TYPE = 1&lt;br /&gt;
AND RL.RESERVATION_ID = R.RESERVATION_ID&lt;br /&gt;
AND R.CREATE_DATE &gt;= DATEADD(DAY, -90, GETDATE())&lt;br /&gt;
GROUP BY RL.TARGET_ID&lt;br /&gt;
ORDER BY COUNT(RL.RESERVATION_ID) DESC &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Brian Crampton&lt;br /&gt;
Developer, Talis&lt;/p&gt;
</description>
 <pubDate>Wed, 26 Sep 2007 12:10:02 +0100</pubDate>
 <dc:creator>Brian Crampton</dc:creator>
 <guid isPermaLink="false">comment 594 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>Prism Prepared searches</title>
 <link>http://www.talis.com/tdn/node/1126#comment-593</link>
 <description>&lt;p&gt;Thanks Brian,&lt;/p&gt;
&lt;p&gt;I have that document.  Sadly your simple work-around isn&#039;t simple enough. If at first you don&#039;t succeed, give up. Russell&lt;/p&gt;
</description>
 <pubDate>Wed, 26 Sep 2007 11:37:24 +0100</pubDate>
 <dc:creator>Russell Hall</dc:creator>
 <guid isPermaLink="false">comment 593 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>Prism Prepared searches</title>
 <link>http://www.talis.com/tdn/node/1126#comment-592</link>
 <description>&lt;p&gt;There is an article on prepared searches on the TDN at &lt;a href=&quot;http://www.talis.com/tdn/talis_prism_articles&quot;&gt;http://www.talis.com/tdn/talis_prism_articles&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This discusses a workaround for not being able to use the set rowcount command directly in the prepared search SQL statement.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;Brian Crampton&lt;br /&gt;
Developer, Talis&lt;/p&gt;
</description>
 <pubDate>Wed, 26 Sep 2007 08:57:42 +0100</pubDate>
 <dc:creator>Brian Crampton</dc:creator>
 <guid isPermaLink="false">comment 592 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>Reservation Popularity</title>
 <link>http://www.talis.com/tdn/node/1126#comment-591</link>
 <description>&lt;p&gt;Hello everyone&lt;/p&gt;
&lt;p&gt;We have just got around to adding some prepared searches on our prism catalogue.  I&#039;m interested in adding the top 20 reservations (as above) but have found elsewhere on the forums a similar SQL with a note mentioning that the &quot;setrowcount 20&quot; command is not recognised in prepared searches. I can&#039;t find the reference now.  Is this right, or will this SQL produce a list of the 20 most requested items in Prism????  any help will be most appreciated.  Regards, Russell&lt;/p&gt;
</description>
 <pubDate>Tue, 25 Sep 2007 16:18:36 +0100</pubDate>
 <dc:creator>Russell Hall</dc:creator>
 <guid isPermaLink="false">comment 591 at http://www.talis.com/tdn</guid>
</item>
<item>
 <title>reservation popularity</title>
 <link>http://www.talis.com/tdn/node/1126</link>
 <description>&lt;p&gt;&lt;a href=&quot;http://www.talis.com/tdn/node/1126&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.talis.com/tdn/node/1126#comments</comments>
 <category domain="http://www.talis.com/tdn/taxonomy/term/54">Miscellaneous</category>
 <pubDate>Fri, 16 Dec 2005 16:26:29 +0000</pubDate>
 <dc:creator>Tim Hodson</dc:creator>
 <guid isPermaLink="false">1126 at http://www.talis.com/tdn</guid>
</item>
</channel>
</rss>
