Last active
August 29, 2015 14:11
-
-
Save phpdave/4fff31d51dd34f6e8201 to your computer and use it in GitHub Desktop.
Ideas for Code Completion of SQL for Netbeans IDE
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
s SELECT * FROM ${Table} | |
u UPDATE ${Table} SET ${columnValue} WHERE ${WhereClause} | |
d DELETE FROM ${Table} WHERE ${WhereClause} | |
i INSERT INTO ${Table} ${columns} VALUES (${values}); | |
g GRANT ${Permissions} ON ${DbObject} ${ObjectName} TO ${User} | |
cr CREATE TABLE ${Table} ( | |
${column1} ${type} ${NULLorNOTNULL} | |
PRIMARY KEY (${PrimaryKeyColumn}) ); | |
m MERGE INTO ${Target_Table} AS TARGET_TABLE | |
USING ${Source_Table} AS SOURCE_TABLE | |
ON (TARGET_TABLE.${Target_Table_Field}=SOURCE_TABLE.${Source_Table_Field} ) | |
WHEN MATCHED THEN | |
UPDATE SET | |
TARGET_TABLE.${Field_To_Update} = SOURCE_TABLE.${Field_To_Update} | |
WHEN NOT MATCHED THEN | |
INSERT (${Field_To_Insert}) | |
VALUES(SOURCE_TABLE.${Field_To_Insert} ) | |
ELSE IGNORE; | |
crp | |
CREATE OR REPLACE PROCEDURE ${ProcedureName} ( | |
${Param1} ${Param1DataType} | |
) | |
${ProcedureOptions} | |
P1: BEGIN | |
${ProcedureStartsHere} | |
END P1; | |
COMMENT ON SPECIFIC PROCEDURE ${ProcedureName} | |
IS '${Description_of_Procedure}' ; | |
GRANT ${Permissions} ON PROCEDURE ${ProcedureName} TO ${User} ; | |
dcsr | |
DECLARE ${Cursor_Name} CURSOR FOR | |
SELECT ${columns} FROM ${table}; | |
if | |
IF (${condition}) THEN | |
${SQLstatements}; | |
END IF; | |
ifelse | |
IF (${condition}) THEN | |
${SQLstatements}; | |
ELSE | |
${SQLstatements}; | |
END IF; | |
icpy | |
INSERT INTO ${Destination_Table}) ( | |
SELECT * FROM ${Source_Table}); | |
dec | |
DECLARE ${VariableName} ${VariableDataType}; | |
set | |
SET ${VariableName} = ${Value}; | |
call | |
CALL ${ProcedureName} ( ${Params} ) ; | |
open | |
OPEN ${Cursor_Name} ; | |
FETCH ${Cursor_Name} INTO ${declared_variables_list)}; | |
WHILE ${Condition} DO | |
${SQLStatements} | |
FETCH ${Cursor_Name} INTO ${declared_variables_list)}; | |
END WHILE; | |
CLOSE ${Cursor_Name}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment