01-28-2014
I took the hostname of the desktop from cmd and run the command on Unix and it says the hostname not found. any other suggestions?
Could we have an option to cut the columns from the .csv file once uploaded in to unix? I need the last column in the excel sheet to run against the database.
9 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am having problems uploading files to my new server. I am new at this so im sure im doing it wrong. I tried using wsftp but that didnt work. please help me!! (4 Replies)
Discussion started by: rdog157h
4 Replies
2. Shell Programming and Scripting
hi,
i m working on a perl cgi script which uploads a file to the server. i m stuck. i hav written the errors.
plz help.
Sachin Kaw
______________________________________________________________________
#!/usr/bin/perl -w
use CGI;
use CGI qw(:standard);
use strict;
use POSIX... (4 Replies)
Discussion started by: sachin_kaw
4 Replies
3. Shell Programming and Scripting
Hi
I have an excel file with only 5 rows .I want to uplaod those 5 rows to a database using a shell script.Is this possible.If so where do i start.
Thnks (1 Reply)
Discussion started by: magikminox
1 Replies
4. UNIX for Advanced & Expert Users
Hi,
Just wanted to know, how can I ftp/transfer/copy a (design.tar.gz) archive from a Unix Server (sdmc222.sdmc.cp-srv.com) which is at a remote location, to my Windows Desktop. Obviously, it is not possible at cmd prompt on my Windows using the following commands :-
ftp... (3 Replies)
Discussion started by: marconi
3 Replies
5. Shell Programming and Scripting
Hi all
i have a such question this is my shell script my script must upload file to webdav server
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
#!/bin/sh
###... (1 Reply)
Discussion started by: knut
1 Replies
6. Shell Programming and Scripting
Hi ,
I want to upload some files from my desktop to unix server through FTP . The list of files are in a text file .Please suggest how to do it through scrip .
Thanks in advance ..
Anupam (8 Replies)
Discussion started by: anupamhalder
8 Replies
7. Shell Programming and Scripting
Hello,
I have a script that finds the latest version of a file in a folder on my Minecraft server. I'm trying to come up with something that will then FTP that file over to my fileserver.
Here's what I have that finds the newest file:
find /home/mc/archive/sbhouse -type f -mtime +45 -exec... (7 Replies)
Discussion started by: nbsparks
7 Replies
8. Shell Programming and Scripting
Xperts,
My requirement is something like this,
I have a sql script which i need to embed in a shell. The sql (oracle) script will generate a .csv file in some Unix directory. the approximate file size is around 10 mb which i need to upload to an sftp server. My concern here is how to make... (5 Replies)
Discussion started by: Showdown
5 Replies
9. UNIX for Dummies Questions & Answers
Hi,
I want to use scp to upload file to my unix server.
i am using this:
scp D:\testr.txt unixuser@unixhost:/path
it returns an error:
ssh: D: host/servname not known
i am not sure how to tell path of my D drive in the command and how will command understand it has to pick from my... (5 Replies)
Discussion started by: Kohli
5 Replies
LEARN ABOUT PHP
db2_fetch_both
DB2_FETCH_BOTH(3) 1 DB2_FETCH_BOTH(3)
db2_fetch_both - Returns an array, indexed by both column name and position, representing a row in a result set
SYNOPSIS
array db2_fetch_both (resource $stmt, [int $row_number = -1])
DESCRIPTION
Returns an array, indexed by both column name and position, representing a row in a result set. Note that the row returned by
db2_fetch_both(3) requires more memory than the single-indexed arrays returned by db2_fetch_assoc(3) or db2_fetch_array(3).
PARAMETERS
o $stmt
- A valid stmt resource containing a result set.
o $row_number
- Requests a specific 1-indexed row from the result set. Passing this parameter results in a PHP warning if the result set uses a
forward-only cursor.
RETURN VALUES
Returns an associative array with column values indexed by both the column name and 0-indexed column number. The array represents the next
or requested row in the result set. Returns FALSE if there are no rows left in the result set, or if the row requested by $row_number does
not exist in the result set.
EXAMPLES
Example #1
Iterating through a forward-only cursor
If you call db2_fetch_both(3) without a specific row number, it automatically retrieves the next row in the result set. The follow-
ing example accesses columns in the returned array by both column name and by numeric index.
<?php
$sql = "SELECT id, name, breed, weight FROM animals ORDER BY breed";
$stmt = db2_prepare($conn, $sql);
$result = db2_execute($stmt);
while ($row = db2_fetch_both($stmt)) {
printf ("%-5d %-16s %-32s %10s
",
$row['ID'], $row[0], $row['BREED'], $row[3]);
}
?>
The above example will output:
0 Pook cat 3.20
5 Rickety Ride goat 9.70
2 Smarty horse 350.00
Example #2
Retrieving specific rows with db2_fetch_both(3) from a scrollable cursor
If your result set uses a scrollable cursor, you can call db2_fetch_both(3) with a specific row number. The following example
retrieves every other row in the result set, starting with the second row.
<?php
$sql = "SELECT id, name, breed, weight FROM animals ORDER BY breed";
$result = db2_exec($stmt, $sql, array('cursor' => DB2_SCROLLABLE));
$i=2;
while ($row = db2_fetch_both($result, $i)) {
printf ("%-5d %-16s %-32s %10s
",
$row[0], $row['NAME'], $row[2], $row['WEIGHT']);
$i = $i + 2;
}
?>
The above example will output:
0 Pook cat 3.20
5 Rickety Ride goat 9.70
2 Smarty horse 350.00
SEE ALSO
db2_fetch_array(3), db2_fetch_assoc(3), db2_fetch_object(3), db2_fetch_row(3), db2_result(3).
PHP Documentation Group DB2_FETCH_BOTH(3)