informix dbimport throws 23103 - Code-set conversion function failed due to illegal sequence or invalid value - informix

When I try to import an informix database with command dbexport -c <mydbname> <myDbspace> that was already exported. I get this Error:
23103 - Code-set conversion function failed due to illegal sequence or invalid value.
I wonder if this is related to whether the text encoding I try to import is not compatible or something like that..
This is the full log:
{ TABLE "informix".XXX row size = 134 number of columns = 19 index size = 8 }
{ unload file name = XXX__00103.unl number of rows = 7 }
create table "informix".XXX
(
XXX_id char(3) not null ,
XXX_name char(50) not null ,
XXX_dec_nb decimal(1,0) not null ,
XXX_rounded decimal(4,3) not null ,
XXX_symbol char(3) not null ,
XXX_location decimal(1,0)
default 0 not null ,
XXX_negative decimal(2,0) not null ,
XXX_dec_char char(1) not null ,
XXX_group_char char(1) not null ,
XXX_euro decimal(16,8) not null ,
XXX_active decimal(1,0)
default 1 not null ,
XXX_coef decimal(7,3),
XXX_rnd_0 decimal(7,2) not null ,
XXX_rnd_1 decimal(7,2),
XXX_rnd_2 decimal(7,2),
XXX_rnd_3 decimal(7,2),
XXX_rnd_4 decimal(7,2),
XXX_rnd_5 decimal(7,2),
XXX_cts_desc char(20),
check (((XXX_active >= 0. ) AND (XXX_active <= 1. ) ) AND (XXX_active IN (0.
,1. )) ) constraint "informix".ckc_XXX_acti_XXX,
check (((XXX_location >= 0. ) AND (XXX_location <= 3. ) ) AND (XXX_location IN (0.
,1. ,2. ,3. )) ) constraint "informix".ckc_XXX_loca_XXX,
primary key (XXX_id) constraint "informix".pk_XXX
);
revoke all on "informix".XXX from "public" as "informix";
*** put loadXXX
23103 - Code-set conversion function failed due to illegal sequence or invalid value.
EDIT:
FIXED:
Changed my 'servername'.cmd file in C:\Program Files\IBM Informix Software Bundle by setting:
set CLIENT_LOCALE=EN_US.8859-1
set DB_LOCALE=EN_US.8859-1

FIXED:
Changed my 'servername'.cmd file in C:\Program Files\IBM Informix Software Bundle by setting:
set CLIENT_LOCALE=EN_US.8859-1
set DB_LOCALE=EN_US.8859-1

Related

Variable Assignment Issue for Multiple dynamic SQL in DB2 Iseries

We are using DB2 Iseries V7R3 on AS400 system.
In one of the stored procedure, we are preparing dynamic SQL queries. Each SQL query is assigned to different variables. When we execute the stored procedure sometimes it fails but when retry with same parameters it works.
Upon putting logs in the stored procedure, we have observed that during the failed cases value used for variable 2 is from variable 1.
Attached is the stored procedure and screenshot of the logs.
Appreciate any help on this, running out of the thinking options for this.
However, sometimes it uses select * for variable1 as well. After retry it works ok.
create stored procedure (
)DYNAMIC RESULT SETS 1
LANGUAGE SQL
SPECIFIC SYMDTA.PRC_RETRIEVE_CLAIM_LIST
NOT DETERMINISTIC
MODIFIES SQL DATA
CALLED ON NULL INPUT
COMMIT ON RETURN YES
CONCURRENT ACCESS RESOLUTION USE CURRENTLY COMMITTED
SET OPTION ALWBLK = *ALLREAD ,
ALWCPYDTA = *OPTIMIZE ,
COMMIT = *NONE ,
DECRESULT = (31, 31, 00) ,
DYNDFTCOL = *NO ,
DYNUSRPRF = *USER ,
SRTSEQ = *HEX
BEGIN
DECLARE DATACLAIM CLOB ( 1048576 ) DEFAULT ' ' ;
DECLARE GCLAIMCOUNT CLOB ( 1048576 ) DEFAULT ' ' ;
DECLARE CR_CLAIM_LIST_STMT CURSOR WITH HOLD FOR CLM_DATA_STMT ;
DECLARE CR_CLAIM_COUNT_STMT CURSOR WITH HOLD FOR CLM_COUNT_STMT ;
SET DATACLAIM = 'SELECT * FROM table ';
SET GCLAIMCOUNT = 'select count(*) from table';
INSERT INTO DEBUGGING_DYNAMIC_QUERIES VALUES ( POLICY_NO , DATACLAIM , CURRENT TIMESTAMP , 'DATACLAIM' ) ;
INSERT INTO DEBUGGING_DYNAMIC_QUERIES VALUES ( GCLAIMCOUNT , CURRENT TIMESTAMP , 'GCLAIMCOUNT' ) ;
PREPARE CLM_DATA_STMT FROM DATACLAIM ;
OPEN CR_CLAIM_LIST_STMT ;
PREPARE CLM_COUNT_STMT FROM GCLAIMCOUNT ;
OPEN CR_CLAIM_COUNT_STMT ;
FETCH CR_CLAIM_COUNT_STMT INTO TOTAL_RECORDS_G4 ;
CLOSE CR_CLAIM_COUNT_STMT ;
Output the debug table :-
Wrong :-
DATACLAIM = "select * " - 2020-01-01 11:00 AM
GCLAIMCOUNT = "Select * " - 2020-01-01 11:01 AM
After retry :-
DATACLAIM = "select * " - 2020-01-01 12:00 pm
GCLAIMCOUNT = "Select count(*) " - 2020-01-01 12:01 Pm

