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

Error : Unable to transcode Buffer #114

Open
Leti opened this issue Feb 26, 2019 · 6 comments
Open

Error : Unable to transcode Buffer #114

Leti opened this issue Feb 26, 2019 · 6 comments

Comments

@Leti
Copy link

Leti commented Feb 26, 2019

Hello,
I am trying to get all columns of a table.
I did this query :

connexion2
            .query('SELECT top 1 * FROM '+tableName)
            .then(data => {
                
               for(var key in data[0])
                    {
                            console.log(key);
                    }
                
            })
        .catch(error => {
            console.error(error);
        });   

But I get this error :

Uncaught Error: Unable to transcode Buffer [U_INVALID_CHAR_FOUND] at spawn.js :124

I found that it occurs only when I have a Ole object in my table (it works fine with other tables)
I don't want to get the image, I just need the column name. How can I achieve that?

Thank you very much.

@nuintun
Copy link
Owner

nuintun commented Feb 27, 2019

node version ?

@Leti
Copy link
Author

Leti commented Feb 27, 2019

It's v10.15.0

@nuintun
Copy link
Owner

nuintun commented Feb 27, 2019

Check you data does it contain U_INVALID_CHAR, this error cause by buffer.transcode

@Leti
Copy link
Author

Leti commented Mar 12, 2019

My data is an image, it's a binary data, so I think that is why it can't be read.

In fact I don't need to get that data, I just need the names of the columns, and my way was to select the first row of the table. Do you know any better way to get the columns names?

Thank you very much for your help.

@aaronbean
Copy link

I'm having this same issue in retrieving a field with BLOB data. I receive this error:

Error: Unable to transcode Buffer [U_INVALID_CHAR_FOUND] at transcode (internal/buffer.js:27:15) at ChildProcess.child.on.exitCode (F:\fst\lxr-converter\node_modules\node-adodb\lib\spawn.js:124:22) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:915:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

I'm running Node v8.15.0.

In my case, I really do need this data, as I'm exporting it into another database. Any suggestions? Thanks!

@Leti
Copy link
Author

Leti commented May 9, 2019

Hello
For my problem I solved it using .schema(4) instead of query which retrieves the columns names.
I'm so sorry aaronbean because I don't have a solution for this problem. Good Luck...

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

No branches or pull requests

3 participants