10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have an array in an external file, "array.txt", which contains:
char *testarray={"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};I want to be able to add an element to this array, and have that element display, whenever I call it, without having to recompile... (29 Replies)
Discussion started by: ignatius
29 Replies
2. UNIX for Dummies Questions & Answers
my shell script:
#!/bin/ksh
date +%d > /tmp/day.log
day=`tail /tmp/day.log`
############################
for example:
date +%d shows me 05
i want to add 14 days to 05 into my above script.
bc
5+15
19
but i am not sure how to put into above script. (5 Replies)
Discussion started by: lawsongeek
5 Replies
3. UNIX for Dummies Questions & Answers
Hi guys,
I am working with large data sets and often times realize that not all of the columns are aligned correctly (sometimes rows will be shifted). So when I try to do something like:
awk '{ if ($2 > 30 && $5 == $3){print}}' file > output
it won't really work since some of the rows... (2 Replies)
Discussion started by: verse123
2 Replies
4. Shell Programming and Scripting
Hi
I figured how to add my list of numbers. However how do I count so that after a certain number it lists the line.
Example:
12 test1
46 test2
195 test3
174 test4
634 test5
185 test6
94 test7
So basically add the numbers and when the addition reaches 300 or less
print the... (8 Replies)
Discussion started by: bombcan
8 Replies
5. Shell Programming and Scripting
Hello,
I have a main file with IP addresses like this:
Erisim var,100,172.17.241.5,4006,60,IS0799,TCP/IP
Erisim var,1003,172.17.140.4,4004,60,IS2156,TCP/IP
Erisim var,1004,172.17.140.5,4002,60,IS2636,TCP/IP
Erisim var,1005,172.17.140.5,4004,60,IS2436,TCP/IP
Erisim... (8 Replies)
Discussion started by: Spunkerspawn
8 Replies
6. Shell Programming and Scripting
I need some help with adding lines to file and substitute a pattern.
Ok I have a file:
#cat names.txt
name: John Doe
stationed: 1
name: Michael Sweets
stationed: 41
.
.
.
And would like to change it to:
name: John Doe
employed
permanently
stationed: 1-office (7 Replies)
Discussion started by: hemo21
7 Replies
7. UNIX for Dummies Questions & Answers
Hi All
i need a add recored like
DateOfDU2=245,Time=00326 (in milli secounds )
DateOfDU2=245,Time=00347
DateOfDU2=245,Time=00258
DateOfDU2=246,Time=00325
DateOfDU2=246,Time=00408
DateOfDU2=246,Time=00257
DateOfDU2=247,Time=00037
DateOfDU2=247,Time=00417
DateOfDU2=247,Time=00420... (1 Reply)
Discussion started by: nalakaatslt
1 Replies
8. UNIX for Advanced & Expert Users
Hi
I am comparing two files, 100th column have formatting issue
i mean 1 file have scale 4 and anothe file scale 2 ,if scale 2 need to add two zeros.Please any idea how to add two zers to 100th coulmn if scale is 2
file 1
.................1234.2000
file2
................1234.20
... (3 Replies)
Discussion started by: mohan705
3 Replies
9. Shell Programming and Scripting
Can anybody plz help me to solve this puzzle?
amt=00002280674231
((amt = amt + 0)) # to remove leading zero's
echo $amt
prints -2014293065
but this works fine for numbers less than 2000000000.
Thanks
S (3 Replies)
Discussion started by: shivakundan
3 Replies
10. Solaris
I want to know how we can add a new group in solaris. As per my understanding this is done by adding a new entry in /etc/groups file (or by using groupadd command which will also add the entry in the groups file). But when I use group command to see the groups to which I belong, it shows my userid... (7 Replies)
Discussion started by: atheek
7 Replies
SPI_PREPARE(3) PostgreSQL 9.2.7 Documentation SPI_PREPARE(3)
NAME
SPI_prepare - prepare a statement, without executing it yet
SYNOPSIS
SPIPlanPtr SPI_prepare(const char * command, int nargs, Oid * argtypes)
DESCRIPTION
SPI_prepare creates and returns a prepared statement for the specified command, but doesn't execute the command. The prepared statement can
later be executed repeatedly using SPI_execute_plan.
When the same or a similar command is to be executed repeatedly, it is generally advantageous to perform parse analysis only once, and
might furthermore be advantageous to re-use an execution plan for the command. SPI_prepare converts a command string into a prepared
statement that encapsulates the results of parse analysis. The prepared statement also provides a place for caching an execution plan if it
is found that generating a custom plan for each execution is not helpful.
A prepared command can be generalized by writing parameters ($1, $2, etc.) in place of what would be constants in a normal command. The
actual values of the parameters are then specified when SPI_execute_plan is called. This allows the prepared command to be used over a
wider range of situations than would be possible without parameters.
The statement returned by SPI_prepare can be used only in the current invocation of the procedure, since SPI_finish frees memory allocated
for such a statement. But the statement can be saved for longer using the functions SPI_keepplan or SPI_saveplan.
ARGUMENTS
const char * command
command string
int nargs
number of input parameters ($1, $2, etc.)
Oid * argtypes
pointer to an array containing the OIDs of the data types of the parameters
RETURN VALUE
SPI_prepare returns a non-null pointer to an SPIPlan, which is an opaque struct representing a prepared statement. On error, NULL will be
returned, and SPI_result will be set to one of the same error codes used by SPI_execute, except that it is set to SPI_ERROR_ARGUMENT if
command is NULL, or if nargs is less than 0, or if nargs is greater than 0 and argtypes is NULL.
NOTES
If no parameters are defined, a generic plan will be created at the first use of SPI_execute_plan, and used for all subsequent executions
as well. If there are parameters, the first few uses of SPI_execute_plan will generate custom plans that are specific to the supplied
parameter values. After enough uses of the same prepared statement, SPI_execute_plan will build a generic plan, and if that is not too much
more expensive than the custom plans, it will start using the generic plan instead of re-planning each time. If this default behavior is
unsuitable, you can alter it by passing the CURSOR_OPT_GENERIC_PLAN or CURSOR_OPT_CUSTOM_PLAN flag to SPI_prepare_cursor, to force use of
generic or custom plans respectively.
This function should only be called from a connected procedure.
SPIPlanPtr is declared as a pointer to an opaque struct type in spi.h. It is unwise to try to access its contents directly, as that makes
your code much more likely to break in future revisions of PostgreSQL.
The name SPIPlanPtr is somewhat historical, since the data structure no longer necessarily contains an execution plan.
PostgreSQL 9.2.7 2014-02-17 SPI_PREPARE(3)