
Sybase::TdsSocket - A module containing tds lowlevel functions

my $tdssocket = Sybase::TdsSocket->new($socket); $tdssocket->set_packetsize(512); $tdssocket->packet_type(TDS_BUF_RESPONSE); my ($length, $header, $data) = $tdssocket->read_packet(); $tdssocket->write($data);




Parameters:
Example:
$tdssocket = Sybase::TdsSocket->new('myserver');
Sets the packet type for the next outgoing packets.
Parameters:
The type, should be one of the following: TDS_BUF_RESPONSE
Example:
my $res = $tdssocket->packet_type(TDS_BUF_RESPONSE);
Parameters:
An IO::Socket object from which the data will be read.
Returnvalues:
The length of the packet in bytes.
The 8 byte tds header
The data.
Example:
my ($len, $header, $data) = $tdssocket->read_packet;
Accumulates data in a buffer and sends a tds packet if necessary.
Parameters:
The packet Data
Returnvalues:
True for success, false for failure.
Example:
my $res = $tdssocket->write($data);
Sends all data in buffer and truncates it.
Parameters:
None.
Example:
my $res = $tdssocket->flush;
Sends a done token to the client
Parameters:
Status is a bitmap with the following meaning:
0x0000 done final Result complete, successful 0x0001 done more Result complete, more results to follow 0x0002 done error Error occured in current command 0x0004 done inxact Transaction in progress for command 0x0008 done proc Result comes from a stored procedure 0x0010 done count 0x0020 done attn to acknowlegde an attention 0x0040 done event part of event notification
Status of the current transaction is one of the following:
0 not in tran 1 tran succeed 2 tran in progress 3 statement abort 4 tran abort
Returnvalues:
Example:
$tdssocket->send_done($status);
Sends a eed token to the client
Parameters:
Message number.
Class or severity.
Status of the current transaction is one of the following:
0 not in tran 1 tran succeed 2 tran in progress 3 statement abort 4 tran abort
Text of the message.
Servername
Name of the procedure (optional)
Line of the procedure (optional)
Returnvalues:
Example:
$tdssocket->send_eed(12345, 10, 0, 'This is a warning');
Gets ip and port from interfaces file
Parameters:
Servername
Returnvalues:
IP and Portnumber
undef and errortext on failure.
Example:
my ($ip, $port) = $tdssocket->server_info('myserver');