[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: truncated value when doing table insert



Is Service Pack 1 applied to SQL Server?

If so, then you need to update the Database ODBC drivers on the client
machine that is executing the SQR.  The outdated ODBC drivers have a problem
with buffer allocation when connecting to a server at Service Pack 1.

You can download MDAC (Microsoft Data Access Components) v2.6 SP 1 from
http://support.microsfot.com or http://technet.microsoft.com.

I had the exact same problem and updating the drivers resolved everything.

Tracy E. Barnes
Ciber Enterprise Solutions
Sr. Consultant

 -----Original Message-----
From:   Nenneman, Daniel [mailto:DNENNEMAN@PLATO.COM]
Sent:   Wednesday, April 03, 2002 2:50 PM
To:     SQR-USERS@list.iex.net
Subject:        truncated value when doing table insert

Hi,

I'm running into a strange problem.  I'm doing a straightforward read from a
flat file and then inserting into a database table.  When I look at the
results in the table however, approximately 4 of the 118 rows have truncated
values.  I.E. "Client Relations" becomes "Client Rel".

I'm using
 - SQR for PeopleSoft/8.16.02/PC/Windows NT 4.0/ODBC Level 2/Dec 11 2001
 - Windows 2000 and MS SQL Server

A simplified version of the code I'm using is ...

1) I create a table
  Create Table Temp_Name
  (
   Deptid    char(6) null,
   Name     char(30) null
  )

2) Read in the values from the flat file
    Read 10 Into $Record:80
    let $DEPTID     = substr($Record, 5, 6)
    let $DESCR      = substr($Record, 12, 30)
    show $Record
    show 'Inserting ' $DEPTID '*' $DESCR '*'

3) Do an Insert into the table
   insert into Temp_Name values ($DEPTID, $DESCR)

4) I get the following SHOW statement results in the log file

MRR     404010  Accounting-Murphy
Inserting 404010*Accounting-Murphy*
FWX     404020  COO
Inserting 404020*COO*
ACE     404030  President-Murray
Inserting 404030*President-Murray*
FWX     404040  President & Ceo
Inserting 404040*President & Ceo*

5) When I look at the table via query-analyzer, I get the following

DeptId   Name
---------- ------------------------------
404010 Accounting-Murphy
404020 COO
404030 Pre
404040 President & Ceo


Does anyone know why the value 'President-Murray' would get truncated to
'Pre' in the database
table?  I'm not getting any SQL errors.  Anyone have any thoughts on what to
try?  I've run out of ideas
at this point.

Thanks in advance,

Daniel Nenneman
HRMS Analyst\Developer
dnenneman@plato.com
PLATO Learning, Inc.