Showing posts with label odbc. Show all posts
Showing posts with label odbc. Show all posts

Monday, March 19, 2012

Errors processing data from Oracle to SQL

hi here′s a new one.....
i′ve created a dts that is using an odbc source to connect to an oracle server, the conexion works just fine and i have no problems with it, then, i run this package from mi computer and the data transfer ends succesfully, when i upload it to my server in SQL 2005 and set it into a job.. i get errors like these:

Event Name: OnError
Message: Thread "WorkThread0" has exited with error code 0xC0047039.

Event Name: OnError
Message: Thread "WorkThread0" received a shutdown signal and is terminating. The user requested a shutdown, or an error in another thread is causing the pipeline to shutdown.

Event Name: OnError
Message: The PrimeOutput method on component "table" (1) returned error code 0xC02090F5. The component returned a failure code when the pipeline engine called PrimeOutput(). The meaning of the failure code is defined by the component, but the error is fatal and the pipeline stopped executing.

Event Name: OnError
Message: The component "faccomitecedidos" (1) was unable to process the data.

Event Name: OnError
Message: The "component "table" (1)" failed because error code 0x80131541 occurred, and the error row disposition on "output column "diasperm" (1707)" specifies failure on error. An error occurred on the specified object of the specified component.

why is this happening , any solutions or ideas? the data i want to extract comes from an sql command not a table
this is the query:

SELECT
FCNSS ,
FITIPOSOLICITUD ,
FIFOLIO ,
RTRIM(FCNOMBRE)||' '||RTRIM(FCAPPATERNO)||' '||RTRIM(FCAPMATERNO) AS NOMBREAFILIADO,
fdfinicta as FAFIL ,
fdFecCedido as FCED ,
(fdFecCedido-fdfinicta) AS diasperm ,
FNSALARIOACTUAL AS SALAFIL ,
(SELECT DISTINCT FISDI FROM gentec_own.AFILCEDIDOS WHERE
FIFOLIO = gentec_own.faccomite.FIFOLIO AND FITIPOSOLICITUD = gentec_own.faccomite.FITIPOSOLICITUD AND FCNSS = gentec_own.faccomite.FCNSS AND ROWNUM = 1) AS salCED ,
(SELECT DISTINCT (FISDI/48.60) FROM gentec_own.AFILCEDIDOS WHERE
FIFOLIO = gentec_own.faccomite.FIFOLIO AND FITIPOSOLICITUD = gentec_own.faccomite.FITIPOSOLICITUD AND FCNSS = gentec_own.faccomite.FCNSS AND ROWNUM = 1) AS CalSalCED ,
FCNUMPROMOTOR AS cod_promotor,
(SELECT RTRIM(FCNOMBRES)||' '||RTRIM(FCAPEPATERNO)||' '||RTRIM(FCAPEMATERNO)
FROM gentec_own.prommaestro where FCNUMPROMOTOR = gentec_own.faccomite.FCNUMPROMOTOR AND ROWNUM = 1) AS NOMPROMOTOR,
FICVEENTCED as aforeorig ,
FCAFORECEDIDO as aforeced ,
FNINGCOMT ,
FNCTOPROMOCION ,
FNCTOADMON ,
FNCONTRIBUCION ,
fcCanal as Canal ,
FCDIVISION as Division ,
FCREGION as Gerencia
FROM gentec_own.FACCOMITE
WHERE FCCEDIDO = 1
and (to_char(fdFecCedido,'yyyymmdd')>=to_char(sysdate-8,'yyyymmdd') and to_char(fdFecCedido,'yyyymmdd')< to_char(sysdate,'yyyymmdd'))
order by fdFecCedido;

please!!!1 somebody

maybe the problem is here:

(fdFecCedido-fdfinicta) AS diasperm

|||

hi unfortunately this wasn′t the error, i tried changing the query for a view in the oracle server but the error is stil the same

Event Name: OnError

Message: The "component "DataReader Source" (1)" failed because error code 0x80131541 occurred, and the error row disposition on "output column "DIASPERM" (404)" specifies failure on error. An error occurred on the specified object of the specified component.

and the query is just :

select * from db.view

and that′s it.... any posible solutions? is there any complications if the server where i′m running the job is under 64 bits and the dts ′s been created under 32 bits? if so. where can i find a 32 bits odbc driver for oracle that i may install in the target server!!!! please!!!!!!!!!!

|||

It looks like a SQL syntax problem. If you try to issue your entire original statement DIRECTLY against your oracle database, do you not get an error?

It seems to me that you need to tie back your results to the main query as you did here:

