syedraoof, read my reply above about turning on spool SQL. Post the Spool SQL output here and hopefully that will reveal the problem.
RE: Single row subquery error on count of data set
Single row subquery error on count of data set
Hi
I have a really simple query
SELECT *
FROM TABLE
WHERE PAID = 'NA'
AND DELETED IS NULL;
It returns a data set. But when I right click to do "Record Count" I get ORA-01427: single-row subquery returns more than one row. I understand the error, just not how I can get this from a simple count on a set of data that has already been pulled??
Is this me being incredibly stupid? I have restarted TOAD and the same thing occurs. I'm using 12.1 Professional.
svn is broken in 12.9
RE: &&SCHEMA.tablename pet peeve
Hi Michael, Thanks for reply.
I wouldn't say you are missing something, but I still look at it differently.
The Oracle doc points toward variables and examples that are actually used as literals for file names or in a statement.
Neither of which changes basic syntax for parsing owner.tablename.
I ran a similar test in our Linux environment to better illustrate the differences.
In native sql I recreated your test and valued a variable SCHEMA to a TMX (no trailing period)
I then ran the following: select distinct '$SCHEMA.TEST' from $SCHEMA.ACCOUNT;
The output below shows the literal kept the period between the variable and the dot TEST(unlike your example)
and resolved the owner table name.
No worries I guess I am the only one that complained about this. :)
RE: not able to find .dmp file using File Browser
What exactly are you referring to by "Toad File Browser"?
Can you give a screen shot?
not able to find .dmp file using File Browser
RE: &&SCHEMA.tablename pet peeve
> I ran a similar test in our Linux environment to better illustrate the differences.
You are mixing technologies though, right? It looks like you're using Korn shell variables in your SQL and not using Oracle's variable syntax. I don't see where $variable_name is Oracle syntax in the docs.
RE: &&SCHEMA.tablename pet peeve
Could you have your scripts setup to get the variable in the form you're using and then use Oracle syntax in the SQL? This should allow you to use your code in both places. You'd just need to comment your variable define statement when running in Toad or change its assignment.
define var1 = $var1
select '&&var1..test' from &&schema..account;
&&SCHEMA.tablename pet peeve
I have been using Toad for a very long time. Somewhere around version 10 Toad for Oracle changed the way it evaluated variables for table owner.
The syntax of course is owner.table name. In my unix environment native sql resolves a variable with the actual owner name.
For instance say I initialize a variable $SCHEMA to the table owner JOE. I can then write sql against the his tables with the basic Oracle syntax
$SCHEMA.JOES_TABLE.
However in Toad for Oracle it requires me to either value the variable to "JOE." (name followed by a period) or even worse write the sql to have double periods
following the variable (select * from &&SCHEMA..JOES_TABLE).
This requires me to define a second variable for schema name if is part of the data returned. I also have to explain to each new junior team members that our unix and windows sql behave differently.
It's not a major issue but still don't understand why a 3rd Party tool would add such a requirement that is outside of Oracle's syntax, especially when earlier versions already had it correct.
Prior releases did not have an override to this, but I would like to suggest that in future releases that either syntax be acceptable or an override be provided where you could just pass
an owner name to a variable and write the sql accordingly and Toad would resolve correctly. &&SCHEMA.JOES_TABLE
Just a thought!
Thanks!
RE: &&SCHEMA.tablename pet peeve
I am using the unix sqlplus client. So yes the variables are formatted per that OS system. So I would not say I am mixing anything.
As I said earlier Toad versions allowed what I had come to know as standard Oracle format owner.tablename whether the owner was hard coded or passed as a variable.
I guess that was changed to mimic the sqlplus variable handling you describe. What was not taken into account was that folks like me were using Toad variables like an OS system variable which the early Versions of Toad understood. Progress...lol
Also the ONLY time it is really an issue for me is if I am using the &&SCHEMA variable as part of the data returned or part of a where predicate.
In which case I just stop being lazy and create a second variable of the schema name without passing the extra period. And I know I could always code my toad scripts to employ the &&SCHEMA..Tablename. But to me a double period implies something else. So I am being stubborn here too.
So no worries I just figured I make my case as possible option for future releases.
Thanks for your help Michael!
RE: svn is broken in 12.9
Hi Leighton,
Thanks for providing some feedback, as well as including such detailed information on the issue you're running into. Having this information definitely helps us whenever we try to troubleshoot. :-)
Toad uses a Windows API call to launch the Subversion command-line task, so there's really no need to do a "cd" to the working directory. The current working directory is actually specified as part of that call. We also use changelists because of command-line length limitations, as well as to keep multiple changes within a single revision.
Based on what you wrote above, it appears as though you're working with file-based source control within the Editor, rather than using Team Coding to manage your database objects. Since the Subversion code itself hasn't changed much between versions Toad 12.8 and Toad 12.9, I set up a similar test here; but I was unable to reproduce what you were seeing. I'm going to list the steps I followed below; so if I'm doing something differently than you are, please feel free to let me know.
== BEGIN TEST ==
In my test, I have a SQL file sitting out on a networked drive. In Toad 12.9, I set my local provider to Subversion and connected to a remote subversion server through WebDAV. I then linked that repository to a local working folder on my C:\ drive and logged in to Subversion.
1. I opened the script on the networked drive in the editor
2. Since I knew this file didn't exist on the Subversion server, I clicked the "Add file to VCS" button and added the script. It prompted me for the VCS destination folder and checked the file in. Here's an excerpt from Toad's VCS debug log:
==================================================================
Time Stamp: 07/27/2016 13:20:50:862
Request: svn.exe add --username **** --password **** --non-interactive C:\Work\carsvn258sc\CARSVN258_TC\JJB_TEST1\TESTPROJECT\CompareFiles1.sql
==================================================================
Response:
A CompareFiles1.sql
==================================================================
Time Stamp: 07/27/2016 13:20:50:914
Request: svn.exe changelist cl-160727132050 --username **** --password **** --non-interactive C:\Work\carsvn258sc\CARSVN258_TC\JJB_TEST1\TESTPROJECT\CompareFiles1.sql
==================================================================
Response:
A [cl-160727132050] CompareFiles1.sql
==================================================================
Time Stamp: 07/27/2016 13:20:50:978
Request: svn.exe commit --username **** --password **** --non-interactive --changelist cl-160727132050 -m ""
==================================================================
Response:
Adding CompareFiles1.sql
Transmitting file data .
Committed revision 2262.
==================================================================
Time Stamp: 07/27/2016 13:20:51:504
Request: svn.exe info --username **** --password **** --non-interactive http_://carsvn258:8080/svn/CARSVN258_TC/JJB_TEST1/TESTPROJECT/CompareFiles1.sql
==================================================================
Response:
Path: CompareFiles1.sql
Name: CompareFiles1.sql
URL: http_://carsvn258:8080/svn/CARSVN258_TC/JJB_TEST1/TESTPROJECT/CompareFiles1.sql
Relative URL: ^/JJB_TEST1/TESTPROJECT/CompareFiles1.sql
Repository Root: http_://carsvn258:8080/svn/CARSVN258_TC
Repository UUID: a0243a6d-3916-044d-87cf-62fcaf4d1cae
Revision: 2262
Node Kind: file
Last Changed Author: admin
Last Changed Rev: 2262
Last Changed Date: 2016-07-27 13:21:10 -0400 (Wed, 27 Jul 2016)
==================================================================
Time Stamp: 07/27/2016 13:20:51:649
Request: svn.exe changelist --username **** --password **** --non-interactive --remove --changelist cl-160727132050 --depth infinity .
==================================================================
The output listed in the Editor's output window stated:
13:20:46 Info: Project selected: JJB_TEST1/TESTPROJECT,
13:20:46 Info: Editor file T:\JohnB\CompareFiles1.sql copied to VCS working directory C:\Work\carsvn258sc\CARSVN258_TC\JJB_TEST1\TESTPROJECT\CompareFiles1.sql,
13:20:51 Info: File successfully added to VCS: C:\Work\carsvn258sc\CARSVN258_TC\JJB_TEST1\TESTPROJECT\CompareFiles1.sql
3. I then made a change to the source file, adding a comment, and saved it.
4. I then clicked the check-in button. It prompted me for the VCS destination folder and checked the file in. Here's an excerpt from the VCS debug log for that action:
==================================================================
Time Stamp: 07/27/2016 13:22:28:319
Request: svn.exe changelist cl-160727132228 --username **** --password **** --non-interactive C:\Work\carsvn258sc\CARSVN258_TC\JJB_TEST1\TESTPROJECT\CompareFiles1.sql
==================================================================
Response:
A [cl-160727132228] CompareFiles1.sql
==================================================================
Time Stamp: 07/27/2016 13:22:28:367
Request: svn.exe commit --username **** --password **** --non-interactive --changelist cl-160727132228 -m ""
==================================================================
Response:
Sending CompareFiles1.sql
Transmitting file data .
Committed revision 2263.
==================================================================
Time Stamp: 07/27/2016 13:22:28:641
Request: svn.exe info --username **** --password **** --non-interactive http_://carsvn258:8080/svn/CARSVN258_TC/JJB_TEST1/TESTPROJECT/CompareFiles1.sql
==================================================================
Response:
Path: CompareFiles1.sql
Name: CompareFiles1.sql
URL: http_://carsvn258:8080/svn/CARSVN258_TC/JJB_TEST1/TESTPROJECT/CompareFiles1.sql
Relative URL: ^/JJB_TEST1/TESTPROJECT/CompareFiles1.sql
Repository Root: http_://carsvn258:8080/svn/CARSVN258_TC
Repository UUID: a0243a6d-3916-044d-87cf-62fcaf4d1cae
Revision: 2263
Node Kind: file
Last Changed Author: admin
Last Changed Rev: 2263
Last Changed Date: 2016-07-27 13:22:47 -0400 (Wed, 27 Jul 2016)
==================================================================
Time Stamp: 07/27/2016 13:22:28:763
Request: svn.exe changelist --username **** --password **** --non-interactive --remove --changelist cl-160727132228 --depth infinity .
==================================================================
The editor's output window states:
13:22:20 Info: Project selected: JJB_TEST1/TESTPROJECT,
13:22:20 Info: Editor file T:\JohnB\CompareFiles1.sql copied to VCS working directory C:\Work\carsvn258sc\CARSVN258_TC\JJB_TEST1\TESTPROJECT\CompareFiles1.sql,
13:22:28 Info: File successfully checked in: C:\Work\carsvn258sc\CARSVN258_TC\JJB_TEST1\TESTPROJECT\CompareFiles1.sql
5. I then made one more change, saved it and added a comment upon checkin:
==================================================================
Time Stamp: 07/27/2016 13:31:47:132
Request: svn.exe changelist cl-160727133147 --username **** --password **** --non-interactive C:\Work\carsvn258sc\CARSVN258_TC\JJB_TEST1\TESTPROJECT\CompareFiles1.sql
==================================================================
Response:
A [cl-160727133147] CompareFiles1.sql
==================================================================
Time Stamp: 07/27/2016 13:31:47:184
Request: svn.exe commit --username **** --password **** --non-interactive --changelist cl-160727133147 -m "This is a test comment for Subversion"
==================================================================
Response:
Sending CompareFiles1.sql
Transmitting file data .
Committed revision 2264.
==================================================================
Time Stamp: 07/27/2016 13:31:47:600
Request: svn.exe info --username **** --password **** --non-interactive http_://carsvn258:8080/svn/CARSVN258_TC/JJB_TEST1/TESTPROJECT/CompareFiles1.sql
==================================================================
Response:
Path: CompareFiles1.sql
Name: CompareFiles1.sql
URL: http_://carsvn258:8080/svn/CARSVN258_TC/JJB_TEST1/TESTPROJECT/CompareFiles1.sql
Relative URL: ^/JJB_TEST1/TESTPROJECT/CompareFiles1.sql
Repository Root: http_://carsvn258:8080/svn/CARSVN258_TC
Repository UUID: a0243a6d-3916-044d-87cf-62fcaf4d1cae
Revision: 2264
Node Kind: file
Last Changed Author: admin
Last Changed Rev: 2264
Last Changed Date: 2016-07-27 13:32:06 -0400 (Wed, 27 Jul 2016)
==================================================================
Time Stamp: 07/27/2016 13:31:47:718
Request: svn.exe changelist --username **** --password **** --non-interactive --remove --changelist cl-160727133147 --depth infinity .
==================================================================
And the editor's output window, states:
13:31:32 Info: Project selected: JJB_TEST1/TESTPROJECT,
13:31:32 Info: Editor file T:\JohnB\CompareFiles1.sql copied to VCS working directory C:\Work\carsvn258sc\CARSVN258_TC\JJB_TEST1\TESTPROJECT\CompareFiles1.sql,
13:31:47 Info: File successfully checked in: C:\Work\carsvn258sc\CARSVN258_TC\JJB_TEST1\TESTPROJECT\CompareFiles1.sql
Checking the the file within Subversion verified that three revisions of the file existed.
== END TEST ==
Again, please feel free to let me know if my steps differ from what you're doing. However, based on the above tests, it sounds like there might be something strange going on in the Subversion configuration on your computer. If you can, try checking the "Enable VCS debug logging" option in your Team Coding local options and trying the process again. While most commands are outputted to the "VCS Command Log" tab in the output window, the log file generated by the VCS debug logging will track a bit more information on a command-by-command basis.
If you continue running into problems, send me a copy of your VCS debug log offline and we can try to look into it further.
-John
RE: &&SCHEMA.tablename pet peeve
The double period change was fixed a few releases back because of the difference between SQL*Plus and Toad, I do remember the change quite well. Scripts written for Toad could not be executed using SQL*Plus because of the mishandling of periods. This is not the first time a Toad-ism has been corrected causing grief, but I think Toad should always try to follow the rules of the road and in time everyone will re-learn how to do it and be better off for it.
> I am using the unix sqlplus client. So yes the variables are formatted per that OS system. So I would not say I am mixing anything.
No, but I think if you try to minimize your dependence on platform specific syntax your scripts will be more compatible elsewhere. I think doing the DEFINE var = $os_var and then using native SQL*Plus syntax elsewhere will help things. The double period thing is weird, I'll give you that, but it is the way Oracle says it must be done.
Michael
RE: Trigger on Table with CLOB Raises Exception upon Toad's Edit Feature
I can't reproduce the problem in the Editor with the EDIT command. What version of Toad are you using?
I CAN reproduce it with the Insert Table Data window. The reason is that it inserts CLOBS with a RETURNING clause as below - which causes Oracle to throw the error for the trigger.
Insert into LOB_TRIGGER_TEST (
QUERY_TEXT)
Values (
Empty_Clob())
returning QUERY_TEXT into :QUERY_TEXT
There was a reason why I wrote it this way. Let me see if there is anything I can do to make a "normal" insert statement work without breaking anything else. I'll get back to you on that.
Trigger on Table with CLOB Raises Exception upon Toad's Edit Feature
Hello!
I have a table with a CLOB field and a trigger that manipulates the CLOB data. Insert, update, etc work fine in SQL, but the trigger raises an exception when I edit via Toad's EDIT command (also Toad's Database -> Import -> Import Table Data feature).
Steps to reproduce:
- Build example table as shown below
- Build trigger as shown below
- Test success case: INSERT INTO lob_trigger_test VALUES ('x')
- Invoke Toad's EDIT feature by typing: EDIT lob_trigger_test
- In the data grid, click the "+" icon (add a row); enter any value; then click the check-mark icon (post the added row)
- This results in the popup error shown in the trigger code below
This strikes me as a bug in Toad. Do you agree?
Thank you for your insights ... Grant
Table code:
CREATE TABLE lob_trigger_test (query_text CLOB)
Trigger code:
CREATE OR REPLACE TRIGGER tr_lob_trigger_test
BEFORE INSERT OR UPDATE ON lob_trigger_test
FOR EACH ROW
DECLARE
l_query_sql CLOB := :new.query_text;
BEGIN
/*
When we use Toad's EDIT command, this dbms_lob.append command raises
this error:
ORA-22275: invalid LOB locator specified
ORA-06512: at "SYS.DBMS_LOB", line 639
ORA-06512: at "Z_GSTEVENS.TR_LOB_TRIGGER_TEST", line 14
ORA-04088: error during execution of trigger 'Z_GSTEVENS.TR_LOB_TRIGGER_TEST'
Without the append, the error is worse; I want to EXECUTE IMMEDITE the
CLOB value; but instead of an error popup, it disconnects my Toad session.
*/
dbms_lob.append (l_query_sql, ' ');
-- EXECUTE IMMEDIATE l_query_sql;
END;
RE: svn is broken in 12.9
RE: TOAD 12.8 and memory leaks
Hi John:
Thanks for taking the time to reply.
I've just attempted some of your recommendations (even though a few of your suggestions were my settings already).
I tried recommendation number 1, (ie Use Excel Instance) and I received the following response from Toad:
'There was an error sending the data to Excel. This is a known issue. It seems to be related to the data being exported.
Suggested workaround: Use the "XLS File" option rather than the "XLS Instance" option.'
It basically fails when attempting to create a 2nd sheet after the initial 65K are filled in the first sheet.
Also, if it did work correctly, the 'Use XLS Instance' option would take away all of the labor-saving advantages I would be getting from using the Automation Designer as all data would now be exported into separate sheets on a master screen-based spreadsheet that would have to be sliced-and-diced and saved into the individual spreadsheets for the 7 export-data SQL scripts that I am required to carry out.
The Export to XLSX option gives the following error:
'Tag stack not empty: worksheet
sheetData
row
c'
The error options are then Jump, Clipboard and OK
This error is new and I have not seen it before.
I then I eventually get the old favourite back 'Out of memory'.
It looks like I will have to bide my time and wait until this Government Department eventually upgrades through 12.6.0.53 to 12.9.
Toad 12.9.0.71, ASH browser time filter bug
Hi,
Toad 12.9.0.71 x64 on Oracle 11.2.0.3 x64.
Whenever I define Time through "Specific" date value I do not get any result.
For testing I try to define through minutes ...and have results (as it should be).
Hope this is enough to investigate.
Brg
Damir
RE: TOAD 12.8 and memory leaks
The "tag stack not empty" error is definitely fixed in 12.9. The vague "error sending data to excel" error actually comes from Excel (but the message is mine).
One more trick that you might want to try - export to comma delimited text (wrapping strings in double quotes if needed). Save with a .CSV extension. Excel automatically imports those files when you click on them. You shouldn't get any out of memory errors exporting to delimited text.
RE: Connection Toad error Invalid Home Name
Hi Lian
Your registry settings for Oracle home look incorrect. This probably happened on your Oracle Client install. The Oracle home should never be the bin subdirectory.
I would guess the reason Toad is complaining is that is looking for such directories as the bin directory itself and network/admin under the p:\Oracle\ora11203\bin the registry has defined as ORACLE_HOME. Its got to find bin directory underneath home to find the sqlplus executable and the network/admin to find the sqlplus.ora and tnsnames.ora
It looks like your Oracle home registry setting should be p:\Oracle\ora11203
You have two choices.
1) You can use the registry settings I have attached as a guide and regedit the: HKEY_LOCAL_MACHINE > SOFTWARE > ORACLE > KEY_OraClient11g_home1(or its equivalent) using your equivalent :\Oracle\ora11203
2) If this doesn't work you can reinstall your Oracle Client
Good Luck I hope this helps!
RE: Connection Toad error Invalid Home Name
This is an instant client and doesn't need registry although it may have registry entries depending on the installation method. Post your Support Bundle, LianBolenius. Toad can find the home, but the component used to make the connection has no knowledge of it.