Skip to content

Next: ORA-01002: fetch out of sequence #212

Answered by tgulacsi
AndreFK asked this question in Q&A
Discussion options

You must be logged in to vote

What do you use tx for?
You have to use the same connection for the result and the WrapRows:

db, err := sql.Open("godror", connstr)
if err != nil {
	WriteLog("Connection Error: "+err.Error(), true)
	tx.Rollback()
	return contacts
}
tx, err := db.BeginTx(ctx, nil)
if err != nil {
	WriteLog("Connection Error: "+err.Error(), true)
	return contacts
}
defer tx.Rollback()

stmt, err := tx.PrepareContext(ctx, "begin QUALTRICS.qualtrics_data_pkg.fetch_email_survey_data(:1,:2,:3,:4); end;")
if err != nil {
	WriteLog("Statement Error: "+err.Error(), true)
	return contacts
}
defer stmt.Close()

brand, survey := TouchpointToBrandAndSurveyType(touchpoint)
WriteLog("Loading contacts from DB inserted on…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@AndreFK
Comment options

Answer selected by AndreFK
Comment options

You must be logged in to vote
2 replies
@AndreFK
Comment options

@tgulacsi
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants