Why is exception not thrown in AseCommand when "Truncation error occurred"?

In the below SQL, data is written to SOURCE and from there to TARGET.
The DECIMAL columns in TARGET are deliberately smaller than those in SOURCE (eg a DECIMAL (12, 2) column populated from a DECIMAL (19,11) source).
When I run this in an Query tool (eg, SqlDbx) I get the messages:
"Truncation error occurred
Command has been aborted"
But when I run this using the .net Client (supplied with the Developer Edition of ASE 16.0) no exception is thrown (the INSERT fails though).  The method is AseCommand.ExecuteNonQuery().
Is this deliberate? 
Is this believed to be correct?
How can I tell that a truncation error has been raised?
Thanks
IF OBJECT_ID ('dbo.TARGET') IS NOT NULL
  DROP TABLE dbo.TARGET
GO
CREATE TABLE dbo.TARGET
  S_Name_NVARCHAR NVARCHAR (50) null,
    S_RedComponent_DEC_15_6 decimal(15, 6) NULL,
    S_BlueComponent_DEC_12_2 decimal(12, 2) NULL, 
    S_GreenComponent_DEC_18_10 decimal(18, 10) NULL
GO
IF OBJECT_ID ('dbo.SOURCE') IS NOT NULL
  DROP TABLE dbo.SOURCE
GO
CREATE TABLE dbo.SOURCE
  Name_NVARCHAR      NVARCHAR (2000) NULL,
  RedComponent_DEC   DECIMAL (19,11) NULL,
  GreenComponent_DEC DECIMAL (19,11) NULL,
  BlueComponent_DEC  DECIMAL (19,11) NULL
GO
INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
VALUES ('Beige', 272.195, 272.195, 244.42)
GO
INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
VALUES ('Bisque', 283.305, 253.308, 217.756)
GO
INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
VALUES ('Black', 0, 0, 0)
GO
INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
VALUES ('BlanchedAlmond', 283.305, 261.085, 227.755)
GO
--Is there data to migrate?
SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC
FROM (
SELECT * FROM SOURCE
) S
--Yes.migrate away!
--Next line gives a truncation error occurred in Sybase (gives a truncation error occurred in a query tool
--but fails silently in AseCommand.ExecuteNonQuery).
INSERT dbo.TARGET (S_Name_NVARCHAR,S_RedComponent_DEC_15_6,S_BlueComponent_DEC_12_2,S_GreenComponent_DEC_18_10)
SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC
FROM (
SELECT * FROM SOURCE
) S
select * from dbo.TARGET

Hi Dave,
I am consulting internally on this. To my understanding, this behavior is based on the ASE severity level, as returned in the TDS_EED token. AseExceptions are thrown when severity level is 11 or higher.
Our docs are not explanatory in this regard.  Once I get clarification we will provide something in the form of wiki or KBA or doc bug to further explain the detail.  Apologize for the delay and problems this caused. I guess since the command is aborted by ASE, therefore no insertion occurs, even though ASE indicates truncation occurs prior - makes this confusing.
The message severity, etc is controlled by ASE and the client is just following suit according to the TDS spec. Its just lacking in the client docs. This can be remedied.
ASE does provide the option to allow truncation and not abort.  It's a set command:
Enter a query:
1 > set arithabort numeric_truncation off
Enter a query:
1 > INSERT dbo.TARGET (S_Name_NVARCHAR,S_RedComponent_DEC_15_6,S_BlueComponent_DEC_12_2,S_GreenComponent_DEC_18_10) SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC FROM (SELECT * FROM SOURCE
) S
4 rows Affected.
Notice though ASE does NOT send truncation message. This is when it is well known and accepted to insert and truncate the numeric data.
Cheers,
-Paul

