Solved

SQLProcedure Function

Posted on 1998-05-15
8
639 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

840 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