Sponsored Content
Top Forums Shell Programming and Scripting [ORACLE] CREATE TABLE in bash Post 302252405 by methyl on Wednesday 29th of October 2008 10:54:06 AM
Old 10-29-2008
It is not necessary or desirable to execute the sqlplus command within backticks and put the result into an environment variable. This will hide errors and give you issues with line breaks.
The SQL "DROP TABLE IF EXISITS " is a SQL syntax error.

sqlplus -s "$login/$passwd@$db"<<EOF
DROP TABLE IF EXISITS $table1;
CREATE TABLE $table1 AS SELECT * FROM $login.$table WHERE $i IN (SELECT $i FROM $login.$table MINUS SELECT $i FROM $login1.$table);
exit
EOF
 

9 More Discussions You Might Find Interesting

1. HP-UX

to create a oracle table in perl script

Hi all, I have to create table for each month inside a perl script. tablename_monthnameyear. megh_aug2008 for august 2008. megh_sep2008 for september 2008. just like the logfiles created on date basis. thanks megh (1 Reply)
Discussion started by: megh
1 Replies

2. Shell Programming and Scripting

Check the record count in table (table in oracle)

I have requirement: 1) Check the record count in table (table in oracle) 2) If records exists generate the file for existing records and wait for some time (Go to sleep mode) and Again check the record count after 10 min.......... (Loop this process if record count >0). 3) Generate touch... (1 Reply)
Discussion started by: kamineni
1 Replies

3. Shell Programming and Scripting

Check the record count in table (table in oracle)

I have requirement: 1) Check the record count in table (table in oracle) 2) If records exists generate the file for existing records and wait for some time then Go to sleep mode and Again check the record count after 10 min.......... (Loop this process if record count >0). 3) Generate touch... (1 Reply)
Discussion started by: kamineni
1 Replies

4. Shell Programming and Scripting

help with a bash script to create a html table

Hi guys as the title says i need a little help i have partisally written a bash script to create a table in html so if i use ./test 3,3 i get the following output for the third arguement in the script i wish to include content that will be replace the A characters in the... (2 Replies)
Discussion started by: dunryc
2 Replies

5. UNIX and Linux Applications

create table via stored procedure (passing the table name to it)

hi there, I am trying to create a stored procedure that i can pass the table name to and it will create a table with that name. but for some reason it creates with what i have defined as the variable name . In the case of the example below it creates a table called 'tname' for example ... (6 Replies)
Discussion started by: rethink
6 Replies

6. Shell Programming and Scripting

How can we create a string table in bash shell ?

Hello, How can we write the pseudo code below using Bash shell scripting? table = ; i=0; do{ grep table h.txt; }while(i<3); or table = ; i=0; for(i=0;i<3;i++) grep table h.txt; (4 Replies)
Discussion started by: dbgork
4 Replies

7. UNIX and Linux Applications

Help in copying table structure to another table with constraints in Oracle

hi, i need to copy one table with data into another table, right now am using create table table1 as select * from table2 i want the constraints of table1 to be copied to table2 also , can anyone give me some solution to copy the constraints also, now am using oracle 10.2.0.3.0... (1 Reply)
Discussion started by: senkerth
1 Replies

8. Shell Programming and Scripting

Script to create the SQLLDR control file from Oracle table.

I need to create the shell script load the few 100 table using the SQLLDR. Need to generate the control file for each table using oracle table. table has "table names" and "column names" using this need create the control file. example table rows below table_nme column_nme DEPT ... (2 Replies)
Discussion started by: pimmit22043
2 Replies

9. Shell Programming and Scripting

How to create a for loop statement for removing files listed in Oracle table?

Hello Frens, I am a newbie to shell scripting. I need a help on creating a for loop script (shell script) for removing files. I have a table called a_table with column name fil_name which contains all the files that need to be removed. Thank you in advance (6 Replies)
Discussion started by: manisha_singh
6 Replies
DROP 
AGGREGATE(7) SQL Commands DROP AGGREGATE(7) NAME
DROP AGGREGATE - remove an aggregate function SYNOPSIS
DROP AGGREGATE [ IF EXISTS ] name ( type [ , ... ] ) [ CASCADE | RESTRICT ] DESCRIPTION
DROP AGGREGATE removes an existing aggregate function. To execute this command the current user must be the owner of the aggregate func- tion. PARAMETERS
IF EXISTS Do not throw an error if the aggregate does not exist. A notice is issued in this case. name The name (optionally schema-qualified) of an existing aggregate function. type An input data type on which the aggregate function operates. To reference a zero-argument aggregate function, write * in place of the list of input data types. CASCADE Automatically drop objects that depend on the aggregate function. RESTRICT Refuse to drop the aggregate function if any objects depend on it. This is the default. EXAMPLES
To remove the aggregate function myavg for type integer: DROP AGGREGATE myavg(integer); COMPATIBILITY
There is no DROP AGGREGATE statement in the SQL standard. SEE ALSO
ALTER AGGREGATE [alter_aggregate(7)], CREATE AGGREGATE [create_aggregate(7)] SQL - Language Statements 2010-05-14 DROP AGGREGATE(7)
All times are GMT -4. The time now is 01:47 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy