Skip to Content.
Sympa Menu

freetds - Re: [freetds] truncated data from query

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "robert lazarski" <robertlazarski AT gmail.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] truncated data from query
  • Date: Wed, 4 Oct 2006 11:55:55 -0300

Thanks for the reply Ken. I already had tds as 8.0 . I am not using
PHP, but just the isql shell interface. So at this point I'm not sure
if the problem is freetds, isql or mssql . I didn't see anything in
the php code that sets the max width. All lines are truncated at
exactly 304 char's , which baffles me.

Any ideas ?
Robert

On 10/4/06, Ken Tozier <kentozier AT comcast.net> wrote:
Hi

I ran through a similar problem a few months back (on a Mac) It turns
out that you need to define one of the MSSQL records in "/usr/local/
etc/freetds.conf" (may be in a different location for Linux) to use
TDS 8.x

For example:

# A typical Microsoft SQL Server 2000 configuration
[YourNameForTheServerHere]
host = ntmachine.domain.com
port = 1433
tds version = 8.0

And use it in your connections like this (from PHP)

// Connect to the database
$db_connection = mssql_connect('YourNameForTheServerHere',
'user','password')
or die('Could not connect to database'));

// Depending on how permissions on the MSSQL database were set up,
// you may or may not have to explicitly select it
mssql_select_db('some_db_name')
or die('Could not select some_db_name database');

// And in the next line it is VERY important that you include
// "$db_connection" in the query otherwise it won't work with MSSQL
// This is different from MySQL where "$db_connection" is optional.
$query_result = mssql_query($query, $db_connection)
or die('Query failed: '.$query);

HTH

Ken


On Oct 3, 2006, at 10:54 PM, robert lazarski wrote:

> Hi all,
>
> I'm running freetds-0.65.dev.20060930 with unixODBC 2.2.11 with mssql
> 9 on linux. I have no idea what the cause of this is, but each
> generated line is truncating at exactly 303 char's . Here's an
> example:
>
> | INSERT [dbo].[MockAssetScenario]
> ([created],[probability],[modifiedUserFullName],[ticker],
> [createdUserID],[assetScenarioID],[notes],[priceTarget],
> [scenarioName],[modifiedUserID],[date],[version],[modified],
> [includeScenario],[assetID],[createdUserFullName])VALUES(NULL,
> 50,'','JPM',NULL,96,'Increased
> F|
>
> Note how it stops at 'Increased F|'
>
> I'm very close to achieving my goal, just have this last hurdle.
> Please help.
>
> Robert
> _______________________________________________
> FreeTDS mailing list
> FreeTDS AT lists.ibiblio.org
> http://lists.ibiblio.org/mailman/listinfo/freetds

_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds





Archive powered by MHonArc 2.6.24.

Top of Page