Subject RE: [IBO] TIB_StoredProc ISC ERROR MESSAGE - multiple rows in singleton select-
Author Myles Wakeham
Here's an easy answer to your problem:

http://www.open-database.de/phorum/read.php?f=7&i=298&t=298

Myles

===========================
Myles Wakeham
Director of Engineering
Tech Solutions Inc.
Scottsdale, Arizona USA
Phone (480) 451-7440
Web: www.techsol.org



> -----Original Message-----
> From: Daniel Jimenez [mailto:d.jimenez@...]
> Sent: Wednesday, October 20, 2004 10:06 PM
> To: IBObjects@yahoogroups.com
> Subject: [IBO] TIB_StoredProc ISC ERROR MESSAGE - multiple
> rows in singleton select-
>
>
> Hi,
>
> I am having some probs with TIB_StoredProc.
>
> I have written a search execute procedure which will MAY return 0..*
> records. Because of the multiple records it may return, I have set the
> StoredProcForSelect = true; prior to ExecProc() However, I
> still get the
> following error:
>
> Code ERROR:335544652
>
> ISC ERROR MESSAGE
> multiple rows in singleton select
> '.Process stopped...
>
>
> The function looks like:
>
>
> void __fastcall TdmCVPasswordDB::SearchForRecords(const TLolgPwdFields
> &AStruct)
> {
> ConnectDB();
> HideColumns();
> UnPrepareSql();
>
> // Set the execute procedure to be used.
> stpCVDBStoreProcedure->StoredProcName = FSearchProcedure;
>
> // Populate the parameters.
> stpCVDBStoreProcedure->ParamByName("R_CREATED_BY_IN")->AsString =
> AStruct.lpfCurrentUser;
> stpCVDBStoreProcedure->ParamByName("R_SHARED_IN")->AsInteger =
> AStruct.lpfShared;
>
> PrepareSql();
>
> // Possibly returning multiple records.
> stpCVDBStoreProcedure->StoredProcForSelect = true;
> stpCVDBStoreProcedure->ExecProc(); // Exception takes place here
> }
>
> This is what the procedure looks like:
>
> SET TERM ^^ ;
> CREATE PROCEDURE P_LOGPAS_SEARCH (
> R_CREATED_BY_IN VarChar(255),
> R_SHARED_IN SmallInt)
> returns (
> R_ID Integer,
> R_CREATED_BY VarChar(255),
> R_LOGIN VarChar(255),
> R_PASSWORD VarChar(255),
> R_URL VarChar(255),
> R_CREATED Date,
> R_MODIFIED Date,
> R_SHARED SmallInt,
> R_PRIMARY VarChar(32),
> R_SECONDARY VarChar(32),
> R_COMMENTS VarChar(1024),
> R_FILE_NAME VarChar(255))
> AS
> begin
> if( :R_SHARED_IN = 0 )then
> begin
> SELECT R_ID,
> R_CREATED_BY,
> R_LOGIN,
> R_PASSWORD,
> R_URL,
> R_CREATED,
> R_MODIFIED,
> R_SHARED,
> R_PRIMARY,
> R_SECONDARY,
> R_COMMENTS,
> R_FILE_NAME
> FROM LOGPAS
> WHERE ((R_CREATED_BY = :R_CREATED_BY_IN) AND ( R_SHARED =
> :R_SHARED_IN))
> INTO
> :R_ID,
> :R_CREATED_BY,
> :R_LOGIN,
> :R_PASSWORD,
> :R_URL,
> :R_CREATED,
> :R_MODIFIED,
> :R_SHARED,
> :R_PRIMARY,
> :R_SECONDARY,
> :R_COMMENTS,
> :R_FILE_NAME;
> end
> else
> if( :R_SHARED_IN = 1 )then
> begin
> SELECT
> R_ID,
> R_CREATED_BY,
> R_LOGIN,
> R_PASSWORD,
> R_URL,
> R_CREATED,
> R_MODIFIED,
> R_SHARED,
> R_PRIMARY,
> R_SECONDARY,
> R_COMMENTS,
> R_FILE_NAME
> FROM LOGPAS
> WHERE ((R_CREATED_BY = :R_CREATED_BY_IN) OR ( R_SHARED =
> :R_SHARED_IN))
> INTO
> :R_ID,
> :R_CREATED_BY,
> :R_LOGIN,
> :R_PASSWORD,
> :R_URL,
> :R_CREATED,
> :R_MODIFIED,
> :R_SHARED,
> :R_PRIMARY,
> :R_SECONDARY,
> :R_COMMENTS,
> :R_FILE_NAME;
> end
> end
> ^^
> SET TERM ; ^^
>
> Hope that you may spot the problem
>
> danieL
> ____________________________
> Comvision Pty. Ltd.
>
> www.comvision.net.au
>
>
>
> ------------------------ Yahoo! Groups Sponsor
> --------------------~-->
> $9.95 domain names from Yahoo!. Register anything.
> http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/PhFolB/TM
> --------------------------------------------------------------
> ------~->
>
> ______________________________________________________________
> _____________
> IB Objects - direct, complete, custom connectivity to
> Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
> ______________________________________________________________
> _____________
> http://www.ibobjects.com - your IBO community resource for
> Tech Info papers,
> keyword-searchable FAQ, community code contributions and more
> !
> Yahoo! Groups Links
>
>
>
>
>
>
>