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 8494829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:24:18+00:00 2026-06-10T23:24:18+00:00

What is the best way to check if table exists in DynamoDb? I would

  • 0

What is the best way to check if table exists in DynamoDb?

I would appreciate it if the code would be in PHP.

Either active or not.

* Added later as an example to various cases for error code 400

It’s very easy to check if the table exist, it can have one of the following
TableStatus => CREATING, ACTIVE, DELETING or UPDATING

but in case i get error 400 it can mean more than one thing.

1) sent null string as a table name by mistake.

[x-aws-body] => {“TableName”:””}
)

[body] => CFSimpleXML Object
    (
        [__type] => com.amazon.coral.validate#ValidationException
        [message] => The paramater 'tableName' must be at least 3 characters long and at most 255 characters long
    )

[status] => 400

2) syntax error in the command sent to DynamoDB, for example writting tabel_name instead of table_name.

[x-aws-body] => {“TabelName”:”test7″}
)

[body] => CFSimpleXML Object
    (
        [__type] => com.amazon.coral.validate#ValidationException
        [message] => The paramater 'tableName' is required but was not present in the request
    )

[status] => 400

3) I would guess but didn’t check, if I exceed at that same time the provisioned capacity on the table.

  • 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-06-10T23:24:20+00:00Added an answer on June 10, 2026 at 11:24 pm

    You can have a look at “describe_table” of the official PHP SDK. 400 means “does not exist” There is a pretty extensive example in the official documentation. Look at how it is used in the “delete” example, right at the bottom.

    http://docs.amazonwebservices.com/amazondynamodb/latest/developerguide/LowLevelPHPTableOperationsExample.html

    Here is the (stripped) example from the doc

    <?php
    require_once dirname(__FILE__) . '/sdk/sdk.class.php';
    
    $dynamodb = new AmazonDynamoDB();
    $table_name = 'ExampleTable';
    $response = $dynamodb->describe_table(array('TableName' => $table_name));
    
    if((integer) $response->status !== 400)
    {
        $error_type = $response->body->__type;
        $error_code = explode('#', $error_type)[1];
        if($error_code == 'ResourceNotFoundException')
        {
            echo "Table ".$table_name." exists.";
        }
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Whats the best way to check if a username exists in a MySQL table?
I would like to know the best way to check one table of data,
What's the best way to check if a table exists in a Sql database
What is the best way to check if a table exists in MySQL (preferably
What would be the best way to check unread messages from mysql table... I
What would be the best way to ask Propel to check whether existing object
I am looking for the best way to check that a database login exists
I'd like to know what would be the best way to store IPs (not
What is the best way to check if a DLL file is a Win32
What is the best way to check collision of huge number of circles? It's

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.