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

Oracle DB Suffix #309

Open
Boris-Levsky opened this issue Feb 28, 2022 · 0 comments
Open

Oracle DB Suffix #309

Boris-Levsky opened this issue Feb 28, 2022 · 0 comments

Comments

@Boris-Levsky
Copy link

Hello, I got databases from Oracle, and I need help on how to correctly compose an Insert query
My Code:
query := sq.Insert("N_ACCOUNTS").
Columns("ACCOUNT_ID", "ACC", "MODIFIED_DATE",
"CREATION_DATE", "LOCKED_FLAG", "NEED_REPLICATION").
Values(account.AccountId, account.Acc, account.ModifiedDate,
account.CreationDate, account.LockedFlag, account.NeedReplication).
PlaceholderFormat(sq.Colon).
Suffix("RETURNING ID INTO :ACCOUNT_ID").
RunWith(runner)
fmt.Println(query.ToSql())
err := query.QueryRow().Scan(&account.AccountId)
if err != nil {
return errors.Wrap(err, "repo.Add")
}
return nil

I got different errors, first the lack of the required keyword, and then the number of arguments exceeded the one found

@Boris-Levsky Boris-Levsky changed the title Oraclde DB Suffix Oracle DB Suffix Feb 28, 2022
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