Quantcast
Channel: Toad for Oracle Forum - Recent Threads
Viewing all 4385 articles
Browse latest View live

RE: How do I add the colum'names in exporting SQL to text using Run as script

$
0
0

--I hade some adjustments based on Norm's email . I am not at work / no access to Toad.

--I removed one set command and changed headings to off

--also you don't need a group by

set pagesize 0
set trimspool on
set echo off
set embedded off
set feedback off
set heading off
set serveroutput on
set linesize 2000


spool D:\BK210.txt

begin

dbms_output.enable(100000);

dbms_output.put_line('CLI;AGE;NCP;DEV');     --these are your column headings

end;

/

Select d.cli||';'||d.age||';'||d.ncp||';'||d.dev
from prod.bkhis d
group by d.cli, d.age, d.ncp, d.dev
order by d.cli asc
;

spool off

exit


RE: How do I add the colum'names in exporting SQL to text using Run as script

$
0
0

Hi Gene,

> but i do this all the time, and it puts the headers at the top.

Yes, I sit corrected, sorry. Of course it will because the PL/SQL anonymous block ends before the plain SQL query starts, so the buffers are obtained and printed before the SQL is executed. My mistake, apologies.

You, we, one (!) could use prompt instead of calling out to PL/SQL with all it's context changes etc.

Prompt cli,age,dev,....

How do I add the colum'names in exporting SQL to text using Run as script

$
0
0

Good morning everybody

I'm new in toad and I need an advice please.
I'm executing this query using the "run as script" command to export data in a text file.
But when I'm looking inside the text file generated, the data is there but there is no column headers.
Please would you help to correct de query so that the column headers appear in the text file generated.
Thanks to you.

***TOP OF THE QUERY ***
set pagesize 0
set trimspool on
set headsep on
set echo off
set embedded off
set feedback off
set heading on
set linesize 2000

spool D:\BK210.txt
Select d.cli,';', d.age,';', d.ncp,';', d.dev
from prod.bkhis d
group by d.cli, d.age, d.ncp, d.dev
order by d.cli asc
;
spool off
***END OF THE QUERY ***

RE: Compare Schemas - problem editing/running Sync Script

$
0
0

In Toad 11.6 and prior, the DBA Module was required to use the sync script.   Starting in 12.0, either the DBA module or the Xpert edition gives you access to the sync script.  

RE: Compare Schemas - problem editing/running Sync Script

$
0
0

Hi John,

Thanks for the answer!

I didn't find the product "DBA module". How I can fix the problem?

Thanks ahead

Yulia

RE: Compare Schemas - problem editing/running Sync Script

$
0
0

Sorry, it's actually called "DB Admin Module".  It used to be called "DBA Module" - I still call it that most of the time!  

It's not a separate product.   It's an option on your license key.  I don't know if you can still buy it for Toad 11.6 or if you'd have to upgrade.   A sales rep should be able to help you with that.

Compare Schemas - problem editing/running Sync Script

$
0
0

Hello,

I have Toad for Oracle Xpert, version 11.6.1.6 for Win 64-bit.

Choose the menu item:

Database --> Compare --> Schemas

Choosing a source and a target schemas from the same connection and run the comparison.

Choose the Sync Script tab.  The script is displayed, but the buttons on the top are disable, including:

Save, Move to Editor, Move and Run.

Also the Copy is disable.

So I can't to edit and to run the script

Any help will be appreciated! 

Thanks ahead

Yulia

RE: toad

$
0
0

If I read your question correctly, you're expecting Toad to retain the data from your query after you close Toad.  You have to realize that once you close Toad, you also close your connection to Oracle.  Once that connection is closed, Toad no longer has access to Oracle to pull that data back.  Looking at it another way, the data in a database isn't static so once you've pulled it, it can easily change so what you're seeing is simply a moment in time of that data.  If you want "fresh" data, you have to ask the database to return a fresh set.  If you're not worried about it being "fresh" then simply export it to something static (like XLSX or CSV) for viewing later.


Editor Folding - CASE Statements fold more than they should

$
0
0

The Code Folding feature seems to not understand a case statement.  Is there a way to stop a Case Statement from throwing off the "BEGIN/END" matching?

I have included a small sample of what I am talking about.  I should be able to fold the second BEGIN and collapse the code down such that I only see the last end.  I should be able to collapse the SELECT statement such that I see both END statements. 

Thanks,

David

DECLARE

v_TMP VARCHAR2(50);

BEGIN

BEGIN

SELECTCASEWHEN1=1

THEN'FIRST'

ELSE'SECOND'

END My_Case

INTO v_TMP

FROM DUAL;

-- When collapsing the "SELECT", it should not include this comment.

EXCEPTION

WHENNO_DATA_FOUNDTHEN

DBMS_OUTPUT.PUT_LINE('Test');

END;

END;

RE: toad

$
0
0

Thanks for your reply

but you didn't get my point

when run query which will retrieve big data, not working anymore and not retrieve any data and when run the same query from sql plus, query retrieve data well

and when restart Toad and try again to run query wroking well

i need to know why toad hang in the first time and need to restart it to working well and retrieve the big data

RE: toad

$
0
0
How are you running the query (F5 or F9) would be the first question.  F5 will pull the data as you would in SQL*Plus where F9 will retrieve the first X rows depending on the OCI buffer.  When you say "doesn't retrieve any data", does it do anything? You also say it "hangs".  Does it hang or does it simply not retrieve data?  Does any dialog come up?  Have you tried to spool the SQL (Database -> spool SQL) to see if any error is being generated?



RE: toad

$
0
0
You did not respond to the answer, so we cannot see what answer you were given.
Consider this,
Sometimes Toad will become disconnected due to timeout, inactivity. When you try to run a script in this state, sometimes it will hang. When you receive the notice to reconnect, sometimes it will recover sometimes it will not.
But as the answer stated please provide more information, messages notifications......

