SQL CONNECT  (SQLCON)

 

Standard Verb     SQL File Access Operation

 

Lets you connect or disconnect Pragma 6 to a PostgreSQL database.

Depending on the parameters you can display the dialog box or not.

 

 

Format: 

SQL CONNECT connect TRUE or FALSE show dialog TRUE or FALSE connect script CONNECT SCRIPT

TRUE or FALSE  in the first parameter tells Pragma whether you want to connect or disconnect to PostgreSQL.  TRUE will connect you, FALSE disconnect you.
If this parameter is FALSE, you cannot show the dialog box.

TRUE or FALSE  in the second parameter tells Pragma whether you want to display or not the connect dialog box.  TRUE will show, FALSE not show the dialog.

CONNECT SCRIPT is an expression or a noun containing the script that will be used to connect to PostgreSQL.  If show the dialog box is TRUE, the connect script is not used.

 

Example:

COPY 

SQL CONNECT connect TRUE show dialog TRUE connect script CONNECT SCRIPT
 
After every SQL CONNECT you must look at the FILE STATUS or EXTERNAL ECHO, just like you would after a SQL GET to see whether you are connected or not. 

 

Target Noun:

EXTERNAL ECHO (XE), FILE STATUS (FST)

 

Discussion:

The connection stays open until you close it or exit Pragma 6.

You usually do not have to necessarily use this verb, since every verb that uses SQL at the beginning checks if a connection has been established, and if not it will automatically display the connect dialog.

This verb is useful if  you want to isolate the Pragma 6 user from having to  connect or if you want to connect to a different database without leaving Pragma.

Once you are connected with the dialog box, the dialog displays the connect script used and for your information a list of all the available tables in the database.  When connecting with the dialog box, the connect script is remembered by Pragma 6.

 

Technical:

SQLCON standard # 425, verb #362, msg # 779, 780, 781

 

2006-01-18
vb_sql_op.gif, t_p6.jpg
sqlcon.htm