An error was encountered performing the requested operation:ORA-00604: - database

I am trying connection to the Oracle database but this error display :
An error was encountered performing the requested operation:ORA-00604: error occurred at recursive SQL level 1ORA-01756: quoted string not properly terminated00604. 00000 - "error occurred at recursive SQL level %s"*Cause: An error occurred while processing a recursive SQL statement(a statement applying to internal dictionary tables).*Action: If the situation described in the next error on the stackcan be corrected, do so; otherwise contact Oracle Support.
what is the wrong and how can I solve it ?

Related

Error at Data Conversion Transformation when Trying to Convert String from Excel Source to DB_TIMEZONEOFFSET to SQL Server Destination

Been several years since I had to write an SSIS package and struggling with converting a datetimezone string from Excel to Data Conversion transformation converting to DB_TIMEZONEOFFSET to a SQL Server Destination.
The following is the Timestamp in all 7 rows of Excel source:
The date column from the Excel source is a Unicode String [DT_WSTR] as seen below:
The SQL Server destination field is setup as DATETIMEOFFSET(7) as seen below:
I am receiving the following errors on the Data Conversion transformation when run the data flow:
[Data Conversion 2] Error: Data conversion failed while converting
column "Column1.createdAt" (82) to column "Copy of Column1.createdAt"
(38). The conversion returned status value 2 and status text "The
value could not be converted because of a potential loss of data.".
[Data Conversion 2] Error: SSIS Error Code
DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "Data
Conversion.Outputs[Data Conversion Output].Columns[Copy of
Column1.createdAt]" failed because error code 0xC020907F occurred, and
the error row disposition on "Data Conversion.Outputs[Data Conversion
Output].Columns[Copy of Column1.createdAt]" specifies failure on
error. An error occurred on the specified object of the specified
component. There may be error messages posted before this with more
information about the failure.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The
ProcessInput method on component "Data Conversion" (2) failed with
error code 0xC0209029 while processing input "Data Conversion Input"
(3). The identified component returned an error from the ProcessInput
method. The error is specific to the component, but the error is fatal
and will cause the Data Flow task to stop running. There may be error
messages posted before this with more information about the failure.
It is also important to note that I did also try to use a Derived Column transformation before the Data Conversion transformation as well to cast as DATETIMEOFFSET(7) to match that of SQL Server destination and received errors there as well similar to above.
Been fighting this for a while now and any extra eyes will help.
Thanks.
ssis cannot do the conversion if there are T and Z letters in the field. Use the REPLACE command to replace the letter T with space and the letter Z without characters. Like This : (DT_DBTIMESTAMPOFFSET,7)REPLACE(REPLACE(createdAt,"T"," "),"Z","")

Unable to migrate Varbinary datatype using Nifi - PutDatabaseRecord Processor

Using PutDatabaseRecord processor i trying to migrate the varbinary datatype to another destination. Inside i tried avro reader using "Use Embedded Avro schema". While migrating, processor showing error as "THE CONVERSION FROM UNKNOWN TO ARRAY IS UNSUPPORTED".
Please provide solution for above issue. Thanks in advance
Error log:
17:04:34 ISTERROR5e288c7d-24fc-3619-7c08-e964a2113c7c
PutDatabaseRecord[id=5e288c7d-24fc-3619-7c08-e964a2113c7c] Failed to process session due to Failed to process StandardFlowFileRecord[uuid=bd2a3c28-d19b-466d-a8cd-1a397a1ebb6d,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1608723136100-388, container=default, section=388], offset=6847, length=45776044],offset=0,name=a241d7c9-7098-4161-bb77-bf205ef5bc2c,size=45775924] due to com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN to ARRAY is unsupported.: org.apache.nifi.processor.exception.ProcessException: Failed to process StandardFlowFileRecord[uuid=bd2a3c28-d19b-466d-a8cd-1a397a1ebb6d,claim=StandardContentClaim [resourceClaim=StandardResourceClaim[id=1608723136100-388, container=default, section=388], offset=6847, length=45776044],offset=0,name=a241d7c9-7098-4161-bb77-bf205ef5bc2c,size=45775924] due to com.microsoft.sqlserver.jdbc.SQLServerException: The conversion from UNKNOWN to ARRAY is unsupported.
Error log

SSIS - Derived Column

