Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7700095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T22:37:41+00:00 2026-05-31T22:37:41+00:00

My question may be stupid but I have a 2 days experience in MYSQL.

  • 0

My question may be stupid but I have a 2 days experience in MYSQL. I’m trying to use MyTAP for unit testing and face a problem .

here’s the SQL code exucted on a mysql console:

drop procedure  IF EXISTS tap.tstTableCount;
delimiter //

CREATE PROCEDURE tap.tstTableCount (IN db CHAR(64), IN tbl CHAR(64))
  BEGIN
    DECLARE l_sql VARCHAR (4000);
    SET l_sql=CONCAT('SELECT COUNT(*)>0 FROM ',db,'.',tbl,';');

    SET @sql=l_sql;
    PREPARE s1 FROM @sql;
    EXECUTE s1;
    DEALLOCATE PREPARE s1;

  END //

delimiter ;

call tap.tstTableCount('storibo','relationCategory'); /* This call works fine and returns 1 (true)*/

SELECT tap.ok( 
    tap.tstTableCount('storibo','relationCategory'), 
    'relationCategory contains data' 
); /* this one returns :
ERROR 1305 (42000): FUNCTION tap.tstTableCount does not exist */

is it an issue with the MyTAP fmk or do I make a mistake in my syntax ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T22:37:42+00:00Added an answer on May 31, 2026 at 10:37 pm

    The problem is your tap.tstTableCount is a PROCEDURE and not a FUNCTION. All the MyTAP tests are are FUNCTIONS, as noted by being able to call it in a SELECT statement. You cannot call a PROCEDURE from a SELECT statement, instead needing to call it via:

    CALL tap.tstTableCount();
    

    Unfortunately, your example is one that cannot simply be converted to a FUNCTION to be used by the mytap functions. Dynamic SQL is not permitted in FUNCTION, but is allowed in PROCEDURE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question may seem stupid, but, so be it! I have a stupid problem
This may be a stupid question but I have a code with the following
This may be a stupid question, but I have to ask! I have the
My question may appear really stupid for some of you but i have to
I know this may be a stupid question to ask but I have really
may be i am going to ask some stupid question but i don't have
This may be an incredibly stupid question, but I have a web application that
This may be a stupid question but ... If I use JQuery .load(); etc
The question's title may sound stupid, but I have beenw wondering about the following
this may seem like a stupid question but I have a query string which

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.