Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pg_lo_open(3) [php man page]

PG_LO_OPEN(3)															     PG_LO_OPEN(3)

pg_lo_open - Open a large object

SYNOPSIS
resource pg_lo_open (resource $connection, int $oid, string $mode) DESCRIPTION
pg_lo_open(3) opens a large object in the database and returns large object resource so that it can be manipulated. Warning Do not close the database connection before closing the large object resource. To use the large object interface, it is necessary to enclose it within a transaction block. Note This function used to be called pg_loopen(3). PARAMETERS
o $connection - PostgreSQL database connection resource. When $connection is not present, the default connection is used. The default connection is the last connection made by pg_connect(3) or pg_pconnect(3). o $oid - The $OID of the large object in the database. o $mode - Can be either "r" for read-only, "w" for write only or "rw" for read and write. RETURN VALUES
A large object resource or FALSE on error. EXAMPLES
Example #1 pg_lo_open(3) example <?php $database = pg_connect("dbname=jacarta"); pg_query($database, "begin"); $oid = pg_lo_create($database); echo "$oid "; $handle = pg_lo_open($database, $oid, "w"); echo "$handle "; pg_lo_write($handle, "large object data"); pg_lo_close($handle); pg_query($database, "commit"); ?> SEE ALSO
pg_lo_close(3), pg_lo_create(3). PHP Documentation Group PG_LO_OPEN(3)

Check Out this Related Man Page

PG_LO_WRITE(3)															    PG_LO_WRITE(3)

pg_lo_write - Write to a large object

SYNOPSIS
int pg_lo_write (resource $large_object, string $data, [int $len]) DESCRIPTION
pg_lo_write(3) writes data into a large object at the current seek position. To use the large object interface, it is necessary to enclose it within a transaction block. Note This function used to be called pg_lowrite(3). PARAMETERS
o $large_object - PostgreSQL large object (LOB) resource, returned by pg_lo_open(3). o $data - The data to be written to the large object. If $len is specified and is less than the length of $data, only $len bytes will be written. o $len - An optional maximum number of bytes to write. Must be greater than zero and no greater than the length of $data. Defaults to the length of $data. RETURN VALUES
The number of bytes written to the large object, or FALSE on error. EXAMPLES
Example #1 pg_lo_write(3) example <?php $doc_oid = 189762345; $data = "This will overwrite the start of the large object."; $database = pg_connect("dbname=jacarta"); pg_query($database, "begin"); $handle = pg_lo_open($database, $doc_oid, "w"); $data = pg_lo_write($handle, $data); pg_query($database, "commit"); ?> SEE ALSO
pg_lo_create(3), pg_lo_open(3). PHP Documentation Group PG_LO_WRITE(3)
Man Page

12 More Discussions You Might Find Interesting

1. Programming

Help wanted

Hi, I know very little about C and Unix. I have written a program to use threads. The program needs to get some values from a very large database. I wrote a simple program and compiled but got the following errors..... cc mythread.c -lthread "/usr/include/pthread.h", line 120:... (3 Replies)
Discussion started by: reddyb
3 Replies

2. Shell Programming and Scripting

input variable like POST in PHP possibly?

I have a very large database and once in awhile the database auto loading scripts that update the database for the daily updates fails and I have to go in and manually fix it but when that happens I usually have to start from scratch on sundays I have access to a weekly database rebuild. Then I... (3 Replies)
Discussion started by: chadrt
3 Replies

3. UNIX for Advanced & Expert Users

database connection (unresolved sqlcxt)

i have a little pro*c code (as shown below) to connect an oracle database. (in unix solaris platform) in the preprocessor compilation step everything is ok. but when i try to compile the code using cc i get the error below: ld: Unresolved: sqlcxt i think there is a problem while linking... (3 Replies)
Discussion started by: gfhgfnhhn
3 Replies

4. Shell Programming and Scripting

sed: removing any and all trailing digits?

We have a large number of oracle database related scripts that utilize the environment variables $ORACLE_SID and $DBNAME. In a single instance database the $ORACLE_SID is the same as the database name $DBNAME. So we have simply set DBNAME = $ORACLE_SID. However, now that we are clustering with RAC,... (5 Replies)
Discussion started by: Squeakygoose
5 Replies

5. UNIX for Dummies Questions & Answers

Hiding database connection strings from xml file

Hi , I have a configuration file with the following structure: <CONFIG> <DEFAULTS operator="oraread"> <PROPERTY name="hostname" value="myhostname"/> <PROPERTY name="port" value="12343"/> <PROPERTY name="dbname" value="dbname"/> <PROPERTY... (0 Replies)
Discussion started by: neeto
0 Replies

6. Programming

Read/Write a fairly large amount of data to a file as fast as possible

Hi, I'm trying to figure out the best solution to the following problem, and I'm not yet that much experienced like you. :-) Basically I have to read a fairly large file, composed of "messages" , in order to display all of them through an user interface (made with QT). The messages that... (3 Replies)
Discussion started by: emitrax
3 Replies

7. HP-UX

Encrypting DataBase Passwords

Hi All We have got a HUGE process of securing our infrastructure(primarily the database) We basically establish connection to oracle database from our UNIX shell scripts when we do ps -ef | grep sqlplus it blurts out all the credentials as output. sqplus username/password@server ... (1 Reply)
Discussion started by: b_sri
1 Replies

8. Shell Programming and Scripting

Function returns wrong values - solved

Hi I have a small function which returns a wrong value. The function tries to make a connection to oracle database and tries to get the open_mode of the database in the variable status. However when a database is down the value of the status column is set to READWRITE i am not sure why. I... (0 Replies)
Discussion started by: xiamin
0 Replies

9. UNIX and Linux Applications

Identify server.database connection

Good afternoon i need your help, i am new at unix, in a ETL scenario like datastage is , there are a bunch of procesess (script shells) conecting to hetereogenius database source servers in order to extract information. Ive got 2 questions 1. Using unix how can i identify exactly the... (1 Reply)
Discussion started by: alexcol
1 Replies

10. Shell Programming and Scripting

deleting dupes in a row

Hello, I have a large database in which name homonyms are arranged in a row. Since the database is large and generated by hand, very often dupes creep in. I want to remove the dupes either using an awk or perl script. An input is given below The expected output is given below: As can be... (2 Replies)
Discussion started by: gimley
2 Replies

11. Cybersecurity

Whitelist, goodware, database of hashes

I have found this excellent site: NSRL Downloads (sorry if it was already mentioned) there are Solaris and Linux files there too. its all in a text file, over 11Gb large. (0 Replies)
Discussion started by: orange47
0 Replies

12. Shell Programming and Scripting

Remove inverted duplicates from a mapping database

My excuses for a Title which does not really describe what I need. My OS is Windows Vista/Windows7 I have a large database of homographs with the following structure: name=name variant i.e. a variant of a name is provided on a line separated by a =. An example will make this clear ... (1 Reply)
Discussion started by: gimley
1 Replies