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

How to set a field to NULL using the Redshift Data API? #2621

Closed
JoseAngel1196 opened this issue Apr 26, 2024 · 2 comments
Closed

How to set a field to NULL using the Redshift Data API? #2621

JoseAngel1196 opened this issue Apr 26, 2024 · 2 comments
Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.

Comments

@JoseAngel1196
Copy link

Describe the issue

AWS indicates that you cannot set a value to NULL nor can you set a zero-length value. Is there a way to handle this using the Redshift Data API?

My code:

if value == "" {
				paramValue = "null"
			} else {
				paramValue = fmt.Sprintf("%v", value)
			}
			parameters = append(parameters, types.SqlParameter{
				Name:  aws.String(paramName),
				Value: aws.String(paramValue),
			})

As you can see, if the value is empty, we're using a literal string 'null' and would prefer to store it as NULL. How can I achieve this?

Links

https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html

AWS Go SDK V2 Module Versions Used

No response

@JoseAngel1196 JoseAngel1196 added documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged. labels Apr 26, 2024
@lucix-aws
Copy link
Contributor

#2619

Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation This is a problem with documentation. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants