help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: octave-swig-database-1.0.4 - data entry into database table


From: Olaf Till
Subject: Re: octave-swig-database-1.0.4 - data entry into database table
Date: Sun, 10 Feb 2013 23:24:19 +0100
User-agent: Mutt/1.5.20 (2009-06-14)

On Sun, Feb 10, 2013 at 08:13:09PM +0000, richard wrote:
> Hi all, 
> 
> Getting data from a table seems simple when compared with
> output of data from octave into a table. As a first attempt 
> something like this might work except postgres wants 
> newlines and octave dislikes backslashes. 
> 
> > sql("copy rome001 (year, l_pay, legion_pay, legions, Army_pay) from stdin;  
> > 3 4 5 6 7 \."); 
> 
> Has anyone used something similar to this successfully? 

I'm fairly sure that neither this nor anything similar, nor the 'copy'
command at all, can have worked with the old database package which
you refer to.

There is a new database package (version 2.0.0) with working
postgresql support, but different commands. Converting data directly
from Octave values into a table is supported for sql-commands except
'copy', with placeholders ($1, $2, ... see help of
pq_exec_params). For 'copy ... from stdin' there are some problems so
this is currently only supported from files. You could use 'insert'
statements as an alternative to 'copy ... from stdin'. If this is too
slow, maybe combining with 'prepare' can help.

Olaf

(BTW: I purpously didn't honour your REPLY TO header since the address
seemed weird to me and that server didn't even react to ping.)

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]