Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SQLProcedure Function

Posted on 1998-05-15
8
Medium Priority
?
644 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

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

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!

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

730 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