[freetds] unixODBC via FreeTDS, PHP and Stored Procedure Help
Joseph Geiser
joe at mail.paravisions.com
Thu Jul 1 16:46:06 EDT 2004
> We now have a db-lib test facility: bsqldb, first included in
> 0.62.3. (If you want a man page, though, get a nightly
> snapshot.) The attached script works with bsqldb; I'd be
> curious to know if isql can process it, too. But: all it's
> doing is T-SQL. If you use the -v option, bsqldb will show
> you that no parameters are returned as such to the client.
Just an FYI... here are the results of this test (some data modified for
obvious reasons)
[joe at server www]# bsqldb -S server -U sa -P pass -D dbname -i odbctest-bsql
-o odbctest-bsql-out -v
bsqldb:157: Verbose operation enabled
bsqldb:207: Query:
declare @cid cursor, at rcid int, at rpid int, at rtid varchar(20)
exec mt_testhash @hashin='1h88f9', at hashdata=@cid output
fetch next from @cid into @rcid, at rpid, at rtid
while @@fetch_status=0
begin
print cast(@rcid as varchar(10)) + ' - ' + cast(@rpid as
varchar(10)) + ' - ' + @rtid
fetch next from @cid into @rcid, at rpid, at rtid
end
close @cid
deallocate @cid
bsqldb:180: dbsqlsend() OK:
bsqldb:188: dbsqlok() OK:
bsqldb:261: calling dbresults OK:
Result set 1
Freeing prior allocations
Allocating buffers
Allocating compute buffers
Metadata
col name source type
size varys
------ ------------------------------ ------------------------------
--------------- ------ ------
Data
Retrieving return status... Procedure returned 0
1 rows affected
Retrieving output parameters... none
bsqldb:583: dbresults() returned NO_MORE_RESULTS (2):
Is this what should be expected? Just wondering... To answer the other
question - isql won't handle the above -- even with \n inserted between
commands and sending it as a single string.
Cheers,
Joe
More information about the FreeTDS
mailing list