Received: from web12504.mail.yahoo.com (web12504.mail.yahoo.com [216.136.173.196]) by postgresql.org (8.11.3/8.11.1) with SMTP id f3G2dhu73181 for ; Sun, 15 Apr 2001 22:39:43 -0400 (EDT) (envelope-from lonnie_cumberland@yahoo.com) Message-ID: <20010416023939.96139.qmail@web12504.mail.yahoo.com> Received: from [141.217.140.65] by web12504.mail.yahoo.com; Sun, 15 Apr 2001 19:39:39 PDT Date: Sun, 15 Apr 2001 19:39:39 -0700 (PDT) From: Lonnie Cumberland Subject: retrieving multiple results? To: pgsql-interfaces@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200104/55 X-Sequence-Number: 1438 Hello All, I am still trying to figure out the VARDATA stuff so that I can take two char strings and do a character-by-character comparison. This type of questions is really related to the previous email where I an trying to use my old function that had character pointers to translate one character string into another, but now I have to look at using the VARDATA() wrappers. My other problem is that I have a structure in my C code that has two character fields and I need to operate on them in C and then return the structure to PL/pgSQL calling function with two results. for example I might have something like: typedef struct testmode { char val1[100]; char val2[100]; } testmode; then maybe a function that could be like this: testmode *work(char *name, int someval) { testmode *result; char v1[100]; char v2[100]; char v3[100]; strcpy(v3,name); val1[0]='x'; val2[0]='y'; if(val2[0]==val1[1]) { val1[1]='s'; strcpy(result->val1,'good'); strcpy(result->val2,'good'); } else { strcpy(result->val1,'good'); strcpy(result->val2,'good'); } return result; } Although this little function does not do anything very useful, it does exhibit everythin that I will need to try and implement in my extension "C" functions so if there is anybody who could show me how to use the VARDATA() stuff and also return a structure to my calling function in PL/pgSQL then I would REALLY appreciate it. __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/