Lately, I make sure I am still connected, before running any query, especially a large one. menu, session, reconnect.

toad

$
0
0

when run query which will retrieve big data, toad not show any data in result if we closed toad and reopened it 

query working well, we are using toad lastet version 32bit & oracle client 32 bit

can i know the reason

RE: Toad Formatter Bug - 12.10.0.30 - Unpivot followed by Pivot not recognized.

Toad Formatter Bug - 12.10.0.30 - Unpivot followed by Pivot not recognized.

$
0
0

When a Pivot clause is used immediately after an unpivot, the formatter doesn't recognize as valid syntax and returns an error. This is demonstrated in the following simple example.

Select * From Dual Unpivot (c For d In (dummy As 'Unpivot')) pivot (Max(c) For d in ('Unpivot'));

If an attempt to format the above is made in 12.10.0.30 then it fails. However the code runs fine.


RE: How to keep output within TOAD for AppDesigner/Automation Designer

$
0
0

Try the Export Dataset action on the Import/Export page. When there is no data a message box is shown indicating such. When there is data it's exported to the destination of your choosing.

If you need to do this with execute script you can place an Actionable Query action before your script. Set its text to "EXISTS (<your SELECT here>)" and when there is no data your app will fail to execute. When it succeeds your script executes as normal. This may be less desirable if your SELECT takes a while to execute though.

Michael

How to keep output within TOAD for AppDesigner/Automation Designer

$
0
0

Hi all,

I am trying to run a script in AppDesigner that will output rows that meet a certain condition - otherwise, it returns "no rows selected."

I would like it to notify me when there is data, but I feel like I need to keep it within the program to potentially do an If-Then-Else on the conditions so I can try to test for it NOT saying "no rows selected".

The options for Execute Script don't seem to include keeping the output in the Output window or Data Grid.

Is there any way to do tests on this data in this way? (Toad version 9.7.2.5 for reference)

Thank you in advance to anyone reading and/or helping!

ERROR ON MY PROCEDURE WITH VARIABLES

$
0
0

Guys, i am new in Toad and SQL world and receive a project.

I have a daily process with multiple variables dates, and I need to make him run auto in Ora10g.

I'm trying to build a procedure, but there's some problem when i try to run, can somebody help me?

---------------------------------------------------

Error code 

ORA-00932: data tipe inconsistent: expected date, received number.

---------------------------------------------------

CREATE OR REPLACE PROCEDURE PRODUCAO_EMPRESTIMOS_DIARIA AS

DT_ANOMES_M0 NUMBER;
DT_ANOMES_M1 NUMBER;
DT_PARTITION_M0 VARCHAR(50);
DT_PARTITION_M1 VARCHAR(50);
DT_CARGA_ATUAL DATE;
DT_REFE_ATUAL DATE;
DT_CARGA_S1 DATE;
DT_REFE_S1 DATE;
DT_CARGA_M1 DATE;
DT_REFE_M1 DATE;

----------------------------------------------------------------------------------

BEGIN

EXECUTE IMMEDIATE('SELECT MAX(DT_ANOMES) FROM DBM.TB_RD_EXPORT') INTO DT_ANOMES_M0;

-----------------

EXECUTE IMMEDIATE('SELECT TO_NUMBER(TO_CHAR(ADD_MONTHS(TO_DATE('||DT_ANOMES_M0||',''RRRRMM''),-1),''RRRRMM'')) FROM DUAL') INTO DT_ANOMES_M1;

-----------------

DT_PARTITION_M0 := 'P_'||DT_ANOMES_M0;

-----------------

DT_PARTITION_M1 := 'P_'||DT_ANOMES_M1;

-----------------

EXECUTE IMMEDIATE('SELECT TRUNC(SYSDATE) FROM DUAL') INTO DT_CARGA_ATUAL;

-----------------


PR_EXCLUI_TABELAS('TMP_RG_DTS');
EXECUTE IMMEDIATE ('CREATE TABLE TMP_RG_DTS AS
SELECT DT_ANOMES,
DT_REFE,
MAX(TRUNC(DT_CARGA)) DT_CARGA
FROM DBM.TB_RD_EXPORT
WHERE DT_ANOMES IN ('||DT_ANOMES_M0||','||DT_ANOMES_M1||')
AND DT_CARGA IN ('||DT_CARGA_ATUAL||')
GROUP BY DT_ANOMES, DT_REFE
ORDER BY DT_ANOMES, DT_REFE
');

END;

RE: Displaying schema browser and editor on separate tabs?

$
0
0

I know this is a very old post, but I didn't see a real solution to the question, and this has just become a problem for me - and in the middle of a TOAD session. I'm using 12.7.1.11, and have always been able to have multiple editor tabs and multiple browser tabs on the same window - as well as having multiple connections on separate tabs, each with its own editor and browser tabs - so to switch between connections, editor sessions and schema browsers, I had only to click a tab. 

Today, in the middle of a TOAD session, I opened a new connection, and when I opened the schema browser, it took up the whole page, covering not only the new session's editor window, but the other session as well.  Yes, I can tile the windows, and if all I'm doing is an editor session and a schema browser in a single database, that's okay. But I'm often comparing objects or code between development, test and production - and this makes it really difficult.

Displaying schema browser and editor on separate tabs?

$
0
0

I just installed 11.6 on my new laptop at work. When I open a schema browser, it covers my editor tabs. I can go to Window and select the editor or browser, but what I'd really like is to have the browser and editors all appear as tabs on the same window (if that's the right term). This is the way it worked on my old laptop, which had 11.2. I'm sure the functionality is still available in 11.6. I just don't know how to access it.

Viewing all 4385 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>