Similar Messages

  • HT5312 Why am I not recieveing the email, when i try to reset my security question answers?

    Why am I not recieveing the email, when i try to reset my security question answers?

    Has anyone received an answer to this? It seems that a lot of us are having the same issue. In the past i had no trouble receiving emails to reset my password but for the past week I havne't been able to login, my security questions didn't work and I haven't received any of the emails to reset my password. I've created a new Account but would rather  get into my old account because it's linked to my perfered email address. Hum..
    Any help from the community would be much apprecated! thanks!
    Lori

  • Error 8062 when I try to copy or move files on my macbook: "This operation could not be completed because an unexpected error occurred (error code -8062)". Can even not install new software now!!

    Since a few days when I try to copy or move files on my macbook, I often get an error message saying "This operation could not be completed because an unexpected error occured (error code -8062)". And then it just quits the copy or move.
    I searched a lot on the internet, but only found solutions for cases you cannot empty the trash due to this issue.
    I tried those solutions for my trash and that helped after some trying.
    However, I still have the problem with copying and moving files.
    I even cannot install new software now, as it has to copy itself to the programs-directory, and gives the same error-message.
    Who can help me??
    Cannot seem to find any info on it on the support-forums or elsewhere.
    My user-account is administrator, I use a 13" Macbook Aluminium (Late 2008). Mac OS X 10.6.8 CPU 2Ghz Intel Core Duo, RAM: 4GB 1067 MHz DDR3.
    Any help would be greatly appreciated...
    Otto

    Tips I received so far (thanks to A-Mac via Twitter http://www.a-mac.nl and Remco Kalf http://www.remcokalf.nl/)
    - make sure you have at least 10% of your harddisk in free space (I had only 5%).
    - do a PRAM-reset (http://support.apple.com/kb/ht1379)
    - perform a hardware test (http://support.apple.com/kb/HT1509)
    - make a complete backup (with for example Carbone Clone Copier, see http://www.bombich.com/)
    - after complete backup: use diskwarrior (boot from Diskwarrior DVD, first perform diagnostics, then perform "Rebuild" which rebuilds your file directory).
    So far I only cleared up some space on my HD, and already the problem occurs less.
    Still, I will go through the other tips too.
    (will post progress)

  • HT201210 My iPad is not recognized by Finder or iTunes when it is plugged into the computer.  i ran the Restore sequence and got an error message stating "The iPad could not be restored.  An unknown error occurred (1611).  Can this be fixed?

    My iPad is not recognized by Finder or iTunes when it is plugged into the computer.  i ran the Restore sequence and got an error message stating "The iPad could not be restored.  An unknown error occurred (1611).  Can this be fixed?

    iTunes: Specific update-and-restore error messages and advanced troubleshooting - http://support.apple.com/kb/TS3694 - relating to iPad, iPhone, iPod touch, iTunes
    Security software issues covered in: iTunes: Troubleshooting security software issues - http://support.apple.com/kb/TS3125

  • HT201413 HELP!  I was updating my iphone 4S to the new IOS6 via itunes when in the in the middle of the process of actually updating the iphone OS, it suddenly returned an error - "The iPhone could not be updated.  An unknown error occurred (1602)"  PLEAS

    PLEASE HELP!!!
    I am using an HP DV9 laptop running Windows 7 Home Premium and the latest iTunes software.
    I regularly synch my iphone 4S with my laptop & Outlook.
    I recently got the message that an IOS6 upgrade is available & so I scheduled to apply the update.
    Everything was running normally when, after the download of the update, backup of my iphone, & applying the update began when
    suddenly, iTunes returned with an ERROR MESSAGE as follows:
    The iPhone "Ramon's iPhone" could not be updated.  An unknown error occurred (1602)
    Now, my iphone is stuck with the iTunes icon and the USB image with an arrow pointing to the iTunes
    icon.
    WHAT DO I DO NOW?????!!!!!
    Help PLEASE!!!!

    I actually tried the steps below due to the error -5000 I had encountered during the previous tries updating my IOS to 5.1.1
    "Perform a normal sync and check your iTunes to make sure everything was synced in the right places like the tabs at the top of your "summary" when you plug in your iPhone to iTunes.  If everything is there and all the right boxes are checked for the stuff you want to save, then put your phone into recovery mode by keeping it plugged into your computer with iTunes still up and running. Next you want hold down the power button AND the home key button (the big button on the bottom part of your screen) AT THE SAME TIME. Your phone will go thru 4 different screens before you
    Can let them go.  U will see your normal power off slider screen, then a black screen, then a black screen with an apple logo, then finally a screen with the iTunes logo and a picture of a sync cable below it. Once you see this screen LET BOTH BUTTONS GO but not before you see this screen.  Your computer will tell you that it has detected an iPhone in recovery mode, say ok.  Then hit the restore button on your iTunes summary screen, it should then ask you if you want to restore from a backup and update, say yes.... And at the end of its restoring and uploading you should have iOS 5!!"
    Then it proceeded to a reactivation process... =(

  • I can't open iTunes. When I do it says "The iTunes application could not be opened. An unknown error occured (13014)."

    I can't open iTunes. When I do it says "The iTunes application could not be opened. An unknown error occured (13014)."
    How can I get rid of this error message and open iTunes?

    are you running any anti virus software on your machine ?

  • HT201210 The iPod "iPod" could not be restored. An unknown error occurred (1).This is my Ipod 32 GB, which is out of warranty and is 1G-A1213 and had gone kaput, after having issues with iTunes Software as it was not able to run Music on my IPod when conn

    The iPod "iPod" could not be restored. An unknown error occurred (1).This is my Ipod 32 GB, which is out of warranty and is 1G-A1213 and had gone kaput, after having issues with iTunes Software as it was not able to run Music on my IPod when connected.
    I have wasted my precious 2 days and nights and am lost all my hope...APPEAL TO ALL GEEKS TO RESOLVE MY ISSUE ON HUMANITARIAN GROUNDS ATLEAST WITH SOME VALID TIME OF YOURS.
    All mails can be sent to [email protected]
    Restore of Ipod back up is present...but is not getting restored due to some iTunes issue with playing my music files.It says restoring and extracts but failes in 1 min with the said error.

    Other users and reported error 1 but I have not seen a solution.
    Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar                          

  • When tried to upgrade iphone 4S from 8.1.2 to 8.1.3 it crushed at the middle, after it it not let it tern on and cannot make recovery and crush in the middle of the process with "could not be restored. An unknown error occurred (3014)"

    When tried to upgrade iphone 4S from 8.1.2 to 8.1.3 it crushed at the middle.
    After it it not let it tern on and cannot make recovery and crush in the middle of the process with "could not be restored. An unknown error occurred (3014)"

    Hi bahaluly,
    Thanks for using Apple Support Communities. Based on what you stated, it sounds like you are not able to update the iPhone. I would recommend that you read this article, it may be able to help the issue.
    Get help with iOS update and restore errors - Apple Support
    Solve network errors
    Related errors: 17, 1638, 3014, 3194, 3000, 3002, 3004, 3013, 3014, 3015, 3194, 3200, or "There was a problem downloading the software," or "The device isn't eligible for the requested build." These alerts mean that your computer is either having difficulty contacting the Apple update server or communicating with your device. 
    Check your computer for software or settings that might cause communication issues between your computer and Apple or between your computer and your device.
    Cheers,
    Mario

  • Hi all, I'm trying this morning to make the backup of my iPhone from 32 gigabytes. When I start the synchronization and backup I get written'' iTunes could not back up iPhone because an error occurred. I tried it on another iphone (4) and everything works

    Hi all, I'm trying this morning to make the backup of my iPhone from 32 gigabytes. When I start the synchronization and backup I get written'' iTunes could not back up iPhone because an error occurred. I tried it on another iphone (4) and everything works fine. I can not reset the device because I have too much important data on it. Please help me.
    Salve a tutti, sto cercando da stamattina di effettuare il Backup del mio IPhone da 32 gigabyte. Quando avvio la sincronizzazione e il Backup mi esce scritto '' iTunes non ha potuto eseguire il backup di Iphone perche si è verificato un errore. Ho provato su un altro iphone (4) e tutto funziona correttamente. Non posso ripristinare il dispositivo perchè ho troppi dati importanti sopra. Vi prego aiutatemi.

    Ok I tried to delete the backup by using your location via preferences, but I did not find any file, maybe because I've already deleted following the path to the disk. I repeat that I have 2 devices and the problem only occurs on one

  • When i try to update my iPhone 3G software, the message alert showing (The iPhone ''iPhone'' could not be restored. An unknown error occurred). now my iPhone 3G blank display. how can i do then please?

    when i try to update my iPhone 3G software, the message alert showing (The iPhone ''iPhone'' could not be restored. An unknown error occurred). now my iPhone 3G blank display. how can i do then please?

    I was not sure about the ''jailbroken''. now my iPhone cannot use, on the showing (connect to iTunes logo). so if i just want my iPhone process in normal, what can i do? i mean i want it back to the previous software version?

  • How do you get album artwork? I have like two thousand songs and about 95% don't have cover album artwork and when i try to get album artwork it says "Itunes can not find album artwork" "an unknown error occurred-609" what do i do?

    How do you get album artwork? I have like two thousand songs and about 95% don't have cover album artwork and when i try to get album artwork it says "Itunes can not find album artwork" "an unknown error occurred-609" what do i do?

    Perhaps try the "Error -609" section in the Specific Conditions and Alert Messages: (Mac OS X / Windows) section of the following document:
    iTunes: Advanced iTunes Store troubleshooting

  • Hello Sir I have an iPhone 4 and when i updated that it got updated but now for restore the data it is showing me the message The "iPhone" could not be activated because an unknown error occurred (0xE8000004). Please try again later. please help me.

    Hello Sir I have an iPhone 4 and when i updated that it got updated but now for restore the data it is showing me the message The "iPhone" could not be activated because an unknown error occurred (0xE8000004). Please try again later. please help me.

    Hello Amarchand Sharma,
    Are you working with a Windows computer?  If so, the resource below may help you troubleshoot the issue you are having restoring your iPhone.
    iOS: Unknown error containing '0xE' when connecting to a Windows PC - Apple Support
    http://support.apple.com/en-us/TS3221
    Regards,
    Judy

  • HT201210 When I Restored my ipad 2, it will come out error [ The iPad "iPad" could not be restored. An unknown error occurred (-1). How can I do?

    When I Restored my ipad 2, it will come out error [ The iPad "iPad" could not be restored. An unknown error occurred (-1). How can I do?

    http://support.apple.com/kb/TS3694#error1
    Error 1 or -1
    This may indicate a hardware issue with your device. Follow Troubleshooting security software issues, and restore your device on a different known-good computer. If the errors persist on another computer, the device may need service.
    Usually this is caused by your antivirus or firewall blocking iTunes access to the Internet. It can also occur if the phone is jailbroken or if the computer you are using was ever used to jailbreak an iDevice.

  • When I do I get The iPad "iPad" could not be restored. An unknown error occurred (3194).

    when I do I get The iPad "iPad" could not be restored. An unknown error occurred (3194).

    Hi,
    Check your network settings as specified here:
    http://support.apple.com/kb/TS3694?viewlocale=en_US&locale=en_US#error3194
    Hope that helps.

  • HT1267 While upgrading my iPhone 3 to 4.2 something went wrong and would not start at all. When tried to restore after going through th process it comes up with the message "The iPhone could not be restored. An unknown error occurred [1015]." What can I d

    While upgrading my iPhone 3GS to iOS 4.2 something went wrong and came up with the message "The iPhone could not be restored. An unknown error occurred  [1015]." Now it will not start at all. It just stays on screen with USB and the iTune picture. What can I do to get it going again. I only tried to upgrade because I was prompted to up-grade and now I am helpless. I did a backup before starting the upgrade. The error message did not tell what to do next.  Any help is very much appreciated.

    Usually that means the iPhone was hacked to unlock it from the original
    carrier .
    Updating the operating system locks it back to that original carrier
    You could try this
    http://support.apple.com/kb/TS3281
    However if the iPhone was hacked it is probably a paper weight  now
    and as this is an Apple hosted forum  you can get no further help here

Maybe you are looking for