Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data incorrectly loaded from external table [CORE4151] #4478

Closed
firebird-automations opened this issue Jul 31, 2013 · 10 comments
Closed

Data incorrectly loaded from external table [CORE4151] #4478

firebird-automations opened this issue Jul 31, 2013 · 10 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: Stefano Fraccaro (druido77)

Attachments:
fbext.zip
db_extfiles.zip

Create an external file name C:\file.txt with many lines like:
AAABBBCCCDDD\r\n
AAABBBCCCDDD\r\n
...

Create an external table in Firebird defined as:
F1 CHAR(3)
F2 CHAR(3)
F3 CHAR(3)
F4 CHAR(3)
NL CHAR(2)

Show table content:
AAA A DD CDD CC
AAA A DD CDD CC
...

expected:
AAA BBB CCC DDD \r\n

@firebird-automations
Copy link
Collaborator Author

Commented by: Stefano Fraccaro (druido77)

external file used as test

@firebird-automations
Copy link
Collaborator Author

Modified by: Stefano Fraccaro (druido77)

Attachment: fbext.zip [ 12350 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Stefano Fraccaro (druido77)

database with external files. Text files should be copied to folder C:\.

@firebird-automations
Copy link
Collaborator Author

Modified by: Stefano Fraccaro (druido77)

Attachment: db_extfiles.zip [ 12351 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: Stefano Fraccaro (druido77)

From my test seems that the cause of the problem can be the definition of the charset (ASCII) after the creation of the fields.

Steps to have the expected result:
* create a new database with UTF8 charset
* create the new external table with ASCII charset for all fields
* the content of the table is as expected

Steps to reproduce the problem:
* create a new database with UTF8 charset
* create the new external table without specific charset (I think UTF8 is used)
* change the charset for all fields to ASCII
* the content of the table is wrong

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

How do you "change the charset for all fields to ASCII" ?

@firebird-automations
Copy link
Collaborator Author

Commented by: Stefano Fraccaro (druido77)

The software execute this instruction:

UPDATE RDB$FIELDS SET
RDB$CHARACTER_SET_ID = 2
WHERE RDB$FIELD_NAME = (SELECT rf.RDB$FIELD_SOURCE
FROM RDB$RELATION_FIELDS rf
WHERE (rf.RDB$FIELD_NAME = 'F1')
AND (rf.RDB$RELATION_NAME = 'NEW_TABLE'));

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

Updates to system tables are not supported. I think this ticket may be closed.

@firebird-automations
Copy link
Collaborator Author

Commented by: Sean Leyne (seanleyne)

As noted, direct updates of system tables are not supported. Please use the correct ALTER TABLE ... syntax to change column definitions.

@firebird-automations
Copy link
Collaborator Author

Modified by: Sean Leyne (seanleyne)

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant