How to get SQL script for generating table, constraint, indexes?
I'd like to get from somewhere Oracle tool for generating simple SQL script for generating table, indexes, constraint (like Toad) and it has to be Oracle tool but not Designer.
Can someone give me some edvice?
Thanks!
m.
I'd like to get from somewhere Oracle tool for
generating simple SQL script for generating table,
indexes, constraint (like Toad) and it has to be
Oracle tool but not Designer.
SQL Developer is similar to Toad and is an Oracle tool.
http://www.oracle.com/technology/products/database/sql_developer/index.html
Similar Messages
-
How to get the script of a table or view in SQL Developer?
Dear friends/expert,
Could you tell me how to get the script for a view or a table easily in SQL Developer like pressing F4 in TOAD?
I found that I can press SHIFT+F4 for a view in SQL Developer and get the script of the view in Details Tab. But how to move the script to SQL worksheet to edit? It is very easy to do in TOAD.
And I didn't find a way to get the script for a table till now. Is there any way to do that?
Thanks in advance.
Best regards,
Ning1. Although the team might put a lot of effort in keeping track on the forum, a lot of posts still go by without answer.
2. If you have an enhancement request, log it at the announced SQL Developer Exchange, so others can vote to add weight on the issue. Be clear and detailed in the explanation.
3. Given the structure of the application, I guess it won't be easy (maybe impossible) to add the functionality you are asking. Do you have a suggestion on how to access the info?
4. If your request gets accepted, still another year or two may go by until the functionality gets added. For sure you'll be better off writing a user defined extension or report (querying DBMS_METADATA.GET_DDL).
Hope that helps,
K.
Edited by: -K- on 12/01/2009 09:37 -
Generating SQL Script for Existing Tables and DBs
Hello,
is it possible to generate automatically a SQL-Script from an existing table or oracle database ?
I want to export an existing table from an Oracle DB (g11) if its possible with the data.
Perhaps somebody could me explain how to to do this.
I am using the "SQL Developer 2.1" and the "enterprise manager konsole".
I'm a rookie in using this tools.
Thank you for any informations.
N. WylutzkiIf you want to export data, you should use the export utility. This is documented:
http://tinyurl.com/23b7on -
How do i get a script for a table
hai
i need sql query to create table script for already existing table.
can any body help me.
Edited by: 800324 on Feb 24, 2011 12:07 AMfor examle
SELECT DBMS_METADATA.GET_DDL('TABLE',u.table_name)
FROM USER_ALL_TABLES uEdited by: Mahir M. Quluzade on Feb 24, 2011 12:23 PM -
How to get stop script for the server
Hello everyone,
I installed weblogic server8.1 on my Linux machine and used $WL_HOME/server/bin/startWLS.sh
to create a new domain and server. But I did not find any stop script(like stopWLS.sh)
which can stop myserver. How can I get it?
Thanks for your helps.
Iriswhich can stop myserver. How can I get it?Here's an etc/rc3.d script I use for my RH9 server. You'll notice there is
a line in there for stop(), you can run that manually if you so choose, or
you can use it via the xinetd (I think that's what it's called?). Good luck.
# processname: weblogic
# pidfile: /var/run/weblogic.pid
PIDFILE=/var/run/weblogic.pid
# Source function library
. /etc/init.d/functions
#check to see if we can write to config.xml...so non-root uses stop here
[ -w /Domain/config.xml ] || exit 0
#setup the environment for the java commands
. /bea/weblogic81/server/bin/setWLSEnv.sh
cd /Domain
start(){
echo "Starting WebLogic for Domain"
cd /Domain
daemon ./startWebLogic.sh &
echo $! > $PIDFILE
RETVAL=$?
echo "WebLogic Server started."
return $RETVAL
stop(){
echo "Stopping WebLogic for Domain"
rm -f $PIDFILE
java weblogic.Admin -url localhost:80 FORCESHUTDOWN
status(){
echo "Getting Weblogic status for Domain"
java weblogic.Admin -url localhost:80 GETSTATE
restart(){
echo -n "Restarting WebLogic for Domain"
stop
start
# See how we were called.
case "$1" in
start)
start
stop)
stop
restart|reload)
stop
start
status)
status
echo $"usage: $0 {start|stop|status|restart|reload}"
exit 1
esac
exit $RETVAL -
SQL script for exporting table
Could anyone please help me with SQL (plain SQL, not PL/SQL) for writing the data from a table into a .csv file?
I need to run it on SQL developer. Can't use spool because it works only on SQL*PLus
Edited by: user10403078 on Oct 15, 2008 2:24 AMBut I want the SQL script to create a CSV file, because it should write the data from the tables into a CSV file, and proceed to delete it from the tables, every time the SQL script is run. I can't manually click and save.
-
How to get row count(*) for each table that matches a pattern
I have the following query that returns all tables that match a pattern (tablename_ and then 4 digits). I also want to return the row counts for these tables.
Currently a single column is returned: tablename. I want to add the column RowCount.
DECLARE @SQLCommand nvarchar(4000)
DECLARE @TableName varchar(128)
SET @TableName = 'ods_TTstat_master' --<<<<<< change this to a table name
SET @SQLCommand = 'SELECT [name] as zhistTables FROM dbo.sysobjects WHERE name like ''%' + @TableName + '%'' and objectproperty(id,N''IsUserTable'')=1 ORDER BY name DESC'
EXEC sp_executesql @SQLCommandThe like operator requires a string operand.
http://msdn.microsoft.com/en-us/library/ms179859.aspx
Example:
DECLARE @Like varchar(50) = '%frame%';
SELECT * FROM Production.Product WHERE Name like @Like;
-- (79 row(s) affected)
For variable use, apply dynamic SQL:
http://www.sqlusa.com/bestpractices/datetimeconversion/
Rows count all tables:
http://www.sqlusa.com/bestpractices2005/alltablesrowcount/
Kalman Toth Database & OLAP Architect
SQL Server 2014 Design & Programming
New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012 -
How to get DDL history for a Table?
Hi All,
Is there any way to find all the DDL commands fired on a table?
And to find the user who has done that?
I think using Flashback query, we will only get DML changes and UNDO_SQL
and the user responsible for the change.
Is there any similar one getting DDL History.
Or any other query to find the same?
Thanks,
KishoreIn general, no, there is no way to get this information after the fact over any appreciable time frame. I assume that you have Oracle 10.2 since you haven't provided a version number...
If you are looking to set up something to track future DDL, depending on your particular requirements:
- You could write DDL triggers that would generate entries into custom audit tables when DDL was generated.
- You can enable Oracle's built-in auditing capabilities
- You can use Oracle's Audit Vault product
If your historical DDL is relatively recent, and you're in ARCHIVELOG mode, and you still have the archived logs from the time in question, you could use LogMiner to extract the DDL. If flashback logging is enabled, you could flashback an entire database to a point in time to see what a table looked like, but that would be relatively unwieldy in addition to being possible only over a relatively short time frame.
Justin -
Tool Bar script for generating Email
Hi experts,
I have made the following script for sending a custom email.
And i've the required jar files in the ftp drive on the same server where E-sourcing is installed.
If anyone can look at this code and tell me whats wrong with it, i'll be realy grateful .
addClassPath("D:/FTPHOME/MailJar/activation.jar");
addClassPath("D:/FTPHOME/MailJar/javac.mail.jar");
addClassPath("D:/FTPHOME/MailJar/mail.jar");
import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;
// Recipient's email ID needs to be mentioned.
String to = "Email add of recipient";
// Sender's email ID needs to be mentioned
String from = "Email add of sender";
// Assuming you are sending email from localhost
String host = "IP address of the host ";
// Get system properties
Properties properties = System.getProperties();
// Setup mail server
properties.setProperty("mail.smtp.host", host);
// Get the default Session object.
Session session1 = Session.getDefaultInstance(properties);
// Create a default MimeMessage object.
MimeMessage message = new MimeMessage(session1);
// Set From: header field of the header.
message.setFrom(new InternetAddress(from));
// Set To: header field of the header.
message.addRecipient(Message.RecipientType.TO,
new InternetAddress(to));
// Set Subject: header field
message.setSubject("This is the Subject Line!");
// Now set the actual message
message.setText("This is actual message");
// Send message
try{
Transport.send(message);
catch(Exception e)
print(e);
Thanks,
AbhijitI'd like to get from somewhere Oracle tool for
generating simple SQL script for generating table,
indexes, constraint (like Toad) and it has to be
Oracle tool but not Designer.
SQL Developer is similar to Toad and is an Oracle tool.
http://www.oracle.com/technology/products/database/sql_developer/index.html -
How to move SQL scripts using HANA ALM ?
I see clear documentation of moving the content easily from Dev to test and to production using DU which exports only content. Similarly can we use the transport management/ALM for moving sql scripts, for example table creation scripts or table structures that needs to be moved from Dev to QA ?
Thanks
SureshSutirtha,
Thank you very much. I really appreciate all of your responses.
I have one more question ( Sorry for flooding you with lot of questions :) )
How to capture the errors which occured inside the SQL Scripts.
My scenario is like this. I have two sql scripts Script_1.sql and Script2.sql namely. I would like to put dependency on the execution of the scripts.
If Script_1.sql executes succesfully without any errors, then EXECUTE Script_2.sql
else if Script_1.sql execution contains errors then DON'T EXECUTE Script_2.sql
As of now, i observed that the Process flow shows Success State even if there is an error in the sql script execution. Because of which i was not able to put dependency on the execution of the scripts.
I think i can do it by tweaking(changing) the code inside the SQL Scripts, like logging the errors in some log table and reading it before the next script execution.
But the restriction is, I Should not touch/change the existing SQL Scripts.
Do we have any mechanism in the ProcessFlows to identify the SQL Errors that occurred during execution of SQL Scripts ?
Please suggest any idea on this. It will be great if you can help in this.
Thanks in advance,
SriGP. -
Hi everyone
How to make a script for build table:
col width 25mm
align decimal
align on close paren
Thanks
TeetanHi Teetan VK,
Merry Chrismas.
I'm not really an InDesign scripter.
But you can try the following code:
// TableCreate_simple.jsx
// regards pixxxelschubser
var aDoc = app.activeDocument;
// your width of every column
var w = Number(prompt("width of columns", 25));
var NrOfColumns = 3;
var aTextFrame = aDoc.textFrames.add({visibleBounds:[0, 0, 30, NrOfColumns*w + 1]});
var aTable = aTextFrame.insertionPoints[0].tables.add({columnCount:NrOfColumns,bodyRowCount:1});
for (i=0; i<aTable.columns.length; i++) {
aTable.columns[i].width = w;
// Paragraph sytyle with decimal aligning should already exists in your document
for (j = 0; j < aTable.cells.length; j++) {
aTable.cells[j].texts[0].appliedParagraphStyle = aDoc.paragraphStyles.item("AlignDecimal");
Be sure, that a paragraph style (named with "AlignDecimal") exists in your Document.
But what is:
Teetan VK schrieb:
… align on close paren … -
How to find out the script for the table using SQL
Hi,
Could any one tell me that how to find out the script for the table using SQL.
Thanks,
kamalKamal,
You can find the SQL query in Advanced tab of Answers
Thanks,
Balaa... -
Generate script for filling table
Hi all,
I've got table at test Oracle server table1 with columns ID, BTYPE, MYDESCRIPTION. Rows of this table have been inserted manually. Now my need is to write script for creating table (structure + data). I think about writing something like
CREATE TABLE table 1
AS
SELECT 1 AS ID, 'TYPE1' AS BTYPE, 'SOME TEXT' AS MYDESCRIPTION
UNION ALL
SELECT 2 AS ID, 'TYPE2' AS BTYPE, 'SOME TEXT 2' AS MYDESCRIPTION
But rows are too many to type... Could you please suggest some way of generating script for creating table at working server using existing table at test server? The problem is I don't have an access to working server.
Thanks ahead.Use the view user_tab_cols
say
declare
cursor c1 is
select 'e_'||column_name ||' '||data_type||' ('||data_length||') ' col
from user_tab_cols
where table_name = 'DEPARTMENTS'
union
select 'd_'||column_name ||' '||data_type||' ('||data_length||') ' col
from user_tab_cols
where table_name = 'EMPLOYEES';
v1 varchar2(500);
begin
v1 := 'create table new_tabl (';
for i in c1 loop
v1 := v1||i.col||',';
end loop;
v1 := substr(v1,1,length(v1)-1);
dbms_output.put_line(v1||')');
end;
/i am using employees and departments table of hr schema.
now as both the tables have some column column so i have used e for employees and d for departments
just do one thing remove the length for date data type in o/p i dont know why it is not working.
this will give you structure for data use any sql stmt
Edited by: 810345 on Jun 9, 2011 9:58 PM -
How to write sql query for counting pairs from below table??
Below is my SQL table structure.
user_id | Name | join_side | left_leg | right_leg | Parent_id
100001 Tinku Left 100002 100003 0
100002 Harish Left 100004 100005 100001
100003 Gorav Right 100006 100007 100001
100004 Prince Left 100008 NULL 100002
100005 Ajay Right NULL NULL 100002
100006 Simran Left NULL NULL 100003
100007 Raman Right NULL NULL 100003
100008 Vijay Left NULL NULL 100004
It is a binary table structure.. Every user has to add two per id under him, one is left_leg and second is right_leg... Parent_id is under which user current user is added.. Hope you will be understand..
I have to write sql query for counting pairs under id "100001". i know there will be important role of parent_id for counting pairs. * what is pair( suppose if any user contains both left_leg and right_leg id, then it is called pair.)
I know there are three pairs under id "100001" :-
1. 100002 and 100003
2. 100004 and 100005
3. 100006 and 100007
100008 will not be counted as pair because it does not have right leg..
But i dont know how to write sql query for this... Any help will be appreciated... This is my college project... And tommorow is the last date of submission.... Hope anyone will help me...
Suppose i have to count pair for id '100002'. Then there is only one pair under id '100002'. i.e 100004 and 100005Sounds like this to me
DECLARE @ID int
SET @ID = 100001--your passed value
SELECT left_leg,right_leg
FROM table
WHERE (user_id = @ID
OR parent_id = @ID)
AND left_leg IS NOT NULL
AND right_leg IS NOT NULL
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How can I extract the full SQL script for a schema?
Hi,
How can I extract the full SQL script for a schema?
I am looking for some method that needs jus SQL*Plus and preferably doesn’t need any extra tool.
Thank you,
AlanHow can I extract the full SQL script for a schema?What are you looking for? PL/SQL code? DDL for objects?
Maybe you are looking for
-
Ipod nano 7th gen not recognized by itunes
how is this fixed
-
i want to create pdf from uiview but the quality of generated pdf is poor.How can i create high quality pdf.
-
Hi Gurus, I need to add new fields in selection screen of VT06 and I don't know if it is possible to do that, Somebody knows if that is possible? Thanks in advance, Mariano.
-
Hey folks, Anyone know where i can find a list of BP roles, or specifically tr1051? im getting an error when i try to start a transaction with this new bp. Thanks
-
Is javamail part of JDK/JRE
Can any one tell me whether JavaMail is part of JDK or JRE. If so, what is the purpose of providing it separately