failure of dg4odbc with MSSQL driver

Hello

I know that this subject has been discussed several times, but I couldn't find one that would have helped me.

My problem is the following:

I have a platform of Oracle 11 g 2 on RedHat 6 and I need to get data from a SQL Server 2005 / 2008.

To do this, I installed Microsoft driver for Linux and I use dg4odbc with a database link.

Everything goes well until I need to retrieve data from SQL Server defined as varchar (max).

In this case, I can't solve the problem: [Microsoft] [ODBC Driver 11 for SQL Server] string data, the truncation on the right {01004}

If I connect using Microsoft (in the box of Red Hat) tools such as sqlcmd, I can run the SQL queries without problem.

As soon as I try to get the same data by the database link, I get the previous error.

For example, I created a test with the following definition table on my SQL Server box, and I inserted a registration:

CREATE TABLE TEST (col1 int, col4 varchar (max), varchar (30) col2, col3 nvarchar (30))

INSERT INTO TEST VALUES (1, 'value2', N 'value3', 'value4')

I'm just doing a SELECT * FROM TEST@remote

Then I activated the logs for dg4odbc and driver SQL Server.

Here's what I see:

the newspaper of ODBC:

[ODBC] [24984] [1390400782.066544] [SQLDescribeCol.c] [247]

Entry:

Statement = 0x18fb3a0

4 = column number

Column name = 0x7fffce187ca0

Length of the buffer = 31

Length of name = 0x7fffce187de4

Data type = 0x7fffce187de8

Column size = 0x7fffce187d80

Decimal digits = 0x7fffce187dec

Nullable = 0x7fffce187df0

[ODBC] [24984] [1390400782.066581] [SQLDescribeCol.c] [497]

Output: [SQL_SUCCESS]

Column name = [col4]

Data type = 0x7fffce187de8-> 12

Column size = 0x7fffce187d80-> 0

Decimal digits = 0x7fffce187dec-> 0

Nullable = 0x7fffce187df0-> 1

As you can see, the size of column is returned as 0.

Here is the log of the dg4odbc

hoadaMOD bit-values found (0x200: TREAT_AS_CHAR, 0x40: TREAT_AS_NCHAR)

DTY NULL-OK LEN MAXBUFLEN PR/SC CSE IND MOD NAME

4 INTEGER Y 4 4 0 / 0 0 0 0 col1

12 years of VARCHAR 30 30 0 / 0 0 0 200 col2

VARCHAR Y 60 60 128 12 / 30 1000 0 40 col3

12 VARCHAR Y 0 0 0 / 0 0 0 200 col4

Out of hgodscr, rc = 0 to 2014/01/22-15: 26:22

hostmstr: 0: HOA after hoxdscr

hostmstr: 0: CPP after SQL grouping

hostmstr: 0: CPP before the line

hostmstr: 0: HOA before hoaftch

Entry hgoftch, cursor id 1 to 2014/01/22-15: 26:22

hgoftch, line 130: print hoada @ 0 x 1912900

MAX: 4, ACTUAL: 4, BRC:100, WHT = 5 (SELECT_LIST)

hoadaMOD bit-values found (0x200: TREAT_AS_CHAR, 0x40: TREAT_AS_NCHAR)

DTY NULL-OK LEN MAXBUFLEN PR/SC CSE IND MOD NAME

4 INTEGER Y 4 4 0 / 0 0 0 0 col1

12 years of VARCHAR 30 30 0 / 0 0 0 200 col2

VARCHAR Y 60 60 128 12 / 30 1000 0 40 col3

12 VARCHAR Y 0 0 0 / 0 0 0 200 col4

Deferred execution open.

SQLBindCol: column 1, cdatatype:-16, bflsz: 4

SQLBindCol: column 2, cdatatype: 1, bflsz: 31

SQLBindCol: column 3, cdatatype:-8, bflsz: 62

SQLBindCol: column 4, cdatatype: 1, bflsz: 1

Entry hgopoer to 2014/01/22-15: 26:22

hgopoer, line 233: had native error 0 and sqlstate 01004; message follows...

[Microsoft] [11 for SQL Server ODBC driver] String truncation on the right {01004} data

Out of hgopoer, rc = 0 to 2014/01/22-15: 26:22

It seems that the SQLBindCol with column4 allocates only one byte... as the length is 0.

Is it possible to fix this problem.

I tried different things like adding the "VarMaxAsLong = Yes" in the odbc.ini, but without success.

Thanks for your help

Patrick

