SQL GET PARAMETERS (SQLGTP) |
||
Standard Verb SQL Access Operation |
||
Gets various parameters of a query or SQL table.
Gets a name of a column (header) in a table after doing an SQL query. These names can also be obtained formated in various ways (in the future), together with some additional data like the number of rows and columns fetched with the query.
SQL GET Parameters row ROW colum COLUMN sql query SQL QUERY result to noun NOUN
ROW is a number or a noun containing the row number of the information you want to retrieve.
COLUMN is a number or a noun containing the column number of the information you want to retrieve.
SQL QUERY is an expression or a noun containing the SQL query that fetches the table with all the fields in the rows and columns.
NOUN is a noun that will have the name or other information of the requested column. Be aware that the name or information will always be an expression, even when a number is returned.
To get the name of the third column in the "address" table you write the following statement
SQL GET Parameters row 1 colum 3 sql query "SELECT * addresses" result to noun NOUN
NOUN will contain, for instance " street" or whatever the header of column 3 is called.
All the rows and columns fetched by the query will be accessible with this verb, plus some extra bonuses.
| After every SQL GET PARAMETERS you must look at the FILE STATUS or EXTERNAL ECHO, just like you would after a GET of a Pragma file to see whether you have the right answer or not. |
EXTERNAL ECHO (XE), FILE STATUS (FST)
Each row number will contain a different kind information.
| Row 1 | ||
| Column 1 | Name of SQL column number 1 as in PostgreSQL | |
| Column 2 | Name of SQL column number 2 as in PostgreSQL | |
| Column X | Name of SQL column number X as in PostgreSQL |
These are the names exactly as they are in the PostgreSQL as you requested. Since you did the PostgreSQL query you should know (but have forgotten) what they mean.
Here we have a potential incompatibility between POstgreSQL and Pragma 6. If a column name has an underline, Pragma will not like it, since an underline is part of a control character for Pragma.
In the future other rows will display the length and property of the columns.
| Row 10 | ||
| Column 1 | Number of rows fetched | |
| Column 2 | Number of columns fetched | |
| Column 3 | Time in milliseconds for the SQL fetch | |
These are the vital statistics of the result of your query. With this data in hand (or rather in memory) you can plan for instance the List Control that will display all the rows.
The milliseconds for the SQL fetch will tell you how good or complex your search was and that it is maybe time to find a better query.
If you try to access a different row than shown above you will get a FILE STATUS 1, 'record not found' .
The form FORM SQL ADDRESSES DS 1 of the Pragma 6 tutorial vocab shows how to display a table row with the verb SQL GET FIELD and also uses the verb SQL GET PARAMETERS.
SQL GET FIELD, SQL SELECT
SQLGTP standard # 430 , verb # 367 , msg # 775, 776, 777, 778