linux sqlplus select results writes into file twice
Hello,
This is my first post and its because I could not find solution for myself I decided to ask help here.
What I want to do;
I want to get some data from a table 1 on server 1 and insert those datas into a table 2 on server 2. ( lets say schema names are server1 and server 2 also ). After my script works on server 1, I'll put the result file on server 2 and will just execute it.
Here is my script; What I get;
When I check "/tmp/selectResults.sql" file I see select query's results AND "insert into server2.table2 (columnA, columnB, columnC) values(' || columnA || ',' || columnB || ', ' || columnC || ');" lines.
In the end, I get results twice, first as raw data and second in my "insert into" lines. I just want my insert into lines so I can use it on the server 2.
Another solution would be; how can I use raw data from select results ?
On the net everyone says load data for oracle but my result file has no "," . What I see is like this ;
What to do now ?
Last edited by Franklin52; 04-12-2011 at 06:30 AM..
Reason: Please use code tags, thank you
Hi All,
I needed to get the result of two sqlplus queris into shell variables.
After days of looking for the ultimate solution to this problem.. i found this...
sqlplus -s USER/PASS@DB <<EOF | awk '{if(NR==1) printf("%s ", $1); if(NR==2) printf("%s ",
$1);}' | read VAR1 VAR2
set head off... (2 Replies)
Can someone tell me why I'm getting error when I try to run this?
#!/bin/csh -f
source ~/.cshrc
#
set SQLPLUS = ${ORACLE_HOME}/bin/sqlplus
#
set count=`$SQLPLUS -s ${DB_LOGIN} << END
select count(1) from put_groups where group_name='PC' and description='EOD_EVENT' and serial_number=1;... (7 Replies)
I try to prepare a sufficient function to execute a sql-statement, getting back ONLY retrieved results!
What I can't figured out how to make the sqlplus not printing the 'Connected to ...', 'Disconnected from...' and the executed statements after 'SQL> '.
I am under impression that having... (5 Replies)
So, I would like to run differen select queries on multiple databases..
I made a script wich I thought to be called something like..
./script.sh sql_file_name out.log
or to enter select statement in a command line..
(aix)
and I did created some shell script wich is not working..
it... (6 Replies)
I m trying to grep 'select * from' from a script, but the problem is with the * ...
I think its taking * as some special character ...
when I try to do grep '*' test (test is my test file) its displaying *
But when I am trying to do grep 'select * from' test its not showing anything... (2 Replies)
hi all,
i am writing a ksh script, i am logging into an oracle db via sqlplus and running a select statement but i dont know how i can store the results from the sql so i can iterate over it and do more operations over it. I dont want to write a stored procedure with a cursor since i need to... (2 Replies)
hi,
i have a requirement where i need to connect sqlplus from unix and i am able to do so by following command:
cust_count=`sqlplus -s $ORACLE_USER/$ORACLE_PASS@$ORACLE_SID << EOF
set pagesize 0
set feedback off
set verify off
... (1 Reply)
Hi all,
I'm using below code
processId=`sqlplus -s ${sysuser}/${syspwd} <<CHK_PROCESS
whenever sqlerror exit sql.sqlcode;
set head off feedback off echo off pages 0
SELECT PROCESS_ID FROM LSHADMIN.DATA_DOMAIN WHERE DOMAIN_NAME = '${tabname}'
... (8 Replies)
Discussion started by: Pratiksha Mehra
8 Replies
LEARN ABOUT DEBIAN
xvsetportattribute
XvSetPortAttribute(3) libXv Functions XvSetPortAttribute(3)NAME
XvSetPortAttribute - sets an attribute of a video port
SYNOPSIS
#include <X11/extensions/Xvlib.h>
int XvSetPortAttribute(Display *dpy, XvPortID port,
Atom attribute, int value);
ARGUMENTS
dpy Specifies the connection to the X server.
port Specifies the port for which the attribute is to be used.
attribute Identifies the port attribute to be set by this request. Can be one of the table entries under the column "String," below.
value Identifies the value to which attribute is to be set. Can be one of the table entries under the column "Type," below.
DESCRIPTION XvSetPortAttribute(3)
permits a client to set the port attribute to specified values. This request supports the following values:
-----------------------------------------------------
Attribute String Type Default
-----------------------------------------------------
"XV_ENCODING" XvEncodingID Server dependent
"XV_HUE" [-1000...1000] 0
"XV_SATURATION" [-1000...1000] 0
"XV_BRIGHTNESS" [-1000...1000] 0
"XV_CONTRAST" [-1000...1000] 0
The supplied encoding must be one of the encodings listed for the adaptor, otherwise an Encoding error results.
If the adaptor does not support the exact hue, saturation, brightness, and contrast levels supplied, the closest levels supported are
assumed. Use XvGetPortAttribute(3) to query the resulting levels.
When an XvSetPortAttribute(3) request is processed, a XvPortNotify(3) event is generated for all clients that have requested notification
of port changes using XvSelectPortNotify(3).
RETURN VALUES
[Success]
Returned if XvSetPortAttribute(3) completed successfully.
[XvBadExtension]
Returned if the Xv extension is unavailable.
[XvBadAlloc]
Returned if XvSelectVideoNotify(3) failed to allocate memory to process the request.
DIAGNOSTICS
[XvBadPort]
Generated if the requested port does not exist.
[XvBadEncoding]
Generated if an encoding is specified that does not exist.
[BadMatch]
Generated if the requested attribute atom does not specify an attribute supported by the adaptor.
SEE ALSO XvGetPortAttribute(3), XvQueryPortAttributes(3), XvSelectPortNotify(3), XvPortNotify(3)X Version 11 libXv 1.0.7 XvSetPortAttribute(3)