Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 19th, 2005, 02:18 PM
Colin Steadman
Guest
 
Posts: n/a
Default TOAD: Create a code statement mod

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
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles