Stored procedures in MS SQL 7.0

Can one get from Delphi all results of the stored procedure in MS SQL 7.0, which returns multiple recordset?
kolodAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RBertoraCommented:
Listening..
0
simonetCommented:
Just use a TStoredProc and link it to a TDataSource.

in the TStoredProc, you must set at least these properties:

Databasename, StoredProcName and Params (this one can be set in Runtime )

Then simply set the Active property to true.

Yours,

Alex
0
AndyDCommented:
TStoredProc won't work for multiple record sets. The way to do it is to drop a TQuery on to your form, point it at the database in question the set the SQL text of the Query to :-

Select * From MyStoredProc;

You can then point a datasource and data-aware controls to it.

Regards,


Andy
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

kolodAuthor Commented:
Hi Andy

I tried to do as you said, but I've got a message:
" Table not Exist "MyStroredProc" "
(of course there stayed the name of my stored proc)

Thanks
0
karooCommented:
concur with Andy,
Query is the best way to do this.

Kolod:
The only way i can reproduce "Table does not exist..." is if my SP name is wrong.
See if you can do this: use WISQL or database explorer, connect to your DB and run the SP from there (SELECT * FROM "mystoredproc")
0
karouriCommented:
Listening..
0
guntherdsCommented:
multiple recordsets can't be returned in one recordset, I think it's possible by using ADO, but I'm not sure
0
AndyDCommented:
Have you missed any parameters when you called your SP?
0
yk030299Commented:
how about create the stored procedure by sa?
because dbo.spname & someuser.spname will have difference result in M$-SQL
0
TAZICommented:
Hi..

Well, I had a problem with Delphi and SQL 7.0.  There is a problem in regard to the TStored Procedure Component.  I get the results via a TQuery Component. I put the Stored Procedure Name in the TStrings of the TQuery Component e.g)

sp_GetResults :0,:1

sp_GetResults is the name of the Stored Procedure and it has 2 parameters that need to be passed to it in order to get the results.  Then in the Params property, select whether your parameters are is Input, Result, Output etc.

To Run the proc..do the ffg. Assume the TQuery Component is called Query1.
Query1.Close;
Query1.params[0].asString := Value To Input (Parameter 1)
Query1.params[1].asString := Value To Input (Parameter 2)
Query1.Open;

This works 100 % . . . I use it all the time.

Also...there are 2 files that need to be updated.
<sqlmss32.dll>
<dbx.dbi>

This <dbx.dbi> file is in the ffg directory \\ProgramFiles\Borland\Delphi4.0\Bin

The <sqlmss32.dll> file is in
\\CommonFiles\BDE

The updated files can be downloaded from
ftp://www.synetics.co.za/pub/.

If it is unavailable please let me know what you email address is and I can email them to you.

Hope you understand what I am saying

Regards
Tazi



0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.