Reproduction:

SQL > select * from 'VarLong"@MSODBCSQLSERVER_DG4ODBC_EMGTW_1124_DB;

Select * from 'VarLong"@MSODBCSQLSERVER_DG4ODBC_EMGTW_1124_DB '.

*

ERROR on line 1:

ORA-28500: connection between ORACLE and a non-Oracle system has sent this message:

[Microsoft] [SQL Server Native Client 11.0] String truncation on the right {01004} data

ORA-02063: preceding 2 lines of MSODBCSQLSERVER_DG4ODBC_EMGTW_1124_DB

Other work of ODBC drivers:

SQL > select * from 'VarLong"@FREETDS_DG4ODBC_EMGTW_11_2_0_4.DE. ORACLE.COM;

col1 col2

---------- ------------------------------

COL3

--------------------------------------------------------------------------------

COL4

--------------------------------------------------------------------------------

1 value2

value3

Value4

Have a glance at the watch of trace indicates the data type is varchar instead of LongVarchar:

Column:4 (c): dtype:12 (VARCHAR), prc / scl:0 / 0, nullbl:1, byte: 0, sign: 1, radix: 0

The precision and scale are correct for a type of data lonvarchar (-1), but not for a varchar.

This problem should be reported to the ODBC.

-Klaus

Tags: Database

