Creating Table

  • CREATE TABLE 'Orders'

    ('Orderdate' VarChar(99999999999999999)NOT NULL default '',

    'Orderid' VarChar(999999999999999999999)NOT NULL default '',

    'Order_comments' VarChar(9999999999999999999)NOT NULL default '',

    'salesrep_customerid' VarChar(9999999999999999999)NOT NULL default '',

    'productcode' VarChar(9999999999999999999999)NOT NULL default '',

    'productname' VarChar(9999999999999999999999999)NOT NULL default '',

    'quantity' VarChar(999999999999999999)NOT NULL default '',

    'warehouselocation' VarChar(99999999999999999999)NOT NULL default '',)

    I need to have the fields be either letters or numbers with infinite length and also when i run this i get this ERROR

    Error

    SQL query:

    CREATE TABLE 'Orders'(

    'Orderdate'VARCHAR( 99999999999999999 ) NOT NULL DEFAULT '',

    'Orderid'VARCHAR( 999999999999999999999 ) NOT NULL DEFAULT '',

    'Order_comments'VARCHAR( 9999999999999999999 ) NOT NULL DEFAULT '',

    'salesrep_customerid'VARCHAR( 9999999999999999999 ) NOT NULL DEFAULT '',

    'productcode'VARCHAR( 9999999999999999999999 ) NOT NULL DEFAULT '',

    'productname'VARCHAR( 9999999999999999999999999 ) NOT NULL DEFAULT '',

    'quantity'VARCHAR( 999999999999999999 ) NOT NULL DEFAULT '',

    'warehouselocation'VARCHAR( 99999999999999999999 ) NOT NULL DEFAULT '',

    )

    MySQL said:

    #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''Orders'

    ('Orderdate' VarChar(99999999999999999)NOT NULL default '',

    'Orderid'' at line 1

  • This forum is for Microsoft SQL Server 2008 - not MySQL. You will probably get a better response from a forum dedicated to that product.

    As for your problem, there is no such thing as an 'infinite' data type. Each data type has a defined minimum and maximum value and is dependent upon the implementation. In SQL Server 2008 we could define a VARCHAR(MAX) which can be as large as 2GB of data.

    I don't know what MySQL offers for LOB data - so really cannot say what would be best for your situation.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply