SQL Query Developer Tools

Top  Previous  Next

Overview

 

 Advanced Users Only 

 

SQL Query applet makes several developer tools available.

 


 

Developer Tools

 

Dataset Info Tab

 

Located below the editor, the Dataset Info tab generates an alphabetical fields list based on the result columns. In that results are not listed alphabetically, this can be very useful in locating fields in a large result set.

 

Double-clicking the field in the fields list will jump to that field in the Results tab.

 

Additionally, the Common Statements drop-down can be used to generate template SQL commands against a temp table (e.g. #TableName) for the columns included in the results set. Click Copy to Clipboard to copy the contents of the generated common statement.

 

Tools Menu Options

 

Generate Create Table Statement

 

Available from the Tools Menu, this options generates a create (#temptable) statement from the last run query.

 

For example, if select * from firms was run, this option could be used to generate the following statement (or similar)

 

CREATE TABLE #temptable

(

firmcode nvarchar(max)

)

CREATE TABLE #temptable

(

FirmID int,

FirmName nvarchar(max),

FirmCode nvarchar(max),

ParentFirmID int,

MainAddressID int,

ModifyDate datetime,

ModifyBy nvarchar(max),

CreateBy nvarchar(max),

CreateDate datetime,

WebSite nvarchar(max),

FirmNote nvarchar(max),

ARNote nvarchar(max)

)

 

Generate Insert Table Statement

 

Available from the Tools Menu, this options generates an insert (#temptable) statement from the last run query.

 

For example, if select * from firms was run, this option could be used to generate the following statement (or similar)

 

INSERT INTO #temptable (

FirmID,FirmName,FirmCode,ParentFirmID,MainAddressID,ModifyDate,ModifyBy,CreateBy,CreateDate,WebSite,FirmNote,ARNote

)

select

@FirmID,

@FirmName,

@FirmCode,

@ParentFirmID,

@MainAddressID,

@ModifyDate,

@ModifyBy,

@CreateBy,

@CreateDate,

@WebSite,

@FirmNote,

@ARNote

 

Dock / Undock Window

 

Available from the Tools Menu, this option undocks the SQL Query applet from the primary InFocus window. This allows the user to continue running InFocus procedures while working with SQL Query in a dedicated window.