Horizon* Specific Information for JTCheckItOut



The first time you press Check Out or Check In during a session it will take some time to initialize the databases.  I had to choose between fast processing during circulation or a fast startup.  I chose the former.  Depending on the size of your patron and item files and the capability of your workstation, this could take 2 to 3 minutes.  (In my testing it took 2 1/2 minutes for 3000 Patrons and 200,000 Items on a P3, 1 Gighz station and 1 1/2 minutes on a P4, 1.5 Gighz station.)  This may take longer if you have extremely large patron and item files. 

Feel free to offer feedback or suggestions on this utility.

Below are some SQL Scripts that can be used to pull patron, item and block information if you wish to validate this information during the circulation process.  You will need to update the database name in the "use" statement.  Note: I do recommend the ODBC method over the direct SQL method due to field size limitation.  Either method will work fine but some of the information will be truncated using the direct SQL method.  If you choose to provide the information in some other fashion please read the help file closely.  There are specific needs in regard to the data files.

Case is important for the database parameters on the setup screen. The ones that you will want to use are -S server, -D database, -U user, -P password, -i input (source) file, -o output file, -w width (under additional parameters). Only the -i and -o are required in their respective boxes. The input and output file names are hard-coded.

ODBC Patron Script

select bbarcode, name
from borrower, borrower_barcode
where borrower.borrower# = borrower_barcode.borrower# 
order by bbarcode

ODBC Item Script

select ibarcode, title
from item_with_borrower
order by ibarcode

ODBC Block Script

select bbarcode, ibarcode, convert(char(10),dateadd(dd,date,"Jan 1, 1970"),101),
burb.block, descr, 1, amount, item_cko_location, comment, title
from burb, item_with_borrower, block, borrower_barcode
where ord = 0
and burb.item# *= item_with_borrower.item#
and burb.block *= block.block 
and de_block_delete_date = NULL
and burb.borrower# = borrower_barcode.borrower#

Direct SQL Patron Script

use your_database_name 
set nocount on
go

declare bcurs cursor for
select bbarcode +"|"+name
from borrower, borrower_barcode
where bbarcode <= "2000007099" and 
borrower.borrower# = borrower_barcode.borrower# 
order by bbarcode
go
declare @bdata varchar(90)
print "p_barcode|name"
open bcurs
fetch bcurs into @bdata
while @@sqlstatus = 0 
begin
print @bdata
fetch bcurs into @bdata
end
close bcurs
go

Direct SQL Item Script

use your_database_name 
set nocount on
go

declare bcurs cursor for
select ibarcode +"|"+title
from item_with_borrower
order by ibarcode
go
declare @bdata varchar(150)
print "i_barcode|description"
open bcurs
fetch bcurs into @bdata
while @@sqlstatus = 0 
begin
print @bdata
fetch bcurs into @bdata
end
close bcurs
go

Direct SQL Block Script

use your_database_name 
set nocount on
go

declare bcurs cursor for
select bbarcode+"|"+
ibarcode+"|"+
convert(char(10),dateadd(dd,date,"Jan 1, 1970"),101)+"|"+
burb.block+"|"+
substring(descr,1,35)+"|"+
"1|" ,
convert(varchar(5),amount),
substring(comment,1,65)+ "|"+
item_cko_location+"|"+
substring(title,1,75)

from burb, item_with_borrower, block, borrower_barcode
where ord = 0
and burb.item# *= item_with_borrower.item#
and burb.block *= block.block 
and de_block_delete_date = NULL
and burb.borrower# = borrower_barcode.borrower#
go

declare @bdata varchar(75), @bdata1 varchar(15), @bdata2 varchar(155), @cl smallint
print "bbbarcode|bibarcode|bdate|block|block_descr|block_status|amount|cko_location|comment|title"
open bcurs
fetch bcurs into @bdata, @bdata1, @bdata2
while @@sqlstatus = 0 
begin

select @cl = char_length(@bdata1)

If @cl = 0 select @bdata1 = ".00"
If @cl = 1 select @bdata1 = ".0"+@bdata1
If @cl = 2 select @bdata1 = "."+@bdata1
If @cl > 2 select @bdata1 = substring(@bdata1,1,@cl-2)+"."+substring(@bdata1,@cl-1,2)

print "%1!%2!|%3!",@bdata, @bdata1, @bdata2
fetch bcurs into @bdata, @bdata1, @bdata2
end
close bcurs
go

* Horizon/Sunrise is a registered trademark of Dynix.