Using TOAD to generate an insert statement.

I use Toad to generate a base insert statement, but there are problems with this method. I generate them by right clicking the table, selecting Generate SQL to Editor.

The first problem is that computed columns are included in the insert statement, which shouldn’t be.

Second, bit datatype defaults to a text string of the field name. This should default to 1 or 0.

Is there a way to customize the functionality of this? For example, one of the primary reasons I use it is to insert a “unknown” value in a table for data warehouse purposes. Mine would default to specific values appropriate for an unknown value such as ‘Unknown’ for longer character fields, getdate() for date fields (or perhaps ‘1/1/1900’), etc.

Is there any way to set that up?

Hi David,

Unfortunatelythere is no possibility to set that up now. Will create an enhancement request to try improve it in the future. The only option you can apply for now is toautomatically format generated SQL.

I’ve created CR to exclude computed columnsfrom that template. But bit column scripting works as designed - see how othercolumns are scripted: there is no predefined data for all column datatypes. Wejust place column name so user can easily identify what is needed in whatplace.

thanks for your input,

Alex