ODBC and COPY

From: Michael Fork <mfork(at)toledolink(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: ODBC and COPY
Date: 2001-01-16 06:02:32
Message-ID: Pine.BSI.4.21.0101160102110.29498-100000@glass.toledolink.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-interfaces


From mfork(at)toledolink(dot)com Tue Jan 16 01:02:08 2001

I have been attempting to use the COPY command in an ADO connection,
but receive the following error:

Error while executing the query;
Unexpected protocol character from backend (send_query)

This is PostgreSQL 7.0.2 on i386-unknown-openbsd2.8, compiled by cc with
the 6.5 version of the PostgresSQL ODBC driver. The code that produces
the error is as follows:

cnRemoteDB.Execute "COPY tbldirectory FROM stdin " _
& "USING DELIMITERS '|' WITH NULL AS '' "

I am curious if anyone has gotten COPY to work thru the ODBC driver, and
if possible, a code snippet that I can use as a guide.

Thanks

Michael Fork - CCNA - MCP - A+
Network Support - Toledo Internet Access - Toledo Ohio

Here is the log from the ODBC driver.....

conn=189532284, SQLDriverConnect( in)='DSN=FHP -- Test;',
fDriverCompletion=0
DSN info: DSN='FHP --
Test',server='192.168.1.1',port='5432',dbase='fhp',user='mfork',passwd='XXXXXXX'

onlyread='0',protocol='6.4',showoid='0',fakeoidindex='0',showsystable='0'
conn_settings=''
translation_dll='',translation_option=''
Global Options: Version='06.50.0000', fetch=100, socket=4096,
unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=8190
disable_optimizer=1, ksqo=1, unique_index=1,
use_declarefetch=1
text_as_longvarchar=1, unknowns_as_longvarchar=0,
bools_as_char=1
extra_systable_prefixes='dd_;', conn_settings=''
conn=189532284, query=' '
conn=189532284, query='set DateStyle to 'ISO''
conn=189532284, query='set geqo to 'OFF''
conn=189532284, query='set ksqo to 'ON''
conn=189532284, query='BEGIN'
conn=189532284, query='declare SQL_CUR0B4C413C cursor for select oid from
pg_type where typname='lo''
conn=189532284, query='fetch 100 in SQL_CUR0B4C413C'
[ fetched 0 rows ]
conn=189532284, query='close SQL_CUR0B4C413C'
conn=189532284, query='END'
conn=189532284, SQLDriverConnect(out)='DSN=FHP --
Test;DATABASE=fhp;SERVER=192.168.1.1;PORT=5432;UID=mfork;PWD=XXXX;READONLY=0;PRO
TOCOL=6.4;FAKEOIDINDEX=0;SHOWOIDCOLUMN=0;ROWVERSIONING=0;SHOWSYSTEMTABLES=0;CONN
SETTINGS='
conn=189532284, query='BEGIN'
conn=189532284, query='DELETE FROM tbldirectory WHERE prov_id > -1'
conn=189532284, query='COPY tbldirectory FROM stdin USING DELIMITERS '|'
WITH NULL AS '' '
STATEMENT ERROR: func=SC_execute, desc='', errnum=1, errmsg='Error while
executing the query'

------------------------------------------------------------
hdbc=189532284, stmt=189546812, result=0
manual_result=0, prepare=0, internal=0
bindings=0, bindings_allocated=0
parameters=0, parameters_allocated=0
statement_type=-1, statement='COPY tbldirectory FROM
stdin USING DELIMITERS '|' WITH NULL AS '' '
stmt_with_params='COPY tbldirectory FROM stdin USING
DELIMITERS '|' WITH NULL AS '' '
data_at_exec=-1, current_exec_param=-1, put_data=0
currTuple=-1, current_col=-1, lobj_fd=-1
maxRows=0, rowset_size=1, keyset_size=0, cursor_type=0,
scroll_concurrency=1
cursor_name='SQL_CUR0B4C413C'
----------------QResult Info
-------------------------------
CONN ERROR: func=SC_execute, desc='', errnum=106, errmsg='Unexpected
protocol character from backend (send_query)'
------------------------------------------------------------
henv=190579152, conn=189532284, status=1, num_stmts=16
sock=190578836, stmts=190578876, lobj_type=-999
---------------- Socket Info -------------------------------
socket=432, reverse=0, errornumber=0, errormsg='(NULL)'
buffer_in=189538612, buffer_out=189542712
buffer_filled_in=1, buffer_filled_out=0, buffer_read_in=1
conn=189532284, SQLDisconnect

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 2001-01-16 06:27:09 Re: ODBC and COPY
Previous Message Michael Fork 2001-01-16 05:36:59 ODBC and COPY FROM