Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Database Server Software > Sybase

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-29-2008, 08:28 PM
geeklady@gmail.com
 
Posts: n/a
Default insert infinity value as float



Can anyone help me insert an "infinity" value into a float column?

- I moved a table with bcp - and can't get two of the rows into the
new table..

the 2 lines in the bcp'd file look like

10111339~11~ FXCHF01W ~rateFgn_mkt ~inf.0
10111339~11~FXITL01W ~rateFgn_mkt~inf.0


--> The inf.0 value is what I can't get inserted into the float column
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-29-2008, 08:28 PM
SybaseNeal
 
Posts: n/a
Default Re: insert infinity value as float

Hello,

Did you try bcp'ing in native mode? (bcp -n)
http://infocenter.sybase.com/help/in...s/blocks27.htm

If that did not work what version of ASE were you trying to bcp into?

What version of ASE did these values come from?

Thanks,
Neal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-02-2008, 05:05 AM
geeklady@gmail.com
 
Posts: n/a
Default Re: insert infinity value as float

On Apr 29, 3:50 pm, SybaseNeal <nstac...@gmail.com> wrote:
> Hello,
>
> Did you try bcp'ing in native mode? (bcp -n)
> http://infocenter.sybase.com/help/in...sybase.help.as...
>
> If that did not work what version of ASE were you trying to bcp into?
>
> What version of ASE did these values come from?
>
> Thanks,
> Neal


I tried with -n but it doesn't work..

I am bcp'ing from - 32 bit ASE 12.0.0 on Solaris to 64 bit ASE
15.0.2 on linux
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-02-2008, 05:05 AM
SybaseNeal
 
Posts: n/a
Default Re: insert infinity value as float

Hello,

I think newer versions disallow nan and inf for the most part.

Here is a note from one of the bugs that were fixed that now disallow
these non-numbers:
================================================== ======================
ASE does not allow the insertion of floating point values "NaN" and
"Inf" through straightforward
language methods, but does allow such values to be inserted through
other means. The behavior
should be consistant, either always allowing such values or never
allowing them. The current
inconsistant behavior causes terrible problems to replication
environments, as clients can insert
Nan values and repserver will try to replicate them, but does so by
generating TSQL language which
is rejected by the destination server, causing the replication system
to fail.
================================================== ======================

I found fixes in both the client utilities and in ASE that attempt to
prevent users from entering them:
231344 - CTBCP: native mode bcp now can prevent insertion of floating
point NaN and InF values.
Fixed in: 12.0 ESD#13, 12.5 ESD#6 and higher

271561 - Implement strong data type checking for floating-point values
of "NaN" and "Inf".
Disable using -T4067 at boottime.
Fixed in: 12.5.0.3 or higher

So if you REALLY want to try and insert them into 15.0.x, you could
try booting ASE with -T4067
and use the older version of bcp.

However, I would really discourage doing so as it might end up causing
more problems once you
force them into ASE. I would recommend running a query similar to
this to find the invalid FLOAT
values and then correct them once you find them:
select floatcolumn from mytable where
convert(int,convert(binary(8),floatcolumn) & convert(int,0x7ff0) =
convert(int,0x7ff0)

Thanks,
Neal
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:42 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145