toad

Extract code or script of database objects

。_饼干妹妹 提交于 2019-12-01 12:48:13
问题 I need to extract code(script) from all my functions, procedures, packages, views and tables, so that when I move to production I could run the script to create all the objects. While developing I did not take script backup of all database objects. What is the best way to extract code or script? Any suggestion or help is highly appreciable. Thanks 回答1: You do use a version control system don't you? Please do. Failing that you can use the system function dbms_metadata.get_ddl, which will

ORA-00911: invalid character Toad

馋奶兔 提交于 2019-12-01 09:22:00
I am using Toad 11.5 when I run multiple truncate statement, it gives an error ORA-00911: invalid character truncate table employees; truncate table employees_edit_history; truncate table sourcecontributioncalc; but when I run it one bye one , it execute successfully! Why toad giving an error when I run all statements once? and any solution for that ? When you run it as a statement (F9) you can't have multiple statements, and the semicolons are meaningless - as they are statement separators. (You get the same error with a semicolon in an execute immediate or JDBC call, for example, as they

Getting Actual Execution Plan in Oracle 11g

安稳与你 提交于 2019-12-01 09:15:22
问题 I have read this post and this excellent article My question is, how to get the acutual execution plan in Oracle 11g without sys privilege and DBA privilege. (You can treat my case as a READ-ONLY user) I'm able to get the explain plan using SYS.PLAN_TABLE$ or CTRL + E in TOAD But my understanding is that explain plan = estimated execution plan only? Found on Oracle's Document Execution plans can differ due to the following: Different Schemas Different Costs Please give me any help you can

Query Help - String in where clause has & character

筅森魡賤 提交于 2019-11-30 21:35:26
I am running an SQL (Oracle) statement like that select * from table where table_id in ('265&310', '266&320') While running through TOAD, it consider & as some variable placeholder and it asks for its value. If it was for 1-2 place holders then I could have set it in TOAD but the in clause has like 200 of strings. How to put this query? I want to export the DATASET as SQL INSERT statement, so I can't use this in SQL-PLUS. In TOAD, you can disable the prompt for substitution variables from the options dialog: You need to uncheck: View –> Toad Options –> Execute/Compile –> Prompt for

Creating a table from a query using a different tablespace (Oracle SQL)

南楼画角 提交于 2019-11-30 11:32:42
I want to create some tables in our database from some queries I have developed. I used the code below and it created the table and it works great. The issue I am having is apparently it created the table using a different tablespace than the one we are supposed to use. Is there a way to specify that in code like what is below? Just a disclaimer, I am more of the end user of the data so I am not as tech savy. CREATE TABLE new_permanent_table AS SELECT * FROM old_temporary_table WHERE amount<5000; Assuming that you have a quota on the other tablespace, you should be able to just add the

Weird characters added to first column name after reading a toad-exported csv file

半腔热情 提交于 2019-11-30 08:37:08
Whenever I read a csv file in R ( read.csv("file_name.csv") ) that was exported using toad, the first column name is preceded by the following characters " ï.. ". Also, opening the csv file in excel or notepad++ shows up correctly (without the preceding characters). This is a hassle as my workaround has been to rename the column after each read. Thanks for any fix to this issue! Edit: The export was created in Toad by right-clicking on the result set of a query and selecting 'Quick Export -> File -> CSV File' More details per comment: head(readLines('test_file.csv'),n=3) [1] "ID,LOCATION"

Oracle Execution Plan

Deadly 提交于 2019-11-30 01:44:46
问题 I am using Oracle 11g and Toad for Oracle. How can I display execution plan for queries? In Sql server management studio execution plan can be displayed as graphical format. Is there any functionality/tool like that on Toad for oracle? 回答1: CTRL-E Make sure you've ended the query with a semi-colon (and the query above) Edit: You need to set-up the TOAD plan table for use. If you think it's already setup on your DB then you may just need to be granted access. Alternatively in my slightly older

Creating a table from a query using a different tablespace (Oracle SQL)

老子叫甜甜 提交于 2019-11-29 17:13:04
问题 I want to create some tables in our database from some queries I have developed. I used the code below and it created the table and it works great. The issue I am having is apparently it created the table using a different tablespace than the one we are supposed to use. Is there a way to specify that in code like what is below? Just a disclaimer, I am more of the end user of the data so I am not as tech savy. CREATE TABLE new_permanent_table AS SELECT * FROM old_temporary_table WHERE amount

Convert Blob to JPG and update blob

拈花ヽ惹草 提交于 2019-11-29 12:28:03
I'm trying to read in a blob, convert it to JPG and then write back to the blob (it is being passed in by reference, but when trying to compile in TOAD I get an error on ImageIO.write. CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED BANNADMIN.IMAGE_CONVERTER AS package uk.co.ImageUtil; import javax.imageio.ImageIO; import java.io.File; import java.io.IOException; import java.awt.image.BufferedImage; import oracle.sql.*; import java.io.OutputStream; public class ImageConverter { public static void convertImage(BLOB[] blob) { BufferedImage image = null; OutputStream outputStream = null; try {

How to escape ampersand in TOAD?

强颜欢笑 提交于 2019-11-29 06:07:58
问题 When I try to insert a value which has '&' in TOAD I get a prompt for a substitution variable. So when I try: insert into x values('hello & world'); it throws a prompt for substituting the variable 'world'. I have tried right clicking in the editor and disabling prompt for substitution variables but this seems to work only for Execute Statement ( F9 ) It doesn't work for Execute as script( F5 ). I am also aware of using chr(38) like: insert into x values('hello '||chr(38)||'world'); but I do