Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


ORA-01722: invalid number Error occurred When using DTS


ORA-01722: invalid number Error occurred When using DTS

Author
Message
Hirotaka_Hibiya
Hirotaka_Hibiya
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 17
Hi All;

I'd like to copy a part of records in Oracle DB to SQL Server 2000 with DTS.
DTS's Steps are...

1. Run Execute SQL Task to retrieve the data and output to GV with RecrodSet Type.

SELECT col1 FROM TableA --> Lists (RecordSet)
!! some records are return as result !!



2. Run ActiveX Script Task to change data type from RecordSet to String and output to GV with Lists_for_Query.

set objRS = CreateObject("ADODB.Recordset")
set objRS = DTSGlobalVariables("Lists").value
for cnt = 1 to objRS.RecordCount
if strList = "" then
strList = objRS.Fields("col1").value
else
strList = strList & ", " & objRS.Fields("col1").value
end if
objRS.MoveNext
next
DTSGlobalVariables("Lists_of_Query").value = strList


Lists_of_Query contains a string such as "1200, 1201, 2003"

3. Run Transform Data Task to copy a part of records in Oracle DB to SQL Server 2000 with following Query.

SELECT *
FROM TableB
WHERE (col2 IN (?) )


!! The type of col2 is Number(10) !!

When I run this DTS, I got "ORA-01722: invalid number" Error Message.

But I can run the following query in Oracle SQL Developer Toole.

SELECT *
FROM TableB
WHERE (col2 IN (1200, 1201, 2003) )



Do you have any idea?
Jo Pattyn
Jo Pattyn
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1589 Visits: 9731
where does the come from?
Hirotaka_Hibiya
Hirotaka_Hibiya
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 17
Sorry. TableA is held by MSSQL Server. TableB is held by Oracle 10g.
Jo Pattyn
Jo Pattyn
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1589 Visits: 9731
I'm not familiar with DTS nor the "b" parameters.

I suspect that strList is passed as a string instead of a rowset/table. (for the in clause)
Like in ('abc,ddfdfqd,dfdfqdfe')

You can resort to dynamic sql using sp_executesql (beware of sql-injection)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search