X-Original-To: pgsql-interfaces@postgresql.org Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 924B447580B for ; Thu, 20 Feb 2003 08:32:54 -0500 (EST) Received: from postgresql.org ([64.49.215.8]) by localhost (postgresql.org [64.49.215.8:10024]) (amavisd-new) with SMTP id 77974-02 for ; Thu, 20 Feb 2003 08:32:43 -0500 (EST) Received: from fzkmail2.fzk.de (fzkmail2.fzk.de [141.52.27.52]) by postgresql.org (Postfix) with SMTP id 2FDC8474E5C for ; Thu, 20 Feb 2003 08:32:43 -0500 (EST) Received: FROM resy5.fzk.de BY fzkmail2.fzk.de ; Thu Feb 20 14:32:44 2003 +0100 Received: œby rodos.fzk.de with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id OAA01372 for ; Thu, 20 Feb 2003 14:32:44 +0100 (MET) Message-ID: <3E54D8FB.DE09FD3C@rodos.fzk.de> Date: Thu, 20 Feb 2003 14:32:44 +0100 From: Christoph Haller X-Mailer: Mozilla 4.77 [en] (X11; U; HP-UX B.10.20 9000/780) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: structured host variable arrays within ecpg Content-Type: text/plain; charset=iso-8859-2 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new X-Archive-Number: 200302/86 X-Sequence-Number: 3707 I am porting a large C-coded application from ALLBASE SQL (the HP-UX DBMS) to PostgreSQL. The code makes frequent use of embedded SQL. My intention was to skip all the static stuff and replace it by dynamic calls to libpq. So far so good, it went pretty well and the application is running with postgres now. But I have to face a massive lack of performance, especially on INSERTs. I know there is lot of overhead done, if you are going to process let say 500 insert commands. Using COPY is not really an option. So I was trying to re-use embedded statements, but I had to face the fact that ecpg cannot deal with structured host variable arrays the way I expected. Example: EXEC SQL INSERT INTO ASimple_Values ( Primary_Key, List_Pointer, Parameter_Name, Parameter_Code, Parameter_Value, Source_Type ) VALUES ( :ASimple_Values[SQL_ii].primary_key, :ASimple_Values[SQL_ii].value_list_ptr, :ASimple_Values[SQL_ii].parameter_name, :ASimple_Values[SQL_ii].parameter_code, :ASimple_Values[SQL_ii].value, :ASimple_Values[SQL_ii].source_type ); ERROR: parse error, unexpected '[', expecting ')' or ',' at or near "[" I'm using 7.2.3 and I've found in 7.3 a slightly improved documentation on ecpg, but I still cannot figure out if something like the above is legal within 7.3. Are there other alternatives to process inserts on a BULK INSERT basis (that's the feature ALLBASE was offering)? Thanks for your time. Regards, Christoph