#ColdFusion Queries
To interact with a database with CFML first you need to setup the data source in the administrator site.
####----TestTable-----
id | myDataAlfa | myDataInt |
---|
#ColdFusion Queries
To interact with a database with CFML first you need to setup the data source in the administrator site.
####----TestTable-----
id | myDataAlfa | myDataInt |
---|
#Working with XML in ColdFusion
Cheatsheet with code examples to read, create and search xml files
ColdFusion provides many built-in functions for doing all sort of XML based operations.
###Reading XML Document Read the document then passes it to the parser to create an XML object
<cffile action="read" file="#ExpandPath('./some.xml')#" variable="myXML" />
<cfset myDoc=XmlParse(myXML) />
#JavaScript Object Notation (JSON) and CFML
###Creating JSON object
As you probably guessed JSON objects can be created from cf structures
<cfset myStruct = {
items: {
item1: {name: 'item1', price: 1000},
item2: {name: 'item2', price: 12.50},
#Vim Basic Commands
###Modes
i
: change to insert mode to edit text
v
: change to visual mode to select text
Esc
: Normal mode to navigate through the text file
###Moves (Normal mode)
h
: move left | l
: move right
j
: move up | k
: move down
# SED = TEST SQL QUERIES SYNTAX | |
# ============================= | |
# Takes the table name and the WHERE clause to create a SELECT query with this values. | |
## UPDATE queries | |
sed 's|update\s\+\([A-Z0-9_]\+\).\+\(where\s\+.\+$\)|SELECT * FROM \1 \2|i' <text file with queries> | |
### example: UPDATE table_2 SET filed_1 = '123ab', field_2 = 123 WHERE field_3 = 'bla' and field_5 like '%lala' | |
### output example: SELECT * FROM table_2 WHERE field_3 = 'bla' and field_5 like '%lala' | |
## DELETE queries |