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

2.8.8 drop JSON support? ORA-40569: Unimplemented JSON feature. #540

Closed
viplifes opened this issue Apr 11, 2024 · 5 comments
Closed

2.8.8 drop JSON support? ORA-40569: Unimplemented JSON feature. #540

viplifes opened this issue Apr 11, 2024 · 5 comments
Labels

Comments

@viplifes
Copy link

Version 2.8.7 work fine!

Versions 2.8.8 - 2.8.11 have error: ORA-40569: Unimplemented JSON feature.

package main

import (
	"database/sql"
	"fmt"

	go_ora "github.com/sijms/go-ora/v2"
)

func main() {

	connOra, err := sql.Open("oracle", go_ora.BuildUrl("127.0.0.1", 1521, "ORCLPDB1", "SYS", "dbpaSS1#", nil))
	if err != nil {
		panic(err)
	}
	defer connOra.Close()
	run(connOra)
	// print
	// OCIBlobLocator OCIBlobLocator
}

func run(conn *sql.DB) {
	conn.Exec(`GRANT CREATE SESSION TO SYS`)
	conn.Exec(`DROP TABLE IF EXISTS types_test`)
	conn.Exec(`CREATE TABLE types_test (myblob BLOB NULL, myjson JSON NULL)`)
	conn.Exec(`INSERT INTO types_test (myblob, myjson)VALUES(UTL_RAW.CAST_TO_RAW('blobval - not json'), json('{"foo": "bar"}'))`)

	rows, err := conn.Query(`SELECT * FROM types_test`)
	if err != nil {
		panic(err)
	}
	cTypes, _ := rows.ColumnTypes()
	fmt.Println(cTypes[0].DatabaseTypeName(), cTypes[1].DatabaseTypeName())
}
@sijms
Copy link
Owner

sijms commented Apr 15, 2024

HI @viplifes
I run the code with multiple version of go-ora (latest, v2.8.7, 2.7.21) and all failed at this stmt:

INSERT INTO types_test (myblob, myjson)VALUES(UTL_RAW.CAST_TO_RAW('blobval - not json'), json('{"foo": "bar"}'))

with this error

ORA-40445: unsupported JSON operation

to confirm I run same statement on SQL Developer and get same error
my database version is 19c

@sijms
Copy link
Owner

sijms commented Apr 15, 2024

when I change the insert statement and remove json keywords everything is ok

INSERT INTO types_test (myblob, myjson)VALUES(UTL_RAW.CAST_TO_RAW('blobval - not json'), '{"foo": "bar"}'); 

@viplifes
Copy link
Author

I use docker image hub.docker.com/gvenzl/oracle-free:23-slim

https://hub.docker.com/r/gvenzl/oracle-free

@sijms
Copy link
Owner

sijms commented Apr 15, 2024

fixed in next release

@sijms sijms added the fixed label Apr 15, 2024
@sijms
Copy link
Owner

sijms commented Apr 23, 2024

fixed v2.8.13

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

No branches or pull requests

2 participants