2620:Bad character error in stored procedure teradata

Concatenation is working in select statement:
SELECT 'HELLO' || 'WORLD';
is returning HELLOWORLD, but when I try to use it in stored procedure like below:
SET Time_of_Day=TRIM(Hour_of_Day) || ' : ' || TRIM(Minute_of_Hour) || ' : ' || TRIM(Second_of_Minute);
where Hour_of_Day,Minute_of_Hour,Second_of_Minute are variables, I also tried without TRIM:
ERROR:
**CALL FAILED 2620:PROCEDURE_NAME:THE FORMAT OR DATA CONTAINS A BAD CHARACTER**
Casting a string to a time in Teradata requires two-digit hour/minute/second:
SET Time_of_Day=TRIM(Hour_of_Day (FORMAT '99')) || ' : ' ||
TRIM(Minute_of_Hour (FORMAT '99')) || ' : ' ||
TRIM(Second_of_Minute (FORMAT '99'))
But this snippet is probably from the SP question you deleted an hour ago (a few seconds before I could post my answer).
There's no need for running 86400 single-row Inserts, simply create all data in a single Select, e.g.:
SELECT
Row_Number() Over (ORDER BY h,m,s),
Extract(SECOND From t) AS s,
Extract(MINUTE From t) AS m,
Extract(HOUR From t) AS h,
t
FROM
(
SELECT Cast(Begin(pd) AS TIME(0)) AS t
FROM sys_calendar.CALENDAR
WHERE calendar_date = Current_Date
EXPAND ON PERIOD(Cast(Current_Date AS TIMESTAMP(0)), Cast(Current_Date + 1 AS TIMESTAMP(0))) AS pd
) AS dt

OUTPUT variables to sp_executesql

