December 3, 2005
The following new verbs from Pragma 6 can be used to access PostgreSQL from Pragma 6.
| SQL GET FIELD (SQLGTF) | |
| SQL GET (SQLGT) | |
| SQL SET (SQLSET) | |
| SQL GET PARAMETERS (SQLGTP) | |
| SQL CONNECT (SQLCON) |
Then I got the following mail "as soon as you do inserts, updates and deletes ..."
I would like to make it clear that there will be no other verbs to access SQL in detail, like a verb for INSERT or UPDATE.
Basically there are two kinds of queries that you can make to the SQL database:
A query expects data back. SELECT is one of those queries. However clever and or perverse you make your query, you will get back a bunch of rows, consisting of various columns. The new Pragma 6 verbs SQL GET FIELD (SQLGTF) and SQL GET (SQLGT) do just that. From SQL GET FIELD you can address each individual field that was returned by the SELECT query. SQL GET will throw all the data into a temporary (and I stress temporary) PFM file that you supply and defined as your heart wishes.
Should you need some more information about the data returned by your SELECT query, there is the verb SQL GET PARAMETERS (SQLGTP). This verbs returns the headers of the returned columns, the amount of columns a row has and the number of rows retrieved. And should you be curious about how efficient your query (or network) was, you can even look how long it took, in milliseconds. These returned parameters can be easily expanded, according to your needs.
INSERT, UPDATE and DELETE do not expect data back. At the most if there is a syntax or any other problem, PostgreSQL sends back an angry message (which to me at times do not make much sense, used to the precision of the c++ error messages).
SQL SET (SQLSET) sends any query that does not expect any data back to PostgreSQL. This gives you immediate, personal access to PostgreSQL. You still miss a verb that deals specifically with insert? Easy, you create it yourself by making a Pragma object verb. I am sure that you will create a better object verb for yourself than I could write a standard verb that had to please everybody and not constraint power users.
Do you agree or disagree?