Re: Ejecutar copy con stdin en vb6

From: Gilberto Castillo Martínez <gilberto(dot)castillo(at)etecsa(dot)cu>
To: Lista - PostgreSQL <pgsql-es-ayuda(at)postgresql(dot)org>
Subject: Re: Ejecutar copy con stdin en vb6
Date: 2011-10-11 17:04:53
Message-ID: 1318352693.19306.92.camel@gilbertoc.mtcorp.etecsa.cu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-es-ayuda

El mar, 11-10-2011 a las 17:32 +0100, Alejandro Carrillo escribió:
> Si lo soporta:
>
>
> Dim c As ADODB.Connection
> Dim cmd As ADODB.Command
> Dim std As clsStdIO
> Set c = New ADODB.Connection
> Set std = New clsStdIO
> Set cmd = New ADODB.Command
> c.Open "Provider=MSDASQL.1;Persist Security Info=False;Extended
> Properties=""DRIVER={PostgreSQL
> Unicode};DATABASE=postgres;SERVER=172.18.22.101;PORT=5432;UID=postgres;pwd=Aa987;SSLmode=disable;ReadOnly=0;Protocol=7.4-1;FakeOidIndex=0;ShowOidColumn=0;RowVersioning=0;ShowSystemTables=0;ConnSettings=;Fetch=100;Socket=4096;UnknownSizes=0;MaxVarcharSize=255;MaxLongVarcharSize=8190;Debug=0;CommLog=0;Optimizer=0;Ksqo=1;UseDeclareFetch=0;TextAsLongVarchar=1;UnknownsAsLongVarchar=0;BoolsAsChar=0;Parse=0;CancelAsFreeStmt=0;ExtraSysTablePrefixes=dd_;LFConversion=1;UpdatableCursors=1;DisallowPremature=0;TrueIsMinus1=0;BI=0;ByteaAsLongVarBinary=0;UseServerSidePrepare=0;LowerCaseIdentifier=0;GssAuthUseGSS=0;XaOpt=1"""
> cmd.ActiveConnection = c
> 'cmd.Parameters.Append cmd.CreateParameter(, adLongVarWChar,
> adParamInput, 4000, "hola;jaja")
> cmd.CommandText = "COPY dato FROM stdin"
> cmd.Execute
>
Dos ejemplos de la Orden COPY
COPY dato FROM "/path/to/file" USING DELIMITERS '\t' WITH NULL AS
'NULL';

COPY (SELECT * FROM tabla WHERE valor LIKE '%') TO "/path/to/file.csv"
WITH NULL AS 'NULL' CSV HEADER QUOTE AS '"';

--
Saludos,
Gilberto Castillo
Edificio Beijing. Miramar Trade Center. Etecsa.
Miramar, La Habana.Cuba.

Attachment Content-Type Size
unknown_filename text/plain 179 bytes

In response to

Responses

Browse pgsql-es-ayuda by date

  From Date Subject
Next Message CarloS Sing Ramos 2011-10-11 17:07:34 Re: Ayuda con funciones
Previous Message Rodrigo Gonzalez 2011-10-11 17:04:27 Re: Ayuda con funciones