You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
The text was updated successfully, but these errors were encountered: