Db2: Changes to setting of SQL_COMPAT global variable are not reflected - db2

When we change the SQL_COMPAT global variable to NPS, the result is not reflected. Why, what can we do?
The method we tried was
SET SQL_COMPAT = 'NPS'
After this, VALUES SQL_COMPAT was executed, but it remained NULL.
We obtained instructions from this URL:
https://www.ibm.com/support/knowledgecenter/ja/SS6NHC/com.ibm.swg.im.dashdb.sql.ref.doc/doc/globvar_sql_compat.html"

The global variable SQL_COMPAT was introduced in Db2 Version 11.1. You need to be on that level or higher. It is a session variable, so the change is only visible within the same session.
If you are connected to Db2, if you set SQL_COMPAT using
SET SQL_COMPAT='NPS'
and in the same (connected) session you execute
VALUES SQL_COMPAT
it should be visible.

Related

MongoDB Realm: environment value exists but is undefined inside Realm Function

I am referencing an environment value from a Realm function as instructed here: context.values.get("appTwilioNumber")
I confirmed appTwilioNumber exists in our project: and that our project is assigned an environment:
Yet, when I call console.log('twilioNumberForEnv:', context.values.get("appTwilioNumber")); in our Realm function, I get twilioNumberForEnv: undefined.
EDIT 1: I have more info now--I logged out and logged back in (in case of multi-user sync issues), then exported my app from the Realm UI and the values folder is empty. Not sure if that is a separate bug, but updating in case this info is useful.
EDIT 2: the environment values are stored under environment, not under values. Edit 1 was a red herring. I do see appTwilioNumber in the exported app, but it still returns undefined in the Realm functions.
Wow... Mongo's documentation might be off.
In another function, I found this: context.environment.values.anotherEnvValue instead of context.values.get("appTwilioNumber") . So I updated my code to context.environment.values.appTwilioNumber, and it worked.
I did a CMD-f on both https://docs.mongodb.com/realm/values-and-secrets/define-environment-values/ and https://docs.mongodb.com/realm/values-and-secrets/access-a-value/ for ".environment", and it isn't on either page.
I'll follow up with Mongo, but please use context.environment.values.YOURENVVALUE instead of context.values.get("YOURENVVALUE") if you encounter this issue.

How to trigger RegenerateUserEnvironment forcibly

I'm currently having trouble applying logon script(powershell) on windows servers.
The logon script has the line to set user environment variables but the variables don't look like being applying immediately from the result of set command on command prompts.
I've been looking at the behavior through process monitor while logging on to the new session.
And finally I have found the newly created variables need to be associated with RegenerateUserEnvironment function on shell32.dll.
I'm able to look at the correct result of set command after RegenerateUserEnvironment is called.
So I was wondering whether we had a way to trigger RegenerateUserEnvironment function and it needs to be executed on powershell.
Can you shed some light on this?
Best Regards,
Haewon

How to remove a VS Code user setting in settings.json

I'm creating a new version of an extension in which I have modified some of the configuration setting names from the previous version. Suppose in the old version, a setting has the name myextension.oldName and in the new version this becomes myextension.newName.
I'm adding migration code to detect if the user has a setting with myextension.oldName set and if so, then set myextension.newName to the old value. However, I also want to delete myextension.oldName from the user's settings (settings.json), but I can't find a way to do this. I attempted setting the value of the myextension.oldName to null but this doesn't modify the value. Is this possible?
Yes, if you set it to undefined, then it will be removed. Example:
vscode.workspace.getConfiguration().update('myExtension.mySetting', undefined, true);

How to prevent sensitive variable values from logging?

Using the action "Set a variable" for sensitive data like passwords or something else logs the values to the logfile. Is there a way to prevent this behavior for this kind of variables? We are using install4j version 6.0.4. I also tried to create a custom action but setting the variable with context.setVariable(...) has the same effect and produce a log entry like Variable changed: my.password=abc123[class java.lang.String]. We need to avoid this log entries.
You can call
context.registerHiddenVariable("variableName")
for those variables.
In 6.1, for pre-defined installer variables, the configuration panel has a "Sesitive information, do not write values to the log file" check box.

google-cloud-sql - max_allowed_packet

I was moving a database to using Google Cloud SQL which previously had a max_allowed_packet of 20M.
Currently the Google Cloud SQL default for max_allowed_packet is 1M.
Is there any way to increase this variable to 20M? I have already tried the following:
set global max_allowed_packet = 20971520;
Which returns:
Error Code: 1621. SESSION variable 'max_allowed_packet' is read-only. Use SET GLOBAL to assign the value
and then:
set global max_allowed_packet = 20971520;
This returns the error:
Error Code: 1227. Access denied; you need (at least one of) the SUPER privilege(s) for this operation
Thank you in advance for your help!
To change your max_allowed_packet on Google Cloud SQL, go to the overview of your instance on the cloud console, click on edit and look for the MySQL Flags section at the bottom of the page. max_allowed_packet is one of the flags you can set there. Set the value you want, and save/confirm.
You can now set it yourself by editing the instance in Developer Console.
All the settable flags are documented here: https://cloud.google.com/sql/docs/mysql-flags
In my case I couldn't update the max_allowed_packet setting because I had a flag of sql_mode=TRADITIONAL which expects the value to be a multiple of 1024.