Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.3/8.11.1) with SMTP id f2REUSw01960 for ; Tue, 27 Mar 2001 09:30:28 -0500 (EST) (envelope-from pgsql-interfaces-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.3/8.11.1) with ESMTP id f2QIe7w42067 for ; Mon, 26 Mar 2001 13:40:07 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f2QIYFb65967 for pgsql-interfaces@postgresql.org; Mon, 26 Mar 2001 13:34:15 -0500 (EST) (envelope-from news) From: "Mic" X-Newsgroups: comp.databases.postgresql.interfaces Subject: Datatypes in embedded SQL Date: Mon, 26 Mar 2001 20:35:05 +0200 Message-ID: <985631638.19816.0.pluto.c29fe0e4@news.demon.nl> X-NNTP-Posting-Host: sloten.demon.nl:194.159.224.228 X-Complaints-To: abuse@nl.demon.net X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Lines: 58 To: pgsql-interfaces@postgresql.org X-Archive-Number: 200103/194 X-Sequence-Number: 1356 Hey all. I've a question on embedded sql. Thing is, I'm trying to declare a struct in the embedded SQL part in my C program, but the preprocessor complains about an 'unknown data type in line 162'. Is it not possible at all in Postgres to declare a structure? I tried writing out the DBstruct in the SQL DECLARE section, that didn't work either. When i don't use the struct, passing 4 variables instead, all goes well. I Am using Postgres server 7.0.2, and the pgcl preprocessor, running under Mandrake Linux. Regards, Mic preveously defined: typedef struct { int line_nr, type; char nick[10], line[161]; } DBstruct; /* ------------------------------------------------------DBinsRecord-------- does : Inserts a line in the db args : return : error code (0 = ok) --------------------------------------------------------------------------- */ static int DBinsRecord ( DBstruct *Values ) { EXEC SQL BEGIN DECLARE SECTION; DBstruct *pRec = Values; EXEC SQL END DECLARE SECTION; EXEC SQL INSERT INTO channel (line_nr ,nick ,type ,line) VALUES ( :pRec->line_nr , :pRec->nick , :pRec->type , :pRec->line); return (sqlca.sqlcode); }