pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sandro Yaqub Yusuf <sandro@proservvi.com.br>
To: pgsql-odbc@postgresql.org
Subject: Thanks - Part One - Re: Executing SP in VB6
Date: Tue, 5 Oct 2004 11:35:11 -0300
Message-ID: <002d01c4aae8$851e0c10$9414a8c0@proservvi.com.br> (raw)
References: <6C0CF58A187DA5479245E0830AF84F4208041D@poweredge.attiksystem.ch>

Hello my dears friends,

Thanks for yours colaborations.

It´s here the part of solution about my problem with colaboration of 
everbody that help me (Philippe Lang, Iain, Andrew Ayers, Rick Sivernell, 
Corey W. Gibbs):

---------------------------------------------------------------------------------------------------------------------------------------

POSTGRESQL:

CREATE OR REPLACE FUNCTION sp_user_search(varchar)
  RETURNS SETOF user AS
' select * from user where user = $1'
  LANGUAGE 'sql' VOLATILE;

---------------------------------------------------------------------------------------------------------------------------------------

VISUAL BASIC 6 with ADO 2.8 without STORED PROCEDURE:

Dim adoBD As ADODB.Connection
Dim rsTB    As New ADODB.Recordset

 Set adoBD = New ADODB.Connection

 adoBD.ConnectionString = 
"driver=PostgreSQL};server=localhost;database=SICCEV;port=5432;uid=ryan;pwd=displace;"
adoBD.Open

Set rsTB = adoBD.Execute("select * from user where user = 'Sandro';")

Do While Not rsTB.EOF
       MsgBox rsTB!Usuario

       rsTB.MoveNext
Loop

rsTB.Close
adoBD.Close

RESULT OF EXECUTION: Sandro Yaqub Yusuf

---------------------------------------------------------------------------------------------------------------------------------------

VISUAL BASIC 6 with ADO 2.8 with STORED PROCEDURE:

Dim adoBD As ADODB.Connection
Dim rsTB    As New ADODB.Recordset

Set adoBD = New ADODB.Connection

adoBD.ConnectionString = 
"driver=PostgreSQL};server=localhost;database=SICCEV;port=5432;uid=ryan;pwd=displace;"
adoBD.Open

Set rsTB = adoBD.Execute("select sp_user_search('Sandro');")

Do While Not rsTB.EOF
       MsgBox rsTB(0)

       rsTB.MoveNext
Loop

rsTB.Close
adoBD.Close

RESULT OF EXECUTION: (1,Sandro,123,"Sandro Yaqub Yusuf")

---------------------------------------------------------------------------------------------------------------------------------------

The question is how I do for to isolate the columns when come 
(1,Sandro,123,"Sandro Yaqub Yusuf"). I would like to get only the column 
FULLNAME using the STORED PROCEDURE. Have I do a function in VB for to 
isolate the RESULTS of STORED PROCEDURES in POSTGRESQL ?

Thanks more one times...

Sandroyy




view thread (4+ messages)  latest in thread

Message-ID: <002d01c4aae8$851e0c10$9414a8c0@proservvi.com.br>
Permalink:  ../002d01c4aae8$851e0c10$9414a8c0@proservvi.com.br/
Also on:    postgresql.org/message-id/002d01c4aae8$851e0c10$9414a8c0@proservvi.com.br

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: sandro@proservvi.com.br
  Subject: Re: Thanks - Part One - Re: Executing SP in VB6
  In-Reply-To: <002d01c4aae8$851e0c10$9414a8c0@proservvi.com.br>
  References: <6C0CF58A187DA5479245E0830AF84F4208041D@poweredge.attiksystem.ch> <002d01c4aae8$851e0c10$9414a8c0@proservvi.com.br>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox