05-28-2013
How about using
SQL Loader to load the values from abc.txt into a database table
say temp_table, and then use this table in the query you mentioned:
select name from table_name where cardnum in (seletc card_no from temp_table)
Last edited by juzz4fun; 05-28-2013 at 04:58 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
i have this basic piece of code that i am trying to debug to accept input parameter to be able to display a directory listing of files.
cd /u02/app/eatv/dev/out
CURDIR=`pwd`
echo directory listing of $CURDIR
echo
if ; then
ls -latr
else
ls -latr $1
fi
basically if the script... (9 Replies)
Discussion started by: wtolentino
9 Replies
2. Shell Programming and Scripting
Hi,
I need a script that will run a dynamic Oracle SQL. Dynamic meaning the SQL statement depends on the parameter.
For instance, something like this:
#!/bin/ksh -x
# Set environment
. /home/mine/set_vars
sqlplus $LOGINID <<! >> /home/mine/log.txt
select count(1) from $1
where... (2 Replies)
Discussion started by: laiko
2 Replies
3. Shell Programming and Scripting
Hello,
If I run this command on the server it works.
# dbc "update config set radio_enabled = 0;"
how can I execute the same command in perl. I have defined the dbc path. Can any one please correct the last line.
#!/usr/bin/perl
#database path
$dbc='/opt/bin/psql -Userver... (0 Replies)
Discussion started by: sureshcisco
0 Replies
4. Shell Programming and Scripting
Hello,
I have this shell script that runs awk code by passing in parameters however now it doesn't work anymore with the parameters and I don't know why.
It removes duplicates from an input file based on a part of the last field and a key column. It removes the record with the older datetime... (0 Replies)
Discussion started by: script_op2a
0 Replies
5. UNIX for Dummies Questions & Answers
Hello,
When listing the file systems (using ls -ltr) , if the group names are longer the group name is getting truncated.
Can someone help with the script which would display the truncated group name?
I appreciate if someone could help in this regard. (3 Replies)
Discussion started by: mike12
3 Replies
6. Shell Programming and Scripting
I need to run sql script from shell script which takes the input from a file and contents of file will be like :
12345
34567
78657
and query will be like :
select seq_nbr from bus_event where event_nbr='12345';
select seq_nbr from bus_event where event_nbr='34567';
select seq_nbr... (1 Reply)
Discussion started by: rkrish
1 Replies
7. Shell Programming and Scripting
I need to run a SQL select query in Oracle database and have to capture the list of retrieved records in shell script. Also i would like to modify the query for certain condition and need to fetch it again. How can i do this?
Is there a way to have a persistent connection to oracle database... (9 Replies)
Discussion started by: vel4ever
9 Replies
8. Shell Programming and Scripting
Hi, this's Pom. I'm quite a new one for shell script but I have to do sql on shell script to query some information from database.
I found a concern to get a new line...When I run my script, it retrieves all data as wondering but it's shown in one line :(
What should I do? I'm not sure that... (2 Replies)
Discussion started by: Kapom
2 Replies
9. UNIX for Dummies Questions & Answers
Please read How To Ask Questions The Smart Way (1 Reply)
Discussion started by: balu_279013
1 Replies
10. Shell Programming and Scripting
I want to run sql query in shell script and output data save as delimited text (delimited text would be comma)
Code:
SPOOL_FILE=/pgedw/dan.txt
SQL=/pgedw/dan.sql
sqlplus -s username/password@myhost:port/servicename <<EOF
set head on
set COLSEP ,
set linesize 32767
SET TRIMSPOOL ON
SET... (8 Replies)
Discussion started by: Jaganjag
8 Replies
LEARN ABOUT PHP
pg_copy_from
PG_COPY_FROM(3) PG_COPY_FROM(3)
pg_copy_from - Insert records into a table from an array
SYNOPSIS
bool pg_copy_from (resource $connection, string $table_name, array $rows, [string $delimiter], [string $null_as])
DESCRIPTION
pg_copy_from(3) inserts records into a table from $rows. It issues a COPY FROM SQL command internally to insert records.
PARAMETERS
o $connection
- PostgreSQL database connection resource.
o $table_name
- Name of the table into which to copy the $rows.
o $rows
- An array of data to be copied into $table_name. Each value in $rows becomes a row in $table_name. Each value in $rows should be
a delimited string of the values to insert into each field. Values should be linefeed terminated.
o $delimiter
- The token that separates values for each field in each element of $rows. Default is TAB.
o $null_as
- How SQL NULL values are represented in the $rows. Default is N ("\N").
RETURN VALUES
Returns TRUE on success or FALSE on failure.
EXAMPLES
Example #1
pg_copy_from(3) example
<?php
$db = pg_connect("dbname=publisher") or die("Could not connect");
$rows = pg_copy_to($db, $table_name);
pg_query($db, "DELETE FROM $table_name");
pg_copy_from($db, $table_name, $rows);
?>
SEE ALSO
pg_copy_to(3).
PHP Documentation Group PG_COPY_FROM(3)