[SQL] function returning result set of varying column

2008-06-02 Thread maria s
Hi friends, I am very new to plsql. I have to write a function that quries few tables and returns a resultset of varying column. In that case I cannot predefine the table with column. If I use RETURNS SETOF then I should know the number of columns and its type?! Is there anyway to return a res

Re: [SQL] bcp.exe Fix Triggers

2008-06-02 Thread Tom Lane
"yazicivo" <[EMAIL PROTECTED]> writes: > The problem is, bcp.exe > - Uses nothing to specify null fields, which is equivalent to > COPY ... WITH NULL AS '' > in PostgreSQL. > - Uses \x00 character to specify empty strings. Ugh. You're going to have to fix the null-char problem externally -

Re: [SQL] bcp.exe Fix Triggers

2008-06-02 Thread Joe
yazicivo wrote: But executing this procedure fails for some reason I couldn't understand. > SELECT public.create_bcp_fix_triggers('commsrv'); ERROR: syntax error at or near "AS $" LINE 4: RETURNS "trigger" AS $bcp-fix$ ^ Use an underscore (_) instead of a m

[SQL] bcp.exe Fix Triggers

2008-06-02 Thread yazicivo
Hi, I'm trying to import some relatively huge (~300GiB) set of data from Microsoft SQL Server database to PostgreSQL. For this purpose, I use bcp.exe (bulk copy utility) comes with MSSQL. Despite there are command line arguments which you can specify batch size, escape characters, null fields, etc