"Save as...Insert Statements" - single quotes being placed around numbers

Good morning,

I am new to Toad and have a question about the behavior when saving insert statements using commercial v9.7.2.5 under Windows 7.

When I try to save the Grid output as Insert Statements, the resulting saved file has single quotes around all data, including numbers.

ex:
SET DEFINE OFF;
Insert into MYTABLE
(NUMBER1, TYPE, NUMBER2, NUMBER3, NUMBER4, NUMBER5)
Values
(‘10’, ‘long’, ‘280497’, ‘2432’, ‘0’, ‘26000000’);

When using the same version of Toad under Windows XP I was not seeing this problem.

ex:
SET DEFINE OFF;
Insert into MYTABLE
(NUMBER1, TYPE, NUMBER2, NUMBER3, NUMBER4, NUMBER5)
Values
(32, ‘long’, 280753, 2418, 4552900, 0);

Is there a setting I missed somewhere? Thanks!

Hi Mojo ,

I can’t think of any option that would affect this, but if there is, it
would be on the ‘save as’ dialog, so just make sure you are using
same settings in both cases.

Are you using the same Oracle client version in both cases?

-John

Hi John,

Actually no. I was using the 10g client on the Windows XP boxand have moved to the 11g client on Windows 7.

Pretty sure the settings in the Save as… dialog are the same (Windows XP was my old box, now replaced.), but I don’t see an option that would intuitively affect this behavior anyway.

Thanks!

Are you running the sql statement in the editor with F5? If so, run it with
F9 instead.

I do not save the grid, but rather in the sql window (vs the output window) I do
file, save as, and since I will always be putting it back to toad anyway I save
it as .txt, give it a name and file it in the appropriate folder.

But I understand you may be referring to something else.

On Mon, Aug 30, 2010 at 9:00 AM, Moe Joelson
wrote:

Message from: mojo

Good morning,

I am new to Toad and have a question about the behavior when saving insert
statements using commercial v9.7.2.5 under Windows 7.

When I try to save the Grid output as Insert Statements, the resulting saved
file has single quotes around all data, including numbers.

ex:
SET DEFINE OFF;
Insert into MYTABLE
   (NUMBER1, TYPE, NUMBER2, NUMBER3, NUMBER4, NUMBER5)
 Values
   ('10', 'long', '280497', '2432',
'0', '26000000');

When using the same version of Toad under Windows XP I was not seeing this
problem.

ex:
SET DEFINE OFF;
Insert into MYTABLE
   (NUMBER1, TYPE, NUMBER2, NUMBER3, NUMBER4, NUMBER5)
 Values
   (32, 'long', 280753, 2418, 4552900, 0);

Is there a setting I missed somewhere? Thanks!

Historical Messages

Author: Moe Joelson
Date: Mon Aug 30 07:00:59 PDT 2010
Good morning,

I am new to Toad and have a question about the behavior when saving insert
statements using commercial v9.7.2.5 under Windows 7.

When I try to save the Grid output as Insert Statements, the resulting saved
file has single quotes around all data, including numbers.

ex:
SET DEFINE OFF;
Insert into MYTABLE
   (NUMBER1, TYPE, NUMBER2, NUMBER3, NUMBER4, NUMBER5)
 Values
   ('10', 'long', '280497', '2432',
'0', '26000000');

When using the same version of Toad under Windows XP I was not seeing this
problem.

ex:
SET DEFINE OFF;
Insert into MYTABLE
   (NUMBER1, TYPE, NUMBER2, NUMBER3, NUMBER4, NUMBER5)
 Values
   (32, 'long', 280753, 2418, 4552900, 0);

Is there a setting I missed somewhere? Thanks!

__
_______________________________________

using F9 worked. Thanks jdorlon!

What is the difference between using F5 and F9 to execute?

When you execute something using F5, it executes it as a script. The grid is a
representation of the data in the text output so all of the information is a
treated as a string, not the native data type as it is with F9.

For select statements, F9 opens a cursor in the database and attaches it to the
grid. If the dataset has more than 500 rows (or whatever you have set for OCI
Array Buffer Size in Toad options), only the first 500 rows are fetched until
you scroll down.

F9 is for running scripts. If you do a select statement, we’re going to
return every row. So this could use up a lot of resources if the table has lots
of rows. We have a feature in our script engine that puts the results of the
select into a grid, but when it does so, everything is treated as a string.
That’s why when you ‘save as’ from it, the ‘save
as’ engine puts everything in quotes.

Interesting, thanks for the insight!

Uh, should have been F5 in my 2nd paragraph.