This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sql%rowcount | |
dbms_output.put_line('Number of lines affected by previous DML operation:'||sql%rowcount); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://oracle-base.com/articles/9i/merge-statement | |
MERGE INTO employees e | |
USING hr_records h | |
ON (e.id = h.emp_id) | |
WHEN MATCHED THEN | |
UPDATE SET e.address = h.address | |
WHEN NOT MATCHED THEN | |
INSERT (id, address) | |
VALUES (h.emp_id, h.address); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove the installed package for each user "Disable Widgets in Windows 11 Completely" | |
Get-AppxPackage -AllUsers | Where-Object {$_.Name -like "*WebExperience*"} | Remove-AppxPackage -AllUsers -ErrorAction SilentlyContinue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$LASTEXITCODE. It will always be the exit code of the last program you ran in the current session. | |
$LastExitCode is the return code of native applications. $? just returns True or False depending on whether the last command (cmdlet or native) exited without error or not. | |
PowerShell writes its messages to different streams that can be redirected to files for capturing the respective output. | |
Stream 1 (default): regular output ("STDOUT") | |
Stream 2: error messages ("STDERR"), including error messages from external programs | |
Stream 3: warning messages | |
Stream 4: verbose messages | |
Stream 5: debug messages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
COMMENT ON TABLE,VIEW,SNAPSHOT shipping.notes IS 'Special packing or shipping instructions'; | |
COMMENT ON COLUMN shipping.notes IS 'Special packing or shipping instructions'; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python -m venv .venv | |
.\.venv\Scripts\activate | |
python -m pip install --upgrade pip | |
deactivate | |
python -m pip install -r requirements.txt | |
python -m pip freeze | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Deep copy | |
CREATE OR REPLACE TABLE table1_deep_copy AS SELECT * FROM table1; | |
-- Shallow copy | |
CREATE OR REPLACE TABLE table1_shallow_copy LIKE table1; | |
-- Temporary - for current session. Cannot be cloned. | |
CREATE TEMPORARY TABLE cust_temp AS SELECT * FROM customers; | |
-- Transient - multisession, does not use fail-safe storage. | |
CREATE TRANSIENT TABLE cust_temp AS SELECT * FROM customers; | |
-- Clone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# powershell | |
git config --list --show-origin | |
## | |
## https://stackoverflow.com/questions/7335420/global-git-ignore | |
## | |
# ignore dirs/files in all user's local git repositories | |
git config --global core.excludesFile "$Env:USERPROFILE\.gitignore" | |
#review the setting | |
git config --global core.excludesFile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Old powershell version call from command task in infa | |
powershell -executionpolicy bypass -File "$PMRootDir\check_directory_access_infa.ps1" > "$PMRootDir\check_directory_access_infa.log" 2>&1 | |
-- PowerShell exit sample code | |
# some logic to set $hasError variable. | |
if ($hasError) { | |
Write-Host has errors | |
exit 1 | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: Empty file | |
copy /y NUL EmptyFile.txt >NUL | |
:: Error handling | |
somecommand > log.txt 2>&1 | someothercommand | |
somecommand 2>&1 | someothercommand | |
:: Check if file exists | |
if exist \\somefile.txt ( | |
echo file exists |
NewerOlder