I am having an issue with using the Derived Column Transformation Editor and was wondering if anyone on here could help me out.
I have a column called WorkitemNumber that holds information like INC0000001234
I want to change the WorkitemNumber to a more unique number to prevent overlapping entries in between months. So I came up with this...
I have a Derived Column:
Derived Column Name: ConvertID
Derived Column: <add as new column>
Expression: REPLACE(WorkitemNumber,"INC","") + "913"
Data Type: Unicode string [DT_WSTR]
Length: 258
The expression above changes INC0000001234 to 0000001234913. What I would like to do is cut out all of the extra 0s, but I want to refrain from using LTRIM because it will break once the incident report numbers go to the next set of thousands.
I am pretty new with using SSIS and it would be really helpful if someone would be able to tell me how I would go about getting rid of the extra 0s on the end regardless of the amount of 0s in front of the incident number.
I would want the final output to be 1234913 recardless if the incident number was INC0000001234 or INC001234.
EDIT
I was able to drop the 0s but I am getting the following error and the information is not being written into my other tables...
[SQL03 [459]] Error: SSIS Error Code DTS_E_OLEDBERROR.
An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0"
Hresult: 0x80004005 Description: "Invalid character value for cast specification".
[SQL03 [459]]
Error: There was an error with input column "ConvertIncidentID" (1015)
on input "OLE DB Destination Input" (472).
The column status returned was: "Conversion failed because the data value
overflowed the specified type.".
[SQL03 [459]]
Error: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR.
The "input "OLE DB Destination Input" (472)"
failed because error code 0xC020907A occurred, and the error row disposition on
"input "OLE DB Destination Input" (472)"
specifies failure on error. An error occurred on the specified object of the
specified component. There may be error messages posted before this with more
information about the failure.
[SSIS.Pipeline] Error: SSIS Error Code DTS_E_PROCESSINPUTFAILED.
The ProcessInput method on component "SQL03" (459)
failed with error code 0xC0209029 while processing input "OLE DB Destination Input"
(472). The identified component returned an error from the ProcessInput method.
The error is specific to the component, but the error is fatal and will cause the
Data Flow task to stop running. There may be error messages posted before this with
more information about the failure.
If you're trying to strip the leading zeros, I would go with this approach
This expression removes the INC from your string
REPLACE(WorkitemNumber,"INC","")
Once INC is removed, you can cast to a numeric type to drop the leading zeros and then back to a string to allow you to do concatenation or whatever else you may need to do
(DT_WSTR,10)((DT_I8)REPLACE(WorkitemNumber,"INC",""))
Personally, I find it more user friendly to chain Derived Columns together so that if it breaks, I can spot the error more easily than something like the above. In your case, I used the original replace to generate a column and then use
(DT_WSTR,10)((DT_I8)WorkItemNoINC)
in my second Derived column
Edit
Taking another bite at the apple
OLE_SRC Query
I have defined the following source query
SELECT
'INC0000001234' AS WorkitemNumber
, CAST(MONTH(D.foo) AS varchar(2)) + RIGHT('0' + CAST(DAY(D.foo) AS varchar(2)), 2) AS fudge
FROM
(
-- Generate a year's worth of dates
SELECT
DATEADD(d, NUMS.n, '2012-12-31') AS SourceDate
FROM
(
SELECT TOP 366 ROW_NUMBER() OVER (ORDER BY (SELECT NULL)) AS n
FROM sys.all_columns AS SC
) NUMS
) D(foo);
This query generates 366 rows of data. A constant column named WorkItemNumber and one called fudge that will be all the possible month + day combinations. I left pad the number with a 0 so that a value of 121 is clearly January 21 and not December 1.
DER Drop INC
Here I create a new column called WorkItemNoINC and use the expression
REPLACE(WorkitemNumber,"INC","")
The result of this operation is that the text INC is removed from the source column and an empty string substituted in its stead.
DER WorkItemConcat
In this step, I concatenate the WorkItemNoINC column with our fudge value generated from the query. String + String yields string named WorkItemConcate (because I didn't proofread)
WorkItemNoINC + fudge
DER Strip leading zeros
In this operation, I will cast the value of WorkItemConcate to a bigint and back to string to strip the leading zeros.
(DT_WSTR,10)((DT_I8)WorkItemConcate)
Run
I added a data viewer after the last transformation and you can see that for all the possible values of day and month in a year, these expressions do not present a problem.
Making it fail
If I update my source query to use a NULL for WorkItemNumber, this package will not fail as you are experiencing.
If I change the casing in WorkItemNumber to inc, then I can generate this error.
Error: 0xC0049064 at DFT Whatevs, DER Strip leading zeros [18]: An error occurred while attempting to perform a type cast.
Error: 0xC0209029 at DFT Whatevs, DER Strip leading zeros [18]: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "DER Strip leading zeros" failed because error code 0xC0049064 occurred, and the error row disposition on "DER Strip leading zeros.Outputs[Derived Column Output].Columns[Derived Column 1]" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
Error: 0xC0047022 at DFT Whatevs, SSIS.Pipeline: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "DER Strip leading zeros" (18) failed with error code 0xC0209029 while processing input "Derived Column Input" (19). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.
Similar but not the same as you. I don't have a 2008 instance handy to test against but try breaking your operations out across multiple derived columns transformations and add data viewers as needed.

How is SqlException Number assigned

SqlException has the property Number.
Then there is this: http://msdn.microsoft.com/en-us/library/cc645603.aspx
and this: http://msdn.microsoft.com/en-us/library/windows/desktop/ms681382(v=vs.85).aspx
And it seems to be one or the other
QUESTION:
How is it decided which?
REASON FOR ASKING:
I need to catch certain SqlExceptions and decide how to deal with them based on the Number property but I don't know which list I should look at when it seems like the system is using messages from both, and I don't know what criteria is used for choosing.
For example:
Number 53 - from server error message list (exists on both)
Number 10054 - from system error message list (exists on both)
Number -1 - from server error message list (exists only on server list)
Number 121 - from system error message list (exists on both)
......
The theory goes that it's the SQL error number, eg. the server side ERROR_NUMBER(). In other words, the first list.
However there are a number of exceptions reported by SqlClient that occur on the client side, not on the server side. A typical example would be an error like failure to connect to the server, since you did not connect there is no server side error to speak of. For example a bad server name (does not resolve in DNS), in such cases the InnerException will point toward a Win32Exception with NativeErrorCode value of ERROR_BAD_NETPATH. In this case 53, the OS system error code, will be reported as SqlException error number.
Other cases the error reported by the SqlClient is a socket error, like an abrupt disconnect. Again, there is no 'server side' error to speak of, and the SqlException will wrap an InnerException of type SocketException (a subclass of Win32Error) with the NativeErrorCode of one of the well known WSA error numbers, like WSAECONNRESET. In this case the SqlException.ErrorNumber will be 10054, but it's the 10054 from the WSA range, not the 10054 from the SQL Server errors range. I know...
So what are you supposed to do? Make sure you check the InnerException, if it's a Win32Exception then the ErrorNumber is coming from a system error code (OS error). Otherwise it should be a SQL Server error number.
Oh, and then there is -1... I think that is reported by SqlClient itself (eg. some internal state errors) but I'm not sure.
I would look at the documentation for the SqlException.Number property.
This is what it says
This is a wrapper for the Number property of the first SqlError in the
Errors property. For more information on SQL Server engine errors, see
SQL Server Books Online.

How to determine faulty row/column in SSIS transformation

I'm running a DTSX package to move data from SQL to Postgres using the PGOLEDB Native Postgres driver and I'm receiving an error (below). How do I read this error and determine what row/column is causing the issue?
I'm receiving the following error (PGNP-SE-1.4.3076):
OnError,POSTGRESDEV,DOMAIN\USERNAME,Data Flow Task 9,{1EE44D97-78DD-4175-8162-2520654A750A},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071636471,0x,SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "PostgreSQL Native Provider" Hresult: 0x80004005 Description: "ERROR: invalid byte sequence for encoding "UTF8": 0x96
CONTEXT: COPY TransHist, line 390
".
OnError,POSTGRESDEV,DOMAIN\USERNAME,full_export_new,{79EBE819-217A-4AB2-BF58-45A6D6A3B4B8},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071636471,0x,SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "PostgreSQL Native Provider" Hresult: 0x80004005 Description: "ERROR: invalid byte sequence for encoding "UTF8": 0x96
CONTEXT: COPY TransHist, line 390
".
OnError,POSTGRESDEV,DOMAIN\USERNAME,Data Flow Task 9,{1EE44D97-78DD-4175-8162-2520654A750A},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071607767,0x,SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Destination Input" (95)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Destination Input" (95)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
OnError,POSTGRESDEV,DOMAIN\USERNAME,full_export_new,{79EBE819-217A-4AB2-BF58-45A6D6A3B4B8},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1071607767,0x,SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Destination Input" (95)" failed because error code 0xC020907B occurred, and the error row disposition on "input "Destination Input" (95)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
OnError,POSTGRESDEV,DOMAIN\USERNAME,Data Flow Task 9,{1EE44D97-78DD-4175-8162-2520654A750A},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1073450974,0x,SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination 40 - TransHist" (82) failed with error code 0xC0209029 while processing input "Destination Input" (95). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.
OnError,POSTGRESDEV,DOMAIN\USERNAME,full_export_new,{79EBE819-217A-4AB2-BF58-45A6D6A3B4B8},{F27E0BD1-8850-4497-BD9B-BDAFA7BDA401},10/4/2012 8:46:13 AM,10/4/2012 8:46:13 AM,-1073450974,0x,SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination 40 - TransHist" (82) failed with error code 0xC0209029 while processing input "Destination Input" (95). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.
UPDATE:
I think the encoding error is a red-herring. When I run this it fails on row 1000 (successfully writes 999 rows). If I change the source to a view that limits the results to less than 1000 rows (say 500) it succeeds (but obviously not all the data is moved). If I change the destinations connection string to BULK_INSERT=500...it will fail on row 500 and if I change the view to less than 500 it succeeds.
UPDATE 2:
Setting BULK_INSERT to 0 fixes the issue...I'm sure that has negative effects on performance though.
A quick way to determine which row(s) are responsible for the error is to error behavior from the default of "fail component" to "redirect rows" and then pipe the error output to a flat file.
For your particular error, the key message is:
"ERROR: invalid byte sequence for encoding "UTF8": 0x96
Google'ing this string brings back a few hits indicating a string encoding issue. Here's a link from the google-results back to stackoverflow.
You could try using a data conversion task to specify the correct encoding in the data flow task or you could make adjustments on the destination system (but I'm not really familiar with Postgres so can't help you there)

Resources