This file contains hidden or 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
| //WIRING A FUNCITON TO A UI ELEMENT : | |
| //• Conceptually | |
| // A. User Input to Trigger to Function Execution | |
| // B. Function Execution | |
| // C. Output | |
| <!DOCTYPE html> | |
| <html> |
This file contains hidden or 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
| -- e.g., on a charge status table. | |
| -- There mighte be a more effective bespoke way to do this in SSMS, as explicitly naming the | |
| -- datatypes could be risky. Right clicking 'New Table' in SSMS perhaps... | |
| -- the following creates a table 'charge_status' | |
| -- columns arranged are charge_status_id cc_processor_invoice_id and success | |
| -- charge_status_it is designated as the primary key. | |
| -- it is a CLUSTERED index. | |
This file contains hidden or 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
| -- Add entries to the Camera table if you want it reflected in the dashboard. You will need the modem_id associated with each sn/meid combination | |
| SET IDENTITY_INSERT camera ON | |
| INSERT INTO camera (camera_id, camera_type_id, modem_id, user_id) | |
| --VALUES (45, 1, 196, 23) | |
| VALUES | |
| (46, 1, 197, 23), | |
| (47, 1, 198, 23), | |
| (48, 1, 199, 23), | |
| (49, 1, 200, 23), | |
| (50, 1, 201, 23) |
This file contains hidden or 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
| ===HTML|program.html=== | |
| <html> | |
| <body> | |
| <pre> | |
| <script src="program.js"> | |
| </script> | |
| </pre> | |
| </body> | |
| </html> |
This file contains hidden or 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
| --A LEFT join example. | |
| -- Join two aliased table on two keys they share in common | |
| -- Further filtering via 'and' commands. | |
| --1. | |
| select * from modem m | |
| left join camera c | |
| on m.modem_id = c.modem_id | |
| left join camera_value cv | |
| on c.camera_id = cv.camera_id |
This file contains hidden or 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
| --e.g. | |
| SELECT * FROM audit_log_type | |
| SET IDENTITY_INSERT audit_log_type ON | |
| INSERT INTO audit_log_type | |
| (audit_type, description) | |
| VALUES (12, 'Cancel Subscription') | |
| SET IDENTITY_INSERT audit_log_type OFF |
This file contains hidden or 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
| --Can do this the long way with OR | |
| SELECT * FROM apples | |
| WHERE appleID = '5544' OR appleID = '5978'OR appleID = '1586' OR appleID = '4592' | |
| --more efficient, using the IN keyword. | |
| select * from modem where sn in ('1234', '4564', '4568', '1239') |
This file contains hidden or 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
| SELECT * FROM user_notification | |
| insert into user_notification | |
| (user_id, notification_type_id, subject, body, user_deletable, created_on, expires_on, read_on, deleted_by_system, deleted_on) | |
| values | |
| (1, 1, 'subjectQA2', 'bodyQA2', 1, DATEADD(MINUTE, -10, GETDATE()), DATEADD(DAY, 180, GETDATE()), null, 0, null) | |
This file contains hidden or 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
| //linqpad as C# Program... | |
| //using System; | |
| //using System.Collections.Generic; | |
| //For finding one quick element... | |
| class Program | |
| { | |
| static void Main() | |
| { |
This file contains hidden or 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
| //using System; | |
| //using System.Collections.Generic | |
| //derived from http://www.dotnetperls.com/anonymous-function | |
| //ON section 'Anonymous Functions' | |
| /* | |
| KEY POINTS | |
| The FindAll method used here in the anonyMethod syntax allows for filtering | |
| of a list. This would be handy in the future if you have a list data type, | |
| and you want to filter, based on MULTIPLE CONDITIONS. |