NAME
DBIO::MSSQL::Storage::Sybase - Support for Microsoft SQL Server via DBD::Sybase
VERSION
version 0.900007
DESCRIPTION
Storage driver for Microsoft SQL Server accessed via DBD::Sybase (including FreeTDS-based connections). Inherits from both DBIO::Sybase::Storage and DBIO::MSSQL::Storage.
A schema that declares the driver -- the DBIO::MSSQL component or the -ms shortcut -- has its storage pinned to DBIO::MSSQL::Storage, which moves into this class at its first use when the DSN is a dbi:Sybase: one ("_adapt_to_access_path" in DBIO::MSSQL::Storage). The server is not asked what it is.
A schema without a declared driver is refused at connect (core ADR 0067): the DSN alone does not name this driver -- DBIO->driver_for answers Sybase for a dbi:Sybase: DSN.
The driver then checks whether your DBD::Sybase build supports placeholders. If not, the storage is reblessed to DBIO::MSSQL::Storage::Sybase::NoBindVars. FreeTDS versions above 0.82 have known statement-caching bugs; the driver detects these and disables statement caching automatically. The key of a new row is read with SCOPE_IDENTITY() as in DBIO::MSSQL::Storage, also over such a FreeTDS: the @@identity workaround this class had for it returned, with a trigger that inserts into another table with an identity column, that other table's key (1000 for the row 1), and SCOPE_IDENTITY() works with FreeTDS 1.3.17 (the only version measured, no version limit is assumed). The NoBindVars class reads the key the same way, with an INSERT trigger on the table included (t/84-nobindvars-live.t).
A storage pinned to this class itself, through "storage_type" in DBIO::Schema, gets the placeholder check too, with storage layers registered on the schema as well: the storage is then an instance of a synthesised class that derives from this one, and the check looks through it to its base. The layers stay over whichever class the storage becomes.
METHODS
connect_call_datetime_setup
Used as:
on_connect_call => 'datetime_setup'
In connect_info to set:
$dbh->syb_date_fmt('ISO_strict'); # output fmt: 2004-08-21T14:36:48.080Z
On connection for use with DBIO::InflateColumn::DateTime
This works for both DATETIME and SMALLDATETIME columns, although SMALLDATETIME columns only have minute precision.
VALUES OF MORE THAN 4000 BYTES
When FreeTDS prepares a statement for SQL Server it declares every placeholder as varchar(4000), whatever is bound to it afterwards, and the server cuts a longer value to that size without an error -- into any column, VARCHAR(MAX) included, and in a condition as well, where the cut value then matches another row or none. No bind type, no CAST around the placeholder and no client setting changes the declaration (measured with DBD::Sybase 1.27 and FreeTDS 1.3.17 against SQL Server 2022).
This class therefore does not bind such a value. A value of more than 4000 bytes goes into the statement as a literal, where it arrives whole; every other value of the same statement stays a bind.
The line is drawn in bytes, as DBD::Sybase sends them: the bytes Perl holds the string in. A character string of 1334 euro signs is 4002 bytes and goes into the statement.
A value of ASCII alone is a plain literal, the
varcharthe placeholder was. Anything else is a Unicode literal,N'...', so that no character depends on the code page of the database: anNVARCHARcolumn gets every character. Where the server has to convert the value to a code page -- aVARCHARcolumn -- a character that code page lacks is stored as?, without an error; that is the server's conversion, and a bind does not do better (the client library refuses the value, after a row of blanks has been written). In an expression where the type matters --HASHBYTES,DATALENGTH, a conversion toVARBINARY-- a long value beyond ASCII isnvarcharwhere a short one isvarchar.The value arrives as it was given. Quotes are doubled, and the two things the server reads in a literal and not in a bound value are written around: a backslash before a line break (the server drops both) and a NUL (the end of the statement text for it).
The trace is unchanged. It shows the statement with its placeholder and hands the value to redact_bind_value, as for any bind. The statement that carries the value is never put into the statement cache.
populate in void context executes one prepared statement once per row and cannot carry a long value for some rows. A data set with such a value is inserted row by row, in one transaction.
A statement whose placeholders cannot be told apart throws. A
?inside a literal or a name of hand-written SQL, in a statement that also has a long bind value, leaves it open which?the value belongs to. Nothing is sent.
Not covered:
a statement run on the handle directly (
$storage->dbh_do,on_connect_dowith bind values): DBD::Sybase binds there, and the server cuts. The caller has the handle in hand and binds, or writes the literal, as it sees fit. The same holds there for a string beyond ASCII and for an empty string ("STRINGS BEYOND ASCII", "EMPTY STRINGS");a storage of another class on a DBD::Sybase handle -- a private subclass of DBIO::MSSQL::Storage pinned by hand -- does not get here: it is refused ("_adapt_to_access_path" in DBIO::MSSQL::Storage). Derive from this class.
A value for a binary column is not text and does not go this way at any length: see "BINARY VALUES".
DBIO::MSSQL::Storage::Sybase::NoBindVars has no placeholders and is not affected; DBD::ODBC binds long values whole.
STRINGS BEYOND ASCII
A string with a character beyond ASCII does not arrive when it is bound over this transport, at any length (measured with DBD::Sybase 1.27 and FreeTDS 1.3.17 against SQL Server 2022). FreeTDS sends it as a CHAR of fixed length -- its length in bytes of the client's character set -- after converting it to the code page of the server, and the server pads it with blanks: an a-umlaut arrives as itself and a blank, the euro sign with two. A character the code page lacks is refused by the client library after the row has been written, and the row holds blanks. No bind type, no CAST around the placeholder and no setting of DBD::Sybase changes that; a statement that rewrote the placeholder would make the value an nvarchar, which changes what a condition compares and whether an index is used, and this class does not decide that for a caller.
So this class refuses such a value, before anything is sent:
Beyond ASCII is a question of characters: a character string with a character above
U+007Fis, and so is a byte string with a byte above0x7F. An object is looked at as its string form.The message names the position of the value among the bind values of the statement and, when known, the column; it names the cause and the way out, DBD::ODBC with DBIO::MSSQL::Storage::ODBC: there the value arrives whole in an
NCHAR,NVARCHARorNTEXTcolumn, with the client character set of the ODBC driver at UTF-8, and in aVARCHARcolumn as far as the code page has the characters ("STRINGS BEYOND THE CODE PAGE" in DBIO::MSSQL::Storage::ODBC). It never carries the value, a password or the DSN.It holds for
INSERT,UPDATE,DELETEand conditions (=,LIKE,IN), for literal SQL with bind values, for anEXEC, and forpopulatein void context, which refuses before the first row is sent.Not refused:
NULL; a value for a binary column ("BINARY VALUES"), which is bytes and bound as its hex form; a value of more than 4000 bytes, which is a literal and arrives whole ("VALUES OF MORE THAN 4000 BYTES"); everything of ASCII alone.Not looked at: DBIO::MSSQL::Storage::Sybase::NoBindVars and a statement run on the handle directly. The first has no binds -- core puts every value into the statement as a plain literal, and a character the code page lacks becomes
?there; that is core's, not rewritten here.
EMPTY STRINGS
DBD::Sybase binds an empty string as one blank (its dbdimp.c has a space for "", an inheritance from ASE, which has no empty string), and the server gets the same byte for '' and for ' '. Bound, an empty string was stored as a blank in VARCHAR, NVARCHAR and TEXT, LIKE '' found the row of the blank, and REPLACE(?, ...) and DATALENGTH(?) saw it (measured as for the section before). syb_bind_empty_string_as_null makes NULL of it, not an empty string.
This class therefore does not bind an empty string. It writes the literal '' into the statement where the placeholder stood -- the seam that carries a long value ("VALUES OF MORE THAN 4000 BYTES"), and the same rules:
Nothing of a value is in the statement otherwise, an empty string being nothing. The trace shows the statement with its placeholder and the value, as for any bind.
NULLisNULL, and a value of one blank is one blank, still a bind.An
EXECwith an empty string throws: DBD::Sybase sends it as a remote procedure call, without what stands around a placeholder, and the procedure would be handed a blank. Write''into the statement yourself, or use DBD::ODBC.A statement whose placeholders cannot be told apart throws, as for a long value.
populate in void context inserts row by row, in one transaction, when a row has an empty string.
Other column types are what they were and what they are over DBD::ODBC:
''is 0 in anINT,1900-01-01in aDATETIME, blanks in aCHAR(n), and a conversion error in aDECIMAL(Msg 8114).
BINARY VALUES
A bound value is varchar to the server, and the server refuses to make VARBINARY of that (Msg 257) -- for a value of any length, NULL included. DBD::Sybase honours a bind type for an EXEC only. So a value for a binary column is bound as something that is text and arrives unchanged, its hex form, to a placeholder the statement turns back into the bytes:
CONVERT(VARBINARY(MAX), ?, 1) -- bound: 0x4A5B...
Nothing of the value is in the statement. (Measured with DBD::Sybase 1.27 and FreeTDS 1.3.17 against SQL Server 2022, from an empty value to 4 MB, into VARBINARY(MAX), VARBINARY(n), BINARY(n) and IMAGE, in INSERT, UPDATE and conditions.)
Which bind value is a binary one is what its data type says:
binary,varbinary,image, and the names DBIO::MSSQL::DDL makes one of them (blob,bytea, ...) -- the type of the column of the result source, in a condition as in anINSERTor anUPDATE, or the type given with a bind value in literal SQL (\[ '?', [ { sqlt_datatype => 'varbinary' } => $value ] ]). Not what the value looks like: a value of plain ASCII in a binary column is bytes too. A value bound without a type is text.The value is the bytes of the string, one per character, whatever form Perl holds the string in. A character above 255 is no byte: such a value throws before anything is sent, naming the column and the position, not the value.
A value of more than 1999 bytes is bound in pieces, one placeholder each, which the statement joins -- a placeholder is
varchar(4000)to the server ("VALUES OF MORE THAN 4000 BYTES"), and that is0xand the hex digits of 1999 bytes. A condition on a binary column is rewritten the same way; an index on the column is still used for a seek.One statement takes 2099 placeholders, the pieces and every other bind value together: about 4 MB of binary values. A statement that would have more throws before anything is sent, with the sizes.
An empty value is empty, zero bytes -- not the blank DBD::Sybase makes of an empty string -- and
NULLisNULL.An
EXECwith such a value throws. DBD::Sybase sends a statement that begins withEXECas a remote procedure call, without what stands around a placeholder: the procedure would be handed the hex string.A statement whose placeholders cannot be told apart throws, as for a long value: a
?inside a literal or a name of hand-written SQL, beside a binary value.The trace is unchanged: the statement with its plain placeholder, the value through redact_bind_value.
populate in void context inserts row by row, in one transaction, when the data set has a value for a binary column: how many placeholders a row takes depends on the size of its value.
Not covered:
a statement run on the handle directly (
$storage->dbh_do): bind the hex form and write theCONVERTyourself;DBIO::MSSQL::Storage::Sybase::NoBindVars, which has no placeholders: core puts every value into the statement as a text literal, and a binary value does not arrive that way (Msg 257, or the client library refuses to convert its bytes);
a private subclass of DBIO::MSSQL::Storage pinned by hand on a DBD::Sybase handle is refused, not left to bind a binary value as text ("_adapt_to_access_path" in DBIO::MSSQL::Storage). Derive from this class.
DBD::ODBC carries a binary value as a bind of its own type: "BINARY VALUES" in DBIO::MSSQL::Storage::ODBC.
READING BINARY VALUES
DBD::Sybase hands back the value of a BINARY(n) or a VARBINARY(n) column as its hex digits, and that of an IMAGE column too unless syb_binary_images is on. For a VARBINARY(MAX) column it has a buffer of one byte: the fetch of a row with a value in such a column fails, and DBD::Sybase drops a row whose fetch fails without an error. A result set with such a column has the rows whose value is NULL or empty and no other -- find on a table with such a column finds nothing. (Measured with DBD::Sybase 1.27 and FreeTDS 1.3.17 against SQL Server 2022. The client library describes the column as 2147483647 bytes long, and the room for its hex digits, twice that and two, comes out as nothing in 32 bits.)
The one form in which DBD::Sybase carries a binary value as the bytes it is, is an IMAGE column read with syb_binary_images on. This class therefore asks for a binary column as that:
SELECT [me].[id], CAST([me].[body] AS IMAGE) FROM [doc] [me] ...
and what comes back is the bytes, for VARBINARY(MAX), VARBINARY(n), BINARY(n) and IMAGE alike. A caller that turned the hex digits back into bytes itself now gets bytes.
Which entry of a select list is a binary column is what its data type says, as for a bind value ("BINARY VALUES"): the
data_typeof the column in its result source. Not what comes back. A column whosedata_typeis not declared is not rewritten.Only an entry that is the column itself is rewritten -- in
find,single,next,all, a cursor,get_column, with an alias, through a join or a prefetch, underrowsandoffset,distinctandgroup_by, forretrieve_on_insert. A function over the column (get_column('body')->max), an expression and literal SQL are not.A subquery is not rewritten (
as_query, and with itcount, a condition-in => $rs->as_query, a set operation, the subquery of adeleteor anupdateover a join): anIMAGEcannot be compared. The outer statement is.syb_binary_imagesis on for the execute of a rewritten statement alone, and the handle is as it was afterwards, after a failed execute too. What hand-written SQL reads from anIMAGEcolumn is what it was.A value arrives whole up to the
TEXTSIZEof the session, which DBIO::Sybase::Storage::FreeTDS sets toLongReadLenof the connect info -- 32768 bytes unless that says otherwise. A longer value is refused, not cut: the column is read behind the TEXTSIZE guard ("VALUES LONGER THAN TEXTSIZE"). Connect withLongReadLen => $bytesfor larger values; measured up to 4195901 bytes.An empty value costs
TEXTSIZEbytes of memory while its statement handle lives: the client library fills the whole buffer of an emptyIMAGEvalue (measured: 48 MB with aTEXTSIZEof 50000000). With the default that is 32 kB per binary column of a result (the column types that do not pay it: "VALUES LONGER THAN TEXTSIZE").A
DISTINCTwritten in literal SQL beside a binary column is refused by the server (Msg 421): the column is anIMAGEthen, and anIMAGEcannot be compared.distinct => 1is aGROUP BYover the column as it is, and works.
A VARBINARY(MAX) result column that was not rewritten throws. After the execute, before a row is fetched, the storage looks at how the handle describes the result; a column that is VARBINARY(MAX) there would lose its rows, and the statement is refused with an exception that says so. That is decided by the column and not by the rows: a result whose values are all NULL throws as well. It is what happens to
a function or an expression over such a column (
{ max => 'body' },CAST(... AS VARBINARY(MAX))), and the column in literal SQL (\'me.body');a column whose
data_typeis not declared as a binary one.
Select the hex digits instead, CONVERT(VARCHAR(MAX), <expression>, 2): they arrive up to TEXTSIZE characters, half as many bytes, and are cut beyond that without an error. CAST(<expression> AS VARBINARY(8000)) arrives as hex digits too, cut to 8000 bytes by the server.
Not covered:
a
BINARY(n),VARBINARY(n)orIMAGEvalue that is not the column itself -- a function (get_column('sized')->max,HASHBYTES), an expression, literal SQL, a column without a declareddata_type: it comes back as its hex digits, as before. AnIMAGEvalue of more than half ofTEXTSIZEbytes read that way loses its row, without an error. That is not refused: the same result with a shorter value reads right, and a refusal would hit it (measured by t/77-long-values-live.t: 16384 bytes read at aTEXTSIZEof 32768, 16385 bytes: no row);a statement run on the handle directly (
$storage->dbh_do): hex digits, and no rows forVARBINARY(MAX), as before. Nothing is refused there (maint/upstream/dbd-sybase-row-fail.md);a private subclass of DBIO::MSSQL::Storage pinned by hand on a DBD::Sybase handle is refused ("_adapt_to_access_path" in DBIO::MSSQL::Storage). Derive from this class.
DBIO::MSSQL::Storage::Sybase::NoBindVars reads as this class does. DBD::ODBC reads a binary value as its bytes, up to LongReadLen, and throws beyond.
VALUES LONGER THAN TEXTSIZE
Measured 2026-10-17 with DBD::Sybase 1.27 and FreeTDS 1.3.17 against SQL Server 2022 (t/77-long-values-live.t).
DBIO::Sybase::Storage::FreeTDS sets SET TEXTSIZE at connect from LongReadLen of the connect info -- 32768 bytes unless that says otherwise. The server then cuts a longer value of a TEXT, NTEXT, IMAGE, VARCHAR(MAX), NVARCHAR(MAX) or VARBINARY(MAX) column on its way back, without an error, exactly at TEXTSIZE bytes: 32768 characters of a VARCHAR(MAX), 16384 of an NVARCHAR(MAX). A value of exactly TEXTSIZE bytes is whole. The sized VARCHAR(n), NVARCHAR(n) and VARBINARY(n) and the XML type are not subject to it (8000 bytes whole under a TEXTSIZE of 100; 50007 characters of XML under 32768).
The client cannot tell a value that was cut from one that is that long, the server can. So a column of a result source that is a (N)VARCHAR(MAX), an NTEXT or a binary type ("READING BINARY VALUES") on the server is asked for behind a check the server runs. What the column is on the server is what DBIO::MSSQL::DDL deploys the declared type as (DBIO::MSSQL::Adapter is the one table, _server_data_type): the declared text is an NVARCHAR(MAX) -- not a TEXT -- and so are a varchar or string of size -1; varchar(max), the server's own spelling, is a VARCHAR(MAX). A text column is therefore read as the NVARCHAR(MAX) it is, CJK and emoji included (it was read through CAST(.. AS VARCHAR(MAX)), which turned them into ?), and the check counts its bytes as the server holds them, two per character. The check:
CASE WHEN DATALENGTH([me].[body]) > @@TEXTSIZE
THEN <failing conversion carrying a message> ELSE [me].[body] END
and a value that does not fit fails the statement instead of arriving cut: exactly -- one of TEXTSIZE bytes is read, one byte more is refused. The exception names the column and the size and says to connect with a LongReadLen of at least the longest value. It is the same for find, single, first, all, a cursor, get_column, the hashref inflator, rows, a prefetch -- the check is in the statement, there is no fetch site that could miss it -- and when the long value is not the first row, the whole read fails.
The type of the column is kept. An
NTEXTis read as anNVARCHAR(MAX)(aCASEcannot return anNTEXT); aVARCHAR(MAX)and anNVARCHAR(MAX)are read as the type they are, the failing branch of theCASEbeing of that type -- aCASEbetween the two would return anNVARCHAR(MAX)and halve the characters that fit, silently (measured). The column itself is theELSEbranch, so aNULLstaysNULL: the check was a concatenation (col + CASE .. ELSE '' END) before, which turns aNULLinto''in a session withCONCAT_NULL_YIELDS_NULL OFF(it is ON on a fresh session overdbi:Sybase:, measured).The bytes are the server's.
TEXTSIZEcounts anNVARCHAR(MAX)in the two bytes per character the server holds it in: 16384 characters fit under the default, and 20000 are refused, not cut. They are read with aLongReadLenof 40000 or more. The only form that would carry more characters under 32768 bytes is aVARCHAR(MAX)in a UTF-8 collation (SQL Server 2019 and later), which is not used.Only an entry that is the column itself, as for binary columns: a function, an expression and literal SQL are not behind it, a subquery (
as_query,count) keeps the column as it is, and the handle ($storage->dbh_do) is not reached. Those cut a value overTEXTSIZEto it without an error, as before (pinned by the live test).The declared type counts, as for binary columns; a column whose
data_typedoes not say it is a LOB is not looked at, whatever the table holds. A realTEXTcolumn cannot be declared (the portabletextis anNVARCHAR(MAX)): declaredtextover a legacyTEXTcolumn it is read through the check as if it were anNVARCHAR(MAX).LongReadLen is the regulator, as it was: the default stays 32768. Raising it costs memory only where the client library fills a buffer for an EMPTY value (below), so the right value is the length of the longest value read, not the largest number.
The memory price of an empty value. For an empty TEXT, NTEXT or IMAGE value the client library fills the whole buffer: TEXTSIZE bytes for an IMAGE, twice that for an NTEXT, four times for a TEXT (measured with plain DBI and a TEXTSIZE of 50000000: 48, 95 and 191 MB; with an unlimited TEXTSIZE the OOM killer ended the read of a row with an empty TEXT). A value of one byte and NULL cost nothing, and neither does a VARCHAR(MAX), an NVARCHAR(MAX) or an XML value, empty or not. Behind the guard an NTEXT is read as NVARCHAR(MAX), so it no longer pays it; a legacy TEXT column, which cannot be declared as such, is not cast and pays (measured: 193 MB at a LongReadLen of 50000000). A binary column is an IMAGE and does: about LongReadLen bytes of memory per binary column of a result while its statement handle lives, if one value of the column is empty. No way around it was found: NULLIF would turn an empty value into NULL, and the hex digits of a VARBINARY(MAX) need decoding at every fetch site. With the default that is 32 kB per column; a LongReadLen of 50000000 costs 48 MB for each.
DBD::ODBC has neither the cut nor the price ("LONG VALUES" in DBIO::MSSQL::Storage::ODBC).
Recommendation for a default, not taken: 32768 is small for a document store and cheap for everything else. A higher default would cost the binary columns above; an unlimited one would make the read of a row with an empty binary value ask for 2 GB per column. Whoever reads values over 32 kB sets LongReadLen to what they are, and the guard says so when the setting is too small.
SQL_VARIANT AND OTHER TYPES
Measured 2026-10-17 on the handle (t/77-long-values-live.t).
SQL_VARIANT is described by the client library as a CHAR of 8009 (no CHAR, VARCHAR, NCHAR or NVARCHAR has that precision: it gives four times the length). What the column holds decides what happens: a value with a text, number or date base type reads; a value with a binary base type loses its row without an error when it is the first of the result, or comes back as the hex digits of the value, as text, when rows were fetched before it (two binary variants alone: both lost). What the column holds is not known before the rows are, so a SQL_VARIANT result column is refused after the execute, before a fetch, with an exception that says what to select instead: CONVERT(VARCHAR(8000), <expression>) for text, numbers and dates, CONVERT(VARCHAR(MAX), CONVERT(VARBINARY(8000), <expression>), 2) for the hex digits of a binary value, SQL_VARIANT_PROPERTY(<expression>, 'BaseType') for which one a value is. The refusal also hits a column that holds no binary variant at all: that is the price of not losing a row. DBD::ODBC reads the column.
Fetched with their rows, nothing to do: DECIMAL(38,10) and DECIMAL(38,0) (exact at 38 digits), NUMERIC, MONEY, DATETIME2(7), DATETIMEOFFSET, TIME(7), DATE, UNIQUEIDENTIFIER, BIT, ROWVERSION, XML (also 50007 characters, past TEXTSIZE), VARCHAR(8000), NVARCHAR(4000).
Refused by the client library, loud: the CLR types HIERARCHYID, GEOGRAPHY and GEOMETRY -- "ct_describe() failed"; the storage takes the execute that returned false for the error it is. A CLR type of an assembly of your own was not measured (no CLR on the test server).
Not refused, limits: an IMAGE read as hex digits (literal SQL, a function, a column without a declared data_type) loses its row above TEXTSIZE / 2 bytes, and a VARBINARY(MAX) read on the handle directly loses it from one byte on, both without an error; a refusal would hit results that read right (the same statement with a shorter value). Pinned by the live test; upstream draft: maint/upstream/dbd-sybase-row-fail.md.
SUPPORT MATRIX
DBD::ODBC is the supported access path (DBIO::MSSQL::Storage::ODBC). DBD::Sybase over FreeTDS works within the limits below: where the DBD corrupts data silently and the storage cannot repair it, the storage refuses loudly and names DBD::ODBC as the way out. Each row is pinned by a test (the cards are named in the row); a card that changes a row changes it here, in "SUPPORT MATRIX" in DBIO::MSSQL::Storage::ODBC and in CLAUDE.md.
Case DBD::ODBC (supported) DBD::Sybase / FreeTDS (restricted)
------------------------- ---------------------------- -------------------------------------
Bind of > 4000 bytes bound, whole literal in the statement, whole
Bind beyond ASCII, into exact: SQL_WLONGVARCHAR; the REFUSED, naming DBD::ODBC
a column that is NCHAR, ODBC client character set
NVARCHAR or NTEXT ON THE must be UTF-8, else the
SERVER: declared nchar, string is REFUSED. A
nvarchar, ntext -- and string already encoded as
text, varchar, string, UTF-8 bytes is encoded a
char, which DBIO deploys second time, silently (it
as national cannot be told from text)
Bind beyond ASCII, into what the code page has is REFUSED
a real VARCHAR/CHAR: exact; what it lacks is
declared varchar(n), refused by the driver
char(n), varchar(max) (loud)
Empty string '' exact literal ''; EXEC refused
Binary values, writing SQL_LONGVARBINARY hex pieces, 2099 placeholders per
statement; EXEC refused
Binary values, reading bytes, LongReadLen 1 GiB bytes through CAST AS IMAGE up to
unless set TEXTSIZE; a longer value REFUSED
TEXT, NTEXT, VARCHAR(MAX), whole by default; an whole up to TEXTSIZE =
NVARCHAR(MAX) read explicit small LongReadLen LongReadLen (32768); a longer value
throws beyond it, but a REFUSED, exactly. On the
value AT the boundary comes handle / in literal SQL: cut
back with a NUL for its last without an error (limit)
character (TODO, upstream)
Empty LOB value, memory none TEXT/NTEXT/MAX types: none; binary
columns: LongReadLen bytes each
SQL_VARIANT column read (a binary value as hex REFUSED: rows with a binary
digits, as text) base type are lost
IMAGE as hex digits above n/a row lost, no error (limit)
TEXTSIZE/2; VARBINARY(MAX)
on dbh_do
HIERARCHYID, GEOGRAPHY, refused by the driver refused (ct_describe failed), loud
GEOMETRY
Transaction with an open cursor before: commit and BEGIN TRAN and COMMIT throw,
cursor rollback right, core warns nothing is sent; ROLLBACK ends
that it abandoned the handle; the cursor and rolls back on
cursor inside: the next the same connection (dbio-sybase t/61)
statement is refused (t/78)
Binds on dbh_do / DBD binds as it is not covered; the caller has the
on_connect_do handle
Private subclass pinned core warns refused
by storage_type
$rs->explain refused: no plan over ODBC plan (18 columns) for a query without
(the query would run) placeholders; with them it dies
Key of a new row, with SCOPE_IDENTITY() SCOPE_IDENTITY(); @@identity
a trigger on the table was the trigger's key (1000 for 1)
populate (void) with a throws, nothing stays same: stops at the first failing
row the server refuses tuple
NoBindVars class, n/a (binds) row by row in one transaction
populate, void context
NoBindVars class, pinned n/a decision taken, layers kept
to ::Sybase with layers
NoBindVars class, '' exact (0) core's literal is unquoted: Msg 102,
for an INT column loud, no row (core's)
SEE ALSO
DBIO::MSSQL - MSSQL schema component
DBIO::MSSQL::Storage - MSSQL storage base class
DBIO::Sybase::Storage - Sybase storage base class
DBIO::Sybase::Storage::FreeTDS - FreeTDS connection layer
AUTHOR
DBIO & DBIx::Class Authors
COPYRIGHT AND LICENSE
Copyright (C) 2026 DBIO Authors Portions Copyright (C) 2005-2025 DBIx::Class Authors Based on DBIx::Class, heavily modified.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.