X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 034D632A0A5 for ; Tue, 5 Oct 2004 18:53:27 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95784-01 for ; Tue, 5 Oct 2004 17:53:17 +0000 (GMT) Received: from prata.proservvi.com.br (unknown [200.232.120.179]) by svr1.postgresql.org (Postfix) with ESMTP id 054E0329F4F for ; Tue, 5 Oct 2004 18:53:15 +0100 (BST) Received: from localhost (localhost.localdomain [127.0.0.1]) by prata.proservvi.com.br (Postfix) with ESMTP id 1B4E93B329 for ; Tue, 5 Oct 2004 14:52:49 -0300 (BRT) Received: from sandroyy (unknown [192.168.20.148]) by prata.proservvi.com.br (Postfix) with SMTP id B9C1F3B2FE for ; Tue, 5 Oct 2004 14:52:47 -0300 (BRT) Message-ID: <000601c4ab04$8a861b40$9414a8c0@proservvi.com.br> From: "Sandro Yaqub Yusuf" To: References: <4162C864.5060703@eldocomp.com> Subject: Re: Thanks - Part One - Re: Executing SP in VB6 Date: Tue, 5 Oct 2004 14:55:46 -0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by AMaViS 0.3.12pre8 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=EXCUSE_16, LINES_OF_YELLING X-Spam-Level: X-Archive-Number: 200410/57 X-Sequence-Number: 4532 Hello Andrew... I already tried to do that, but it didn't work. PostGresQL return me a ERROR saying that the syntax was invalidates. But thank you even so for the help. Sandroyy ----- Original Message ----- From: "Andrew Ayers" To: "Sandro Yaqub Yusuf" Sent: Tuesday, October 05, 2004 1:14 PM Subject: Re: Thanks - Part One - Re: [ODBC] Executing SP in VB6 I have never done any of this, but looking at your code, it seems that you would want to change the select in the stored procedure to something like: 'SELECT usuario FROM user WHERE user = $1' This should only return the full user name as desired, I think. Unless you are wanting something more "generalized", so you can do 'SELECT *', then isolate a column (any one of them, however many there are) from the result set - I am certain there is a way to do it, but having never played around with this, I am unable to offer much more advice. Andrew Ayers Sandro Yaqub Yusuf wrote: > 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 > > > ---------------------------(end of broadcast)--------------------------- > TIP 8: explain analyze is your friend > > > -- CONFIDENTIALITY NOTICE -- This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email, and delete the message. Thank you.