(SELECT DISTINCT FISDI FROM gentec_own.AFILCEDIDOS WHERE
FIFOLIO = gentec_own.faccomite.FIFOLIO AND FITIPOSOLICITUD = gentec_own.faccomite.FITIPOSOLICITUD AND FCNSS = gentec_own.faccomite.FCNSS AND ROWNUM = 1) AS salCED ,

|||

i don′t think this is a problem of syntax cause i run the query directly on the oracle db and it works, it seems more like a problem of windows version, since i run this dts on my 32 bits pc i get the results without problems.. the problem comes when uploading the package to the target server that is running under 64 bits, to do this i'm using an 32bits odbc oracle driver but the odbc that is used in the target server seems to be under 64 bits , because of this, i'd like to try using the same kind of odbc so, where can i get
one?

a 32 bits odbc driver for oracle that works in a server running in 64 bits mode

pleaseee

Wednesday, February 15, 2012

ERROR: String or binary data would be truncated.

ERROR: String or binary data would be truncated.

The error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e57'

[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.

/maxwebportal/inc_footer.asp, line 121

Thanks for ANY assistance. I'm pretty much new at this. <CHRIS>

>>>Code Below...Scroll Down for Line 121:

if exceer=okoame then

if CurPageInfoChk = "" then
strOnlineLocation = "Unknown page"
else
if CurPageType = "forums" and trim(strRqForumID) <> "" then
'## Forum_SQL - load the user list
strSql = "SELECT " & strTablePrefix & "FORUM.F_PRIVATEFORUMS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & strRqForumID & " AND F_PRIVATEFORUMS <> 0"

set rsPrf = my_Conn.Execute(strSql)

if not (rsPrf.BOF and rsPrf.EOF) then
isPrivateForum = 1
else
isPrivateForum = 0
end if

rsPrf.Close
set rsPrf = nothing

end if
if not CurPageInfo () = "" then
if isPrivateForum = 1 then
strOnlineLocation = "Private Page"
else
strOnlineLocation = CurPageInfo ()
end if
else
strOnlineLocation = "Hidden page"
end if
end if

strOnlineUser = OnlineSQLencode(strOnlineUser)
strOnlineLocation = OnlineSQLencode(strOnlineLocation)
strOnlineTimedOut = strOnlineCheckInTime - 1500 'time out the user after 25 minutes
strSql = "SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.LastChecked"
strSql = strSql & " FROM " & strTablePrefix & "ONLINE "
strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "' AND " & strTablePrefix & "ONLINE.UserID='" & strOnlineUser & "'"
set rsWho = my_Conn.Execute (strSql)

if rsWho.eof or rsWho.bof then
' THEY ARE A NEW USER SO INSERT THERE USERNAME
on error resume next
Set objRS2 = Server.CreateObject("ADODB.Recordset")
strSQL = "INSERT INTO " & strTablePrefix & "ONLINE (UserID,UserIP,DateCreated,CheckedIn,LastChecked,M
_BROWSE) VALUES ('"
strSql = strSQL & strOnlineUser & "','" & strOnlineUserIP & "','" & strOnlineDate & "','" & strOnlineCheckInTime & "','" & strOnlineCheckInTime & "','" & strOnlineLocation & "')"
my_Conn.Execute (strSql)
if err.number <> 0 then response.write err.number & "|" & err.description
else
' THEY ARE A ACTIVE USER
strSql = "SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.LastChecked"
strSql = strSql & " FROM " & strTablePrefix & "ONLINE "
strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP = '" & strOnlineUserIP & "'"
set rsLastChecked = my_Conn.Execute (strSql)

' LETS UPDATE THE TABLE SO IT SHOWS THERE LAST ACTIVE VISIT
strSql = "UPDATE " & strTablePrefix & "ONLINE SET M_BROWSE='" & strOnlineLocation & "' , LastChecked='" & strOnlineCheckInTime & "' WHERE UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "'"
my_Conn.Execute (strSql) << Line 121<<<<<<<basically,... the data you are trying to update using this...

' LETS UPDATE THE TABLE SO IT SHOWS THERE LAST ACTIVE VISIT
strSql = "UPDATE " & strTablePrefix & "ONLINE SET M_BROWSE='" & strOnlineLocation & "' , LastChecked='" & strOnlineCheckInTime & "' WHERE UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "'"

is too long for the field you are trying to put it into.

eg you field is a varchar(10) and you are tyring to put "Help me get this right" in there.... and it won't fit...

So, check your field sizes, check the data you are inserting and soon you will discover what one(s) is wrong.|||Originally posted by rokslide
basically,... the data you are trying to update using this...

' LETS UPDATE THE TABLE SO IT SHOWS THERE LAST ACTIVE VISIT
strSql = "UPDATE " & strTablePrefix & "ONLINE SET M_BROWSE='" & strOnlineLocation & "' , LastChecked='" & strOnlineCheckInTime & "' WHERE UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "'"

is too long for the field you are trying to put it into.

eg you field is a varchar(10) and you are tyring to put "Help me get this right" in there.... and it won't fit...

So, check your field sizes, check the data you are inserting and soon you will discover what one(s) is wrong.

Generally this mssg comes when the query inserts a record and any one of the column size if it exceeds the input parameter value then this kind fof error happens.
Ex - tableA is having a coulmn1 varchar(20) if the query is entering a value which is 21 varchar then this type of error may be displayed.

ERROR: String or binary data would be truncated.

The error:
Microsoft OLE DB Provider for ODBC Drivers error '80040e57'

[Microsoft][ODBC SQL Server Driver][SQL Server]String or binary data would be truncated.

/maxwebportal/inc_footer.asp, line 121

Thanks for ANY assistance. I'm pretty much new at this. <CHRIS>

>>>Code Below...Scroll Down for Line 121:

if exceer=okoame then

if CurPageInfoChk = "" then
strOnlineLocation = "Unknown page"
else
if CurPageType = "forums" and trim(strRqForumID) <> "" then
'## Forum_SQL - load the user list
strSql = "SELECT " & strTablePrefix & "FORUM.F_PRIVATEFORUMS FROM " & strTablePrefix & "FORUM WHERE FORUM_ID = " & strRqForumID & " AND F_PRIVATEFORUMS <> 0"

set rsPrf = my_Conn.Execute(strSql)

if not (rsPrf.BOF and rsPrf.EOF) then
isPrivateForum = 1
else
isPrivateForum = 0
end if

rsPrf.Close
set rsPrf = nothing

end if
if not CurPageInfo () = "" then
if isPrivateForum = 1 then
strOnlineLocation = "Private Page"
else
strOnlineLocation = CurPageInfo ()
end if
else
strOnlineLocation = "Hidden page"
end if
end if

strOnlineUser = OnlineSQLencode(strOnlineUser)
strOnlineLocation = OnlineSQLencode(strOnlineLocation)
strOnlineTimedOut = strOnlineCheckInTime - 1500 'time out the user after 25 minutes
strSql = "SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.LastChecked"
strSql = strSql & " FROM " & strTablePrefix & "ONLINE "
strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "' AND " & strTablePrefix & "ONLINE.UserID='" & strOnlineUser & "'"
set rsWho = my_Conn.Execute (strSql)

if rsWho.eof or rsWho.bof then
' THEY ARE A NEW USER SO INSERT THERE USERNAME
on error resume next
Set objRS2 = Server.CreateObject("ADODB.Recordset")
strSQL = "INSERT INTO " & strTablePrefix & "ONLINE (UserID,UserIP,DateCreated,CheckedIn,LastChecked,M _BROWSE) VALUES ('"
strSql = strSQL & strOnlineUser & "','" & strOnlineUserIP & "','" & strOnlineDate & "','" & strOnlineCheckInTime & "','" & strOnlineCheckInTime & "','" & strOnlineLocation & "')"
my_Conn.Execute (strSql)
if err.number <> 0 then response.write err.number & "|" & err.description
else
' THEY ARE A ACTIVE USER
strSql = "SELECT " & strTablePrefix & "ONLINE.UserID, " & strTablePrefix & "ONLINE.UserIP, " & strTablePrefix & "ONLINE.LastChecked"
strSql = strSql & " FROM " & strTablePrefix & "ONLINE "
strSql = strSql & " WHERE " & strTablePrefix & "ONLINE.UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP = '" & strOnlineUserIP & "'"
set rsLastChecked = my_Conn.Execute (strSql)

' LETS UPDATE THE TABLE SO IT SHOWS THERE LAST ACTIVE VISIT
strSql = "UPDATE " & strTablePrefix & "ONLINE SET M_BROWSE='" & strOnlineLocation & "' , LastChecked='" & strOnlineCheckInTime & "' WHERE UserID='" & strOnlineUser & "' AND " & strTablePrefix & "ONLINE.UserIP='" & strOnlineUserIP & "'"
my_Conn.Execute (strSql) << Line 121<<<<<<<This error occurs when the data you are inserting into your column exceeds the data width specified for the column. Check your DDL and insert statement to find out the particular column.