Solved

SQLProcedure Function

Posted on 1998-05-15
8
641 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
Independent Software Vendors: 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 100 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 134
CRON statement to run every 3 minutes except on Monday morning 12am to 2am 7 111
Hibernate methods 2 83
sumHeights2  challenge 7 129
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

679 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