?
Solved

Sql Server Odbc truncate strings

Posted on 2005-03-09
5
Medium Priority
?
380 Views
Last Modified: 2012-08-13
Hi,

I have a stored procedure in Sql Server returning varchar with maximum length of 50.
I define an OdbcParameter with direction equals to returnValue, and after executing the stored procedure, the value shows only the first character, which was truncated.
Im using Microsoft SQL Server ODBC Driver Version 03.85.1025.
When i use the same code with an equivalent Oracle stored procedure it works fine.

Any help is appreciated.
0
Comment
Question by:ruvik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 18

Expert Comment

by:testn
ID: 13494996
when you create a return odbc parameter, you can explicit define type of return parameter... something like this (not sure about syntax)

yourcommand.Parameters.Add(new OdbcParameter("RETURN_VALUE",
        OdbcType.VarChar,50,ParameterDirection.ReturnValue));
0
 

Author Comment

by:ruvik
ID: 13495332
Yes I know that and Ive already tried all the text like types (just in case), but none did the trick.
No matter the parameter type, it always truncates the entire string but the first character.
0
 
LVL 11

Accepted Solution

by:
Otana earned 750 total points
ID: 13495771
It might be a problem in your Stored Procedure. Have you tested it in the Query Analyzer?
0
 

Author Comment

by:ruvik
ID: 13496541
stupied me! since im new to sql server i returned type varchar instead of varchar(50).
Otana, i will accept your answer only because you made me look again in the query analyzer and discover my stupidity.
0
 
LVL 11

Expert Comment

by:Otana
ID: 13496675
Thnx. That's what I thought might have happened. Happens to me all the time :o)
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question