Since your "in list" could be more than 1,000 items, You could use a 'external table' and just join the external table to the target table(s) so that you only retrieve matching card numbers, example:
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)
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)
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)
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)
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)
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)
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)
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)
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
cubrid_execute
CUBRID_EXECUTE(3) 1 CUBRID_EXECUTE(3)cubrid_execute - Execute a prepared SQL statementSYNOPSIS
resource cubrid_execute (resource $conn_identifier, string $sql, [int $option])
DESCRIPTION
bool cubrid_execute (resource $request_identifier, [int $option])
The cubrid_execute(3) function is used to execute the given SQL statement. It executes the query by using $conn_identifier and SQL, and
then returns the request identifier created. It is used for simple execution of query, where the parameter binding is not needed. In addi-
tion, the cubrid_execute(3) function is used to execute the prepared statement by means of cubrid_prepare(3) and cubrid_bind(3). At this
time, you need to specify arguments of $request_identifier and $option.
The $option is used to determine whether to get OID after query execution and whether to execute the query in synchronous or asynchronous
mode. CUBRID_INCLUDE_OID and CUBRID_ASYNC (or CUBRID_EXEC_QUERY_ALL if you want to execute multiple SQL statements) can be specified by
using a bitwise OR operator. If not specified, neither of them isselected. If the flag CUBRID_EXEC_QUERY_ALL is set, a synchronous mode
(sync_mode) is used to retrieve query results, and in such cases the following rules are applied:
oThe return value is the result of the first query.
o If an error occurs in any query, the execution is processed as a failure.
o In a query composed of q1 q2 q3, if an error occurs in q2 after q1 succeeds the execution, the result of q1 remains valid. That
is, the previous successful query executions are not rolled back when an error occurs.
o If a query is executed successfully, the result of the second query can be obtained using cubrid_next_result(3).
If the first argument is $request_identifier to execute the cubrid_prepare(3) function, you can specify an option, CUBRID_ASYNC only.
PARAMETERS
o $conn_identifier
-Connection identifier.
o $sql
-SQL to be executed.
o $option
-Query execution option CUBRID_INCLUDE_OID, CUBRID_ASYNC, CUBRID_EXEC_QUERY_ALL.
o $request_identifier
-cubrid_prepare(3) identifier.
RETURN VALUES
Request identifier, when process is successful and first param is conn_identifier; TRUE, when process is successful and first argument is
request_identifier.
FALSE, when process is unsuccessful.
CHANGELOG
+--------+----------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+----------------------------------------+
| 8.4.0 | |
| | |
| | Add new option CUBRID_EXEC_QUERY_ALL. |
| | |
+--------+----------------------------------------+
EXAMPLES
Example #1
cubrid_execute(3) example
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$result = cubrid_execute($conn, "SELECT code FROM event WHERE name='100m Butterfly' and gender='M'", CUBRID_ASYNC);
$row = cubrid_fetch_array($result, CUBRID_ASSOC);
$event_code = $row["code"];
cubrid_close_request($result);
$history_req = cubrid_prepare($conn, "SELECT * FROM history WHERE event_code=?");
cubrid_bind($history_req, 1, $event_code, "number");
cubrid_execute($history_req);
printf("%-20s %-9s %-10s %-5s
", "athlete", "host_year", "score", "unit");
while ($row = cubrid_fetch_array($history_req, CUBRID_ASSOC)) {
printf("%-20s %-9s %-10s %-5s
",
$row["athlete"], $row["host_year"], $row["score"], $row["unit"]);
}
cubrid_close_request($history_req);
cubrid_disconnect($conn);
?>
The above example will output:
athlete host_year score unit
Phelps Michael 2004 51.25 time
SEE ALSO cubrid_prepare(3), cubrid_bind(3), cubrid_next_result(3), cubrid_close_request(3), cubrid_commit(3), cubrid_rollback(3).
PHP Documentation Group CUBRID_EXECUTE(3)