Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQLProcedure Function

Posted on 1998-05-15
8
Medium Priority
?
647 Views
Last Modified: 2013-11-20
Hello:

I am using Visual C++ 5.0 and MS SQL Server 6.5.
When I use "SELECT  * FROM  sysobjects WHERE type = 'P'" ststement to list all of the procedure in
my database, I get following result:

dt_getobjwithprop              2815072         1      P   ....
dt_getpropertiesbyid         18815129       1      P  ....
dt_setpropertybyid             34815186       1      P  ....
delete_template                 1976394110   1      P   ....
delete_tables                      2020918271  1      P  ....

But When I use SQLProcedure(hstmt,NULL,0,NULL,0NULL,0) function to list all of the procedure in
my VC Application. only first three can be list out.

Why the result is differnet. How can I list all of the procedure in my database in VC?

Thanks for your help.

Jinsong Liu

E-Mail : Jinsongliu@usa.net

0
Comment
Question by:jinsong
  • 5
  • 3
8 Comments
 
LVL 3

Expert Comment

by:tma050898
ID: 1311555
SQLProcedures will ONLY return rows for procedures that have at least one argument. ODBC considers procedures that take zero arguments to be views and not procedures.

HTH,
Tom

0
 

Author Comment

by:jinsong
ID: 1311556
But when I run odbctest program that come with ODBC SDK. It can list all of the procedure. How they did it. Or do you have any suggestion?

Thanks

Jinsong Liu
0
 
LVL 3

Expert Comment

by:tma050898
ID: 1311557
I see what you mean. However, with the documentations stating that procedures with 0 args are not returned when SQLProcedures is called and the odbc demo returning them all I would have to imagine that they are running an SQL query against directly against a catalog, or system table as you did when you originally were able to retrieve all of the procs.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jinsong
ID: 1311558
tma:

I can not agree your imagination. I think your answer for why I can not list all of them is correct. But I am sure I can list all of them by just using ODBC call, I just do not know how to do it. So I reopen this question for everybody. If no body can point me out. I will come back to Grade your answer. If somebody can point me out, I will repost this question with 50 points for you then i can give the credit to you.

Thank you very much

Jinsong Liu
0
 
LVL 3

Expert Comment

by:tma050898
ID: 1311559
No problem. I tested it with a couple of databases and basically got the same results as you did. Hopefully, someone can shed some light on this.
0
 

Author Comment

by:jinsong
ID: 1311560
Tma:

I am going to give this 100 points to you please come in.

Jinsong

0
 
LVL 3

Expert Comment

by:tma050898
ID: 1311561
I know you thought that the dox were wrong. Were you ever able to find out how the sample does it? Sorry. We've been in deadline hell here at work, so I haven't been able to do anything more on it.
0
 
LVL 3

Accepted Solution

by:
tma050898 earned 300 total points
ID: 1311562
Hi Jinsong,

Here's my resubmittal of the answer that you requested...

According to the documentation, SQLProcedures will ONLY return rows for procedures that have at least one argument. ODBC considers procedures that take zero arguments to be views and not procedures.

Tom
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question