Paul's Programming Notes PostsRSSGithub

IFNULL - MySQL

IFNULL(`field1`, `field2`)

That returns field1 if it’s not null. However, it will return field2 if it is null.

Notes On JOIN - MySQL

  • If your INNER join is returning too few values and duplicates, you’re probably using the wrong kind of join. Try a LEFT join.
  • INNER JOIN is the same as JOIN
  • http://i.stack.imgur.com/GbJ7N.png (diagram explaining joins)
  • LEFT JOIN is used - this will return ALL rows from Table1, regardless of whether or not there is a matching row in Table2.

Indexes Help... A Lot

I just brought 4 queries from 15 seconds to less than 1 second by adding indexes to the columns in the ON() portion on the join.

Indexes help… A lot.

Easiest Way To Consume .Net Web Services - Python

The suds library is the easiest way I found to consume .NET SOAP web services from Python, with Python acting as the web service client. I first picked it up from Jan Sipke’s tutorial.

Here’s an example of my simple client:

from suds.client import Client
client = Client("http://xxx.xxx.xxx.xxx/API/Info.asmx?WSDL")
client.service.getInfo("05/12/2013", "05/12/2013")

New Vocabulary Word

CRUD

  • Create
  • Read
  • Update
  • Delete

An example of a CRUD application would be something that tracks orders in a database. All 4 actions are going to be necessary to track those orders. CRUD: The basic database operations.