Background: SQL Server 2008 R2
Having issues with the following. Been given a usp to "finish off", author is unavailable. It extracts data from source table, copies to target table of same name + datetime stamp in an archive db then truncates source table. Want to confirm that no errors have occurred & row counts are the same before I truncate source. As I'm using DDL a TRY CATCH combo won't work.
Following code works:
DECLARE #HostName VARCHAR(30) -- Name of server running script
DECLARE #dbName VARCHAR(30) -- Database currently connected to
DECLARE #LogText VARCHAR(255) -- Text to be logged to ArchLog table
DECLARE #NewUTMetaData VARCHAR(255) -- New tablename for UTMetaData
DECLARE #NewOutboundMessagePending VARCHAR(255) -- New tablename for OutboundMessagePending
DECLARE #NewOutboundMessageStatus VARCHAR(255) -- New tablename for OutboundMessageStatus
DECLARE #NewOutboundMessageResult VARCHAR(255) -- New tablename for OutboundMessageResult
DECLARE #NewFileMessageNonSequence VARCHAR(255) -- New tablename for FileMessageNonSequence
DECLARE #NewOutboundMessageRequest VARCHAR(255) -- New tablename for OutboundMessageRequest
DECLARE #NewOutboundMessage VARCHAR(255) -- New tablename for OutboundMessage
DECLARE #SQLQuery NVARCHAR(500)
DECLARE #return_value INT
DECLARE #Err INT = 0
DECLARE #ErrFin INT = 0
DECLARE #SQLCount NVARCHAR(255) = 'SELECT #TargetCountOUT = COUNT(*) FROM '
DECLARE #ParmDefinition nvarchar(50) = N'#TargetCountOUT int OUTPUT';;
DECLARE #SourceCount INT = 0
DECLARE #TargetCount INT = 0
-- Log message that delete is starting
SELECT #HostName = host_name()
SELECT #dbName = db_name()
SELECT #LogText = 'Procedure ArchiveMuleDBMetrix_NEW starting database= ' + #dbname + ' host= ' + #HostName
EXEC xp_logevent 50001, #LogText, 'INFORMATIONAL'
INSERT INTO [MuleDBArch].[dbo].[ArchLog]
([LogEntryDateTime]
,[LogEntry])
VALUES (GETDATE()
,#LogText)
BEGIN
SELECT #NewUTMetaData = (SELECT '[MuleDBArch].[dbo].UTMetaDataA' + convert(varchar(50),GetDate(),112) + replace(convert(varchar, GetDate(),108),':',''))
SET #err = ##error;
SET #SQLQuery = 'select * into ' + #NewUTMetaData + ' from [MuleDB].[dbo].[SASITUTMetaData]'
EXECUTE sp_executesql #SQLQuery
SET #SourceCount = ##ROWCOUNT
SELECT #LogText = 'Rows archived into ' + #NewUTMetaData + ' by Procedure ArchiveMuleDBMetrix_NEW = ' + CAST(#SourceCount as VARCHAR(6))
EXEC xp_logevent 50002, #LogText, 'INFORMATIONAL'
INSERT INTO [MuleDBArch].[dbo].[ArchLog]
([LogEntryDateTime]
,[LogEntry])
VALUES (GETDATE()
,#LogText)
IF #err = 0
BEGIN
SET #sqlcount = #sqlcount + #NewUTMetaData
EXECUTE sp_executesql #sqlcount, #ParmDefinition, #TargetCountOUT=#TargetCount OUTPUT;
IF #SourceCount = #TargetCount
TRUNCATE TABLE [MuleDB].[dbo].[SASITUTMetaData]
ELSE
SELECT #LogText = 'Post archive, row counts differ between [MuleDB].[dbo].[SASITUTMetaData] and' + #NewUTMetaData
EXEC xp_logevent 50003, #LogText, 'Error'
Set #errfin = 1
SET #err = 0
END
ELSE
BEGIN
SELECT #LogText = 'Procedure ArchiveMuleDBMetrix_NEW failed archiving into ' + #NewUTMetaData
EXEC xp_logevent 50004, #LogText, 'Error'
Set #errfin = 1
SET #err = 0
END
END
However, if I repeat the block to work on another table (or indeed the same one) query completes with error and I get the message:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.'.
I think I've narrowed it down to the line:
EXECUTE sp_executesql #sqlcount, #ParmDefinition, #TargetCountOUT=#TargetCount OUTPUT;
Any help appreciated
In the below code
EXECUTE sp_executesql #sqlcount, #ParmDefinition, #TargetCountOUT=#TargetCount OUTPUT;
You are trying to pass parameter values without specifying the parameter names except the output parameter while calling the stored procedure. Either specify the parameter name for all or none. Try to execute the code as follows
EXECUTE sp_executesql #sqlcount, #ParmDefinition, #TargetCount OUTPUT;

XText can not insert line before current quickfix point (XText version 2.9)

In my Xtext project I want to use quickfix to insert a new line before the current line for the missing cross-reference.But it gives following exception.
!ENTRY org.eclipse.core.jobs 4 2 2015-06-02 17:22:05.616
!MESSAGE An internal error occurred during: "Select and reveal referenced object".
!STACK 0
java.lang.IllegalArgumentException: The feature 'content' is not a valid feature
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eStructuralFeature(BasicEObjectImpl.java:733)
at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eObjectForURIFragmentSegment(BasicEObjectImpl.java:551)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:766)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject(ResourceImpl.java:742)
at org.eclipse.xtext.resource.XtextResource.access$1(XtextResource.java:1)
at org.eclipse.xtext.resource.XtextResource$1.getEObject(XtextResource.java:115)
at org.eclipse.xtext.resource.DefaultFragmentProvider.getEObject(DefaultFragmentProvider.java:28)
at org.eclipse.xtext.resource.XtextResource.basicGetEObject(XtextResource.java:346)
at org.eclipse.xtext.resource.XtextResource.getEObject(XtextResource.java:332)
at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:235)
at org.eclipse.xtext.ui.editor.LanguageSpecificURIEditorOpener.findEObjectByURI(LanguageSpecificURIEditorOpener.java:159)
at org.eclipse.xtext.ui.editor.LanguageSpecificURIEditorOpener$2.process(LanguageSpecificURIEditorOpener.java:125)
at org.eclipse.xtext.ui.editor.LanguageSpecificURIEditorOpener$2.process(LanguageSpecificURIEditorOpener.java:1)
at org.eclipse.xtext.util.concurrent.IUnitOfWork$Void.exec(IUnitOfWork.java:37)
at org.eclipse.xtext.resource.OutdatedStateManager.exec(OutdatedStateManager.java:121)
at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.internalReadOnly(XtextDocument.java:520)
at org.eclipse.xtext.ui.editor.model.XtextDocument$XtextDocumentLocker.readOnly(XtextDocument.java:492)
at org.eclipse.xtext.ui.editor.model.XtextDocument.readOnly(XtextDocument.java:133)
at org.eclipse.xtext.ui.editor.LanguageSpecificURIEditorOpener.selectAndReveal(LanguageSpecificURIEditorOpener.java:121)
at org.eclipse.xtext.ui.editor.LanguageSpecificURIEditorOpener$1.run(LanguageSpecificURIEditorOpener.java:88)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
My Code is very simple liking this:
acceptor.accept(issue, "Create label", "Create a new jump label", null) [ element, context |
if (element instanceof ContinueCommand) {
var lineNum = issue.lineNumber
var doc = context.xtextDocument
// If use doc.getLineOffset(lineNum). It works and inserts newline after current line.
var offset = doc.getLineOffset(lineNum-1)
var id = doc.get(issue.offset, issue.length)
var toInsert = "!" + id + " : comment\n"
doc.replace(offset, 0, toInsert)
}
]
I tried it in other quickfix methods (not for cross-references). It works good. I use xtext version 2.9.
Has anybody the same problem?

ZF2 retrieve out parameter from SP call

I have created a stored procedure with following declaration:
DELIMITER $$
DROP PROCEDURE IF EXISTS my_test$$
CREATE PROCEDURE my_test(input_number INT, OUT out_number text)
BEGIN
IF (input_number = 0) THEN
SET out_number='Errorrrr';
ELSE
SET out_number='Testing';
END IF;
END$$
DELIMITER ;
Following is my ZF2 code to call this SP:
$spResponse = 0;
$prepareStmt = $this->dbGateway->createStatement ();
$prepareStmt->prepare ( 'CALL my_test(?,?)' );
$prepareStmt->getResource ()->bindParam ( 1, $spRequest );
$prepareStmt->getResource ()->bindParam ( 2, $spResponse, \PDO::PARAM_STR, 2 );
$resultSet = $prepareStmt->execute ();
This code gives me following error:
Syntax error or access violation: 1414 OUT or INOUT argument 2 for routine zf2.my_test is not a variable or NEW pseudo-variable in BEFORE trigger
Can somebody advice where the issue is? Also, How can i retrieve value of "OUT" parameter.
Appreciate your response and help.
This low level code retrieves the base PDO connection object. This way you can work the results in PHP fashion

Resources