Will do.

Renshaw, Rick (C.) wrote:
When you use a computed expression in your select, SQL Server gives it a
default name unless you specify one.  So either try to retrieve the
column with the name 'Expr1' (the default name for the first expression
in the query) or change your query to specify a name for the column:

SELECT substring(ContracTerms,0,1000) as ContractTerms ....

Rick

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Craig
Cardimon
Sent: Friday, April 29, 2005 2:39 PM
To: ActivePerl; Perl-Win32-Users@listserv.ActiveState.com
Subject: SELECT substring of column into a variable


What I'm trying to do looks something like this:

SELECT  substring(ContractTerms, 0, 1000) "$ContractsTest_ContractTerms"
FROM    ContractsTest
WHERE   refnum = '1'

I'm using Perl 5.8.6.811 on Windows XP Pro. I'm using Win32::ODBC to connect to a SQL Server 2000 database.

I'm printing out the results using a hash within While FetchRow loop. I
can retrieve the other columns just fine.

ContractTerms is a problem because it is a text column and can be huge.
If I include it in the SELECT the whole thing bombs. I'm killing the
hash.

As I don't need the entire column, but merely a portion of it, a colleague suggested I trying selecting a substring of that column into a

variable or alias.

I have tried other variations, but it won't work.


-- Craig


--- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0517-5, 04/29/2005 Tested on: 4/29/2005 2:38:41 PM avast! - copyright (c) 1988-2004 ALWIL Software. http://www.avast.com



_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


--- avast! Antivirus: Inbound message clean. Virus Database (VPS): 0517-5, 04/29/2005 Tested on: 4/29/2005 3:27:32 PM avast! - copyright (c) 1988-2004 ALWIL Software. http://www.avast.com





--

Craig Cardimon
AUS INC.
(Knowledge Express Data Systems; 1-800-529-5337, ext. 24)


--- avast! Antivirus: Outbound message clean. Virus Database (VPS): 0517-5, 04/29/2005 Tested on: 4/29/2005 3:29:56 PM avast! - copyright (c) 1988-2004 ALWIL Software. http://www.avast.com



_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to