TOAD: Create a code statement mod

C

Colin Steadman

This may be slightly off topic, but this is probably a better place to
ask than an Oracle group as folk here are more likely to use the
feature I'm asking about.

In Toad (Quest Software) there is a button called 'Create a code
statement' that turns SQL into something you can use in ASP for
building SQL strings:

For example if in Toad you highlight the following, and click the
button:

SELECT
name,
address_line1,
address_line2,
county,
city,
postcode
FROM
address_table
WHERE
city = 'Birmingham'

It copies this into clipboard:

SQL = " SELECT "
SQL = SQL & " name,"
SQL = SQL & " address_line1,"
SQL = SQL & " address_line2,"
SQL = SQL & " county,"
SQL = SQL & " city,"
SQL = SQL & " postcode"
SQL = SQL & " FROM "
SQL = SQL & " address_table"
SQL = SQL & " WHERE "
SQL = SQL & " city = 'Birmingham'"

This is a nice feature (and there is another button that does the
reverse), but I like to build my SQL like this:

Dim aSQL()
Redim aSQL(8)

aSQL(0) = "SELECT "
aSQL(1) = " name, "
aSQL(2) = " address_line1,"
aSQL(3) = " address_line2,"
aSQL(4) = " county,"
aSQL(5) = " city,"
aSQL(6) = " postcode"
aSQL(7) = "FROM "
aSQL(8) = " address_table"
aSQL(9) = "WHERE "
aSQL(10) = " city = 'Birmingham'"

sql = Join(aSQL,"")
Erase aSQL

Anyone know if Toad can be modified to create the array above instead?
I cant find any information about this anywhere.

TIA,

Colin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top