Similar Questions

  • HP dv6-2150us failure of recovery with new drive

    My HP Pavilion dv6-2150us Win 7 64 bit computer portable 320 GB drive has failed.  I want to install a 500 GB drive for a replacement, but get an error message when about 35% through the process recovery disk.  I tried all three options, system reset factory and reduced to a minimum.  All fail.

    The new drive can be partitioned and formatted easily into another computer.

    Any advice?

    The problem seems to be the process of partition/format.  I partitioned and formatted the drive on another PC via a USB/SATA cable and was finally able to do thanks to the installation of recovery factory reset.  Watching the reboot process and installation of things.

  • can I share documents in iCloud drive with another drive to iCloud user?

    can I share documents in iCloud drive with another drive to iCloud user?  If so, how to do that?

    No, at the present time, iCloud is configured for use by a single account to share data between devices of the owner of this account.  Your best bet for what you are looking for would be to use a third party application like Dropbox or Google Drive.

    You can share files individual even if - iWork sharing links to documents in iCloud - Support Apple iWork

  • Equium A210: "tsst corp ts-l632h" firmware is not compatible with my drive

    Last year I had an Equium A210 17l of pc world. I recently bought some dvd - r tdk discs and the drive cannot read them. It's as if there is no disk in the drive.
    So I thought I'd hunt around to see if there is updated firmware for the drive. I downloaded the firmware from this site, but when I try to update it says that the disc is not compatible! Evey bit of software I said the player is a * tsst corp cddvdw ts-l632h * with firmware to01.

    The firmware I'm trying to download is [this | http://uk.computers.toshiba-europe.com/cgi-bin/ToshibaCSG/download_driver_details.jsp?service=UK&selCategory = 2 & selFamily = 382 & selSeries = 173 & selProduct = 742 & STAS hortMod = 680 & language = 13 & selOS = 26 & selType = 50 & yearup load = & monthupload = & dayupload = & useDate = null & mode = al lMachines & search = & action = search & macId = & country = 8 & electedLanguage s = 13 & type = 50 & page = 1 & ID = 63137 & DISO =-1 & driverLanguage = 42]

    But whenever I try to run it it says that it is not compatible with my drive! What is going on?

    Jim Venner

    I recommend you to first install the 2 firmware until the you´re trying to upgrade the drive with the a3 because it is possible that the a3 requires the 2.

    Please visit the site to download drivers, download the firmware 2 and check if it works.
    Would appreciate any comments on your part.

    Welcome them

  • Since the Safari update to the most recent, problems with Google Drive

    Since the update of Safari to latest, problems with Google Drive

    There are serious issues with Google Reader itself at the present time.

    Google is working on it.

    I suggest stop smoking GoogleDrive and remove (with the minus sign) of the SystemPreferences-> users & groups-> LoginItems.

    Until further notice. Take no risk.

  • Need help with DVD drive - Qosmio G30

    Hello

    Sorry, my English is so bad. I need your help. I have a Qosmio G30 (PQG32E) and I have a problem in the DVD player. I see a (!) instead of the DVD drive in Device Manager. I think it's a problem with the driver. I don't know what I can do to solve this problem.

    Please can you help me?

    Perhaps this problem can be solved very easily.
    Have you noticed a code error 31 or 32?

    Possibly a registry entry is corrupted.
    Go into the registry and delete the Upperfilters and Lowerfilters completely from the following registry key values:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Contro l\Class\ {4D36E965-E325-11CE-BFC1-08002BE10318}

    Remove the drive from Device Manager CD/DVD, and then restart the laptop.

    I would appreciate any comments from you.

    Good luck

  • Pavilion 14-v202tx: problem with the driver

    Hello

    I got a Win7 64 bit and I have a problem with a driver: network controller pci device and BCM43142AO

    My laptop HP Pavilion 14-v202tx

    Please help me

    Hello

    Broadcom Wifi

    http://ftp.HP.com/pub/SoftPaq/sp66001-66500/sp66445.exe

    Broadcom Bluetooth software

    http://ftp.HP.com/pub/SoftPaq/sp66001-66500/sp66402.exe

    PCI device

    http://www.Realtek.com.tw/downloads/downloadsView.aspx?langid=1&PNid=15&PFID=25&level=4&Conn=3&DownTypeID=3&GETDOWN=false

    Kind regards.

  • JP Pavilion envy 17 n008nl: problem with a driver

    Hello

    I can't solve a problem with a driver.

    Here is the description:

    \VEN_8086&DEV_095A&SUBSYS_50108086&REV_61\4&3ac2d821&0&00E3

    Should which driver I install?

    Thanks in advance

    Here are the network drivers. Please install the network drivers:

    http://support.HP.com/us-en/document/bph07165

    ALSO

    Try to install HP Support Assistant that will automatically download and install updates/drivers:

    HPSA link:

    http://WWW8.HP.com/us/en/campaigns/hpsupportassistant/hpsupport.html

  • niDMM.cs exception: "the device was not recognized. The device is not supported with this driver or version. »

    Hi all!

    I have a question about using a DMM (PXI-4065) with VStudio 2008 and Measurement Studio 2009.

    Because DMM are not always supported in .net, I downloaded niDMM.cs 3.0 wrapper of the web site of NOR.

    I also downloaded example c# measure DC Voltsto compare with my request.

    Both an example and my application fail trowing the exception [-1074118656] 'the device was not recognized.  The device is not supported with this driver or version. " class constructor is called.

    DMM = new InstrumentDriverInterop.Ivi.nidmm ("PXI3::12:INSTR", true, true);

    I guess it is function of device PXI!

    I also tried to use a VISA alias as "pippo" and then I tried to insert a device unexistent name. In any case the same exception was trown.

    NOR-DAQmx 8.9.5

    NOR-DMM 3.0.1

    NI-VISA 4.6.1

    NOR-MAX 4.6.2f1

    Roberto

    Hello Robson,

    Maybe you areusing an incorrect descriptor itrument, try please the instructions contained in the following document:

    KB 33A96PCW: receive error-1074118656 when running OR DMM screws

    Let me know if this might help.

    Best regards.

  • How to set the parameters of the AKD with LABVIEW driver?

    Hello

    I am looking for a simple example to set or read the AKD with Labview driver settings.

    The AKD has ethernet communication and control is analog - AKD-P00306-NBAN-0000

    I want to use Labview to read the paramerters even as Kollmorgen WorkBench

    Thanks for your help

    Thank your for your help

    I found a solution with the TELNET Protocol

  • I'm trying to set up a wireless network and it is said that something does not work with the driver.

    Hi there tried to hook my laptop up to wireless as ethernet cable keeps me tripping. I am complete technophobe and propably have the only laptop that gets used especially to open the door.

    Have tried everything I can think even threaten her with glass of water after trying to connect to the wireless network, that it is said that there is something that doesn't work not with the driver if it means something to you. I have a toshiba, if it helps.
    Thank you
    original title: I hope someone can help technophobe

    It is said that there is something not working only not with the driver

    You probably need to install some network drivers for your wireless card.

    Download drivers

    Visit the manufacturer's Web site and select your computer model (this is usually done in the Support section). You should be able to download drivers for your model. Download the driver (s) and follow the instructions to install - every computer is different, so I can't give you exact directions. You can also try to use Windows Update to get drivers - it is located in the start menu.

    Establishment of a network domestic:

    http://Windows.Microsoft.com/en-us/Windows7/setting-up-a-home-network

    For more information network:

    Start here to set up a home network in Windows 7:

    http://Windows.Microsoft.com/en-us/Windows7/start-here-to-set-up-a-home-network-in-Windows-7

    What do I need to connect to Internet:

    http://Windows.Microsoft.com/en-us/Windows7/what-do-I-need-to-connect-to-the-Internet

    Adding a wireless computer

    Set up a wireless network:

    http://Windows.Microsoft.com/en-us/Windows7/setting-up-a-wireless-network

    If your network is wireless, run the wizard to Set Up a network on the computer attached to the router.

    1. open Set Up a network by clicking the Start button, then Control Panel. In the search box, type network, click Network and sharing Center click on set up a new connection or a network and then click on set up a new network.

    2. the wizard will guide you in the process of adding other computers and devices to the network. For more information, see:

    http://Windows.Microsoft.com/en-us/Windows7/add-a-device-or-computer-to-a-network

    Manually add a wireless computer

    1. sign the computer.

    2 open the connect to a network by clicking the network icon in the notification area.

    3. choose the network wireless from the list that appears and then click on connect.

    4. type the network security key or password if you are prompted to do so, and then click OK.

    -You will see a confirmation message when you are connected to the network.

    5. to confirm that you have added to the computer, follow these steps:

    -Open network by clicking the Start button, then Control Panel. In the search box, type network, and then, under center network and sharing, click on view network computers and devices.

  • I bought a computer from a business and it came not with all drives.

    Original title: I bought a computer and it came not with all drives.

    I bought a computer from a business, and it was a computer on the network. It came not with all drives. Is it possible to reformat the system with out having to re - buy windows xp or office? Can I get copies of XP and Office? I still have the XP sticker with the computer.

    If they don't give you the disks, all you need is a boat anchor. Ask them to give you the disks and product keys. Otherwise, you will need to buy.

  • Cannot install Vista service pack 2 is 800f0a09 error code with the message that there are problems with the driver for dell latitude

    Original title: why I get error code 800f0a09 to upgrade to windows vista service pack 2

    I have a laptop del that is running on Windows Vista Edition Home Premium. I tried to download itunes but it requires service pack 2. Whenever I try to update to service pack 2, I get the message following error code 800F0A09. He also mentioned problems with the driver for dell latitude. What can I do to fix this please.

    Thank you

    Hello

    Please join Microsoft Community where you can find the necessary information on Microsoft products!

    You can not install Vista Service pack 2 and get the error with code 800f0a09 and the message that there are problems with the driver for dell latitude.

    The problem may occur if some of the components of the update are corrupt.

    What is the full error message that you receive?

    I suggest you follow the steps mentioned below to check if the problem is with the update components:

    Method 1: Reset the update components

    See the site:

    How to reset the Windows Update components?

    http://support.Microsoft.com/kb/971058

    Warning: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-the-registry

    Method 2: Run the system update readiness tool

     

    See the site:

    System update scan tool corrects errors of Windows Update in Windows 8, Windows 7, Windows Vista, Windows Server 2008 R2 and Windows Server 2008

    http://support.Microsoft.com/kb/947821

    Method 3: Turn off the antivirus software

     

    See the site:

    Disable the anti-virus software

    http://Windows.Microsoft.com/en-in/Windows-Vista/disable-antivirus-software

    Important note: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.

    I hope this helps. If the problem persists, let know us and we would be happy to help you.

  • my pc will not connect to wireless internet... It is said there could be a problem with the driver for the wireless network connection card

    connection network card

    my pc will not connect to wireless internet... It is said there could be a problem with the driver for the wireless network connection card... I'm not sure how to solve the problem of the dat

    Hello

    Did you change your computer?

    I suggest you to follow the links and check out them.

    The problems of Internet connection

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-Internet-connection-problems

    Solve problems, find wireless networks

    http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-problems-finding-wireless-networks

    Windows wireless and wired network connection problems

    http://Windows.Microsoft.com/en-us/Windows/help/wired-and-wireless-network-connection-problems-in-Windows

    Tips for solving common driver problems

    http://Windows.Microsoft.com/en-us/Windows-Vista/tips-for-fixing-common-driver-problems

  • Windows 8 problem with a driver

    I have a HP pavilion dv6t with windows 8, I have a problem with a driver to unrecognize, please someone help me

    Here is the screenshot

    Hello:

    You must install this driver:

    http://h20000.www2.HP.com/bizsupport/TechSupport/SoftwareDescription.jsp?lang=en&cc=us&swItem=ob-109882-1&mode=4&IDX=0&prodTypeId=321957&prodSeriesId=3688868

    Paul

Maybe you are looking for