02-11-2009
Hi Jim, first of all thanks
I have done something like this
this is controlfile
control_file
LOAD DATA
INFILE '/home/gc1488/FST/input'
INTO TABLE unix_servers
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(SERVER_ID NUMBER(6),
SERVER_NAME VARCHAR2(20),
MARKET CHAR(3),
SERVER_TYPE VARCHAR2(15),
PROD_IND CHAR(1),
OWNER VARCHAR2(20))
I already have input file in that location. One thing the table im going to use should already exist or doesnt matter because I have to insert into the table which is already there. but in this example im trying to use the table which doesnt exist because I think sqlldr will create table if doesnt exists right?
But I got one error, it says
SQL*Loader-350: Syntax error at line 5.
Expecting "," or ")", found "NUMBER".
(SERVER_ID NUMBER(6),
^
Also could you tell me how can i use the existing table here.
thank you very much
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
I'm attempting to populate an array in ksh using the following command:
set -A $(SELECT_INVOICE | sed '/^$/d')
SELECT_INVOICE is a function that executes the SQL query.
Problem: Some of the invoice numbers have alpha characters with spaces(example: OVEN MICRO). The Korn shell is treating... (1 Reply)
Discussion started by: kdst
1 Replies
2. UNIX for Dummies Questions & Answers
Can someone tell me how to execute an Oracle Stored Procedure from a Korn Shell Script.
Previously, I'm able to execute standard sql using the following:-
The_Output=`sqlplus................. << EOF
select count(*) from abc
/
... (3 Replies)
Discussion started by: Vinny_Mitchell
3 Replies
3. Shell Programming and Scripting
I want to be able to run a script on one server, that will spawn another shell which runs some commands on another server..
I have seen some code that may help - but I cant get it working as below:
spawn /usr/bin/ksh
send "telnet x <port_no>\r"
expect "Enter command: "
send "LOGIN:x:x;... (2 Replies)
Discussion started by: frustrated1
2 Replies
4. Shell Programming and Scripting
well i have this code here..and it works fine in kornshell..
#!/bin/ksh
home=c:/..../
input=$1
sed '1,3d' $input > $1.out
line=""
cat $1.out | while read a
do
line="$line $a"
done
echo $line > $1
rm $1.out
however...now i want it just in normal sh mode..how to convert this?... (21 Replies)
Discussion started by: forevercalz
21 Replies
5. UNIX for Advanced & Expert Users
Hi,
My Oracle Stored procedure returns sys_refcursor to shell script. I have to iterate through it in script and use those retrieved values further in my script. I am using K Shell Scrpting.
Stored Procedure is:
create or replace
PROCEDURE p_test(job_id IN VARCHAR2, c1 OUT SYS_REFCURSOR)... (0 Replies)
Discussion started by: rajeshorpu
0 Replies
6. Shell Programming and Scripting
Hi All
I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell.
Some operations like calculation don't work :
cat ${file1} | tail -$((${num1}-${num2})) > ${file2}
Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies
7. Shell Programming and Scripting
Enclosed is comma separated text file. I need to write a korn shell program that will parse the text file and insert the values into Oracle database.
I need to write the korn shell program on Red Hat Enterprise Linux server.
Oracle database is 10g. (15 Replies)
Discussion started by: shellguy
15 Replies
8. Shell Programming and Scripting
Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command ..
$ echo $SHELL
yields me
/bin/sh
Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Discussion started by: bobby1015
6 Replies
9. Shell Programming and Scripting
I've been sent the following script to finish. It's supposed to connect to an oracle database, query it, and send an email if the query result value is one or more. Currently it isn't connecting properly, just giving the following error:
ERROR: ORA-01017: invalid username/password; logon denied... (2 Replies)
Discussion started by: jackmorgan2007
2 Replies
10. Programming
Hi All ,
I am trying to pass a value from sqlplus to korn shell .
There is a table tab1 in Oracle that has a column userdate.
I need to pass the userdate to the korn shell . This is what I am doing .
VALUE=`sqlplus -silent username/password << END
set pagesize 0 feedback off verify off... (14 Replies)
Discussion started by: megha2525
14 Replies
LEARN ABOUT LINUX
drop_table
DROP
TABLE(7) SQL Commands DROP TABLE(7)
NAME
DROP TABLE - remove a table
SYNOPSIS
DROP TABLE [ IF EXISTS ] name [, ...] [ CASCADE | RESTRICT ]
DESCRIPTION
DROP TABLE removes tables from the database. Only its owner can drop a table. To empty a table of rows without destroying the table, use
DELETE [delete(7)] or TRUNCATE [truncate(7)].
DROP TABLE always removes any indexes, rules, triggers, and constraints that exist for the target table. However, to drop a table that is
referenced by a view or a foreign-key constraint of another table, CASCADE must be specified. (CASCADE will remove a dependent view
entirely, but in the foreign-key case it will only remove the foreign-key constraint, not the other table entirely.)
PARAMETERS
IF EXISTS
Do not throw an error if the table does not exist. A notice is issued in this case.
name The name (optionally schema-qualified) of the table to drop.
CASCADE
Automatically drop objects that depend on the table (such as views).
RESTRICT
Refuse to drop the table if any objects depend on it. This is the default.
EXAMPLES
To destroy two tables, films and distributors:
DROP TABLE films, distributors;
COMPATIBILITY
This command conforms to the SQL standard, except that the standard only allows one table to be dropped per command, and apart from the IF
EXISTS option, which is a PostgreSQL extension.
SEE ALSO
ALTER TABLE [alter_table(7)], CREATE TABLE [create_table(7)]
SQL - Language Statements 2010-05-14 DROP TABLE(7)