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

I am geting BLOB fields with extra content #269

Open
amichelins opened this issue Jan 17, 2020 · 1 comment
Open

I am geting BLOB fields with extra content #269

amichelins opened this issue Jan 17, 2020 · 1 comment

Comments

@amichelins
Copy link

I have to read a BLOB oracle field and send the data to a WS
My code work, is reading the data, but data readed has extra content.

[CODE]

import "gopkg.in/rana/ora.v3"

...
...
...
sSql = SELECT SP.XML_SIG FROM INFOAR.SPED050 SP WHERE SP.ID_ENT = '000003' AND SP.STATUS = 6 AND SP.NFE_ID = '3 000770601'

stmt, _ := ses.Prep(sSql, ora.OraBin)

defer stmt.Close()
rset, err := stmt.Qry()

if err != nil {
	panic(err)
}
for rset.Next() {
	println(fmt.Sprintf("%s ", rset.Row[0]))
}

[/CODE]

Data returned:

{%!s(bool=false) <infNFe Id="NFe322001085841160
........ ( is a long XML file
ate> }

Correct format:
<infNFe Id="NFe322001085841160
........ ( is a long XML file
ate>

How to trim this extra caracters?

@amichelins
Copy link
Author

Solved
change this line:
stmt, _ := ses.Prep(sSql, ora.OraBin)

To this:
stmt, _ := ses.Prep(sSql, ora.Bin)

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

1 participant