Hi,
Why you dont' use SPT with bind parameters?
?SQLEXEC(MSSQLHandle,"SELECt * FROM sourcetable","xxc")
SELE xxc
SCAN ALL
?SQLEXEC(ORACLEHandle,"INSERT INTO desttable (Unit_ID, Description, QuantityFK, Factor, Multiplier, Last_Update) VALUES (?xxc.Unit_ID, ?xxc.Description, ?xxc.QuantityFK, ?xxc.Factor, ?xxc.Multiplier, ?xxc.Last_Update)")
ENDSCAN
MartinaJ
>I am trying to create insert statements from a table of data from SQL Server to execute against an Oracle table of similar structure. I am struggling with a couple of float columns that seem to be converting to scientific notation. I do not want the values converted. SSMS query displays these values straight up so why can't I get them straight up?
>
>This is my query to get my data out as Insert Statements but with no convert or cast causes an error.
>
>SELECT 'INSERT INTO UCS_UNIT (Unit_ID, Description, QuantityFK, Factor, Multiplier, Last_Update) VALUES(''' +
> REPLACE(CAST(UnitID AS VARCHAR(36)),'-', '') + ''', ''' + Description + ''', ''' + REPLACE(CAST(QuantityFK AS VARCHAR(36)),'-', '') +
> ''', ''' + Factor + ''', ''' + Multiplier +
> ''', TO_DATE(''' + CONVERT(VARCHAR(19), LastUpdate, 121) + ''', ''YYYY-MM-DD HH24:MI:SS''));' AS UCS_Unit
>FROM uom.Unit WHERE Active = 1;
>
>
>
>Trying to do some Cast and Convert comparisons gives me varying output but none are what I need.
>
>select UnitID, Factor, CONVERT(VARCHAR(50), Factor, 128) As ConvertFactor,
>CAST(Factor AS VARCHAR(50)) As CastFactor,
>CAST(CAST(Factor AS Float) AS VARCHAR(50))AS CompountFactor
> from uom.Unit where QuantityFK = 'D9930486-53C3-41BD-9444-010E931EF061';
>
>
>
>
>2551443.86974022 2.55144386974022E6 2.55144e+006 2.55144e+006
>86400 86400 86400 86400
>3153600000.3744 3.1536000003744E9 3.1536e+009 3.1536e+009
>157679960.138506 1.57679960138506E8 1.5768e+008 1.5768e+008
>2629822.96584 2.62982296584E6 2.62982e+006 2.62982e+006
>
>
>
>This is a one time data load that I won't be doing again. I wanted something down and dirty.
>Only between 3,000 and 4000 rows.