Why primaru key instace is null

when i send parameters values of
create method (create("suman","kumar")) through client file, it inserts data correctly in table
but it gives following error(Table stru:- (id int auto_increment primary key, fname varchar(20), lname varchar(20)):-
javax.ejb.CreateException: Primary key for created instance is null.
at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStoreManager.java:520)
at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersistenceManager.java:208)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.createEntity(CachedConnectionInterceptor.java:269)
at org.jboss.ejb.EntityContainer.createHome(EntityContainer.java:736)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(

Now if primary key does not allow NULL value in column than why it is allow to create primary key on newly created table?
The table does not have any rows, so there is no NULL value.
If you would have inserted a NULL value first, and try to create the primary key afterwards, the primary key would not be created.
sql> create table test1 (id number)
  2  /
Table created.
sql> alter table test1 add constraint test1_pk primary key (id)
  2  /
Table altered.
sql> insert into test1(id) values (null)
  2  /
insert into test1(id) values (null)
ERROR at line 1:
ORA-01400: cannot insert NULL into ("P1EMDA"."TEST1"."ID")
sql> alter table test1 drop primary key
  2  /
Table altered.
sql> insert into test1(id) values (null)
  2  /
1 row created.
sql> alter table test1 add constraint test1_pk primary key (id)
  2  /
alter table test1 add constraint test1_pk primary key (id)
ERROR at line 1:
ORA-01449: column contains NULL values; cannot alter to NOT NULL
sql> drop table test1
  2  /
Table dropped.

Similar Messages

  • Exception: Error decoding message (Key cannot be null)

    Hi guys,
         Coherence 3.3.1/389
         .Net API 3.3.1.2
         I've wrote small invocation task, which collects the info about cluster members, stores it to HashMap and return it as result. This is the code:
         NamedCache cache = CacheFactory.getCache(sCacheName);
         CacheService service = cache.getCacheService();
         Cluster cluster = service.getCluster();
         HashMap res = new HashMap();
         Set members = cluster.getMemberSet();
         Iterator iter = members.iterator();
         while(iter.hasNext())
         Member member = (Member)iter.next();
         res.put((Object)member.getProcessName(), new Integer(member.getPort()));
         As you can see if member.getProcessName() returns null, then null is placed to HashMap.
         When the result was returned to the client, I've got this exception:
         2007-10-04 09:55:45.849 <Error> (thread=Tangosol.Net.Messaging.Impl.ConnectionManager+ConnectionManagerDaemon): Error decoding message
         System.ArgumentNullException: Key cannot be null.
         Parameter name: key
         at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
         at System.Collections.Hashtable.set_Item(Object key, Object value)
         at Tangosol.IO.Pof.PofStreamReader.ReadAsObject(Int32 typeId) in c:\dev\release.net\coherence-net-v3.3\src\Coherence\IO\Pof\PofStreamReader.cs:line 3446
         at Tangosol.IO.Pof.PofStreamReader.ReadObject(Int32 index) in c:\dev\release.net\coherence-net-v3.3\src\Coherence\IO\Pof\PofStreamReader.cs:line 2284
         at Tangosol.Net.Messaging.Impl.Response.ReadExternal(IPofReader reader) in c:\dev\release.net\coherence-net-v3.3\src\Coherence\Net\Messaging\Impl\Response.cs:line 117
         at Tangosol.Net.Messaging.Impl.Codec.Decode(IChannel channel, DataReader reader) in c:\dev\release.net\coherence-net-v3.3\src\Coherence\Net\Messaging\Impl\Codec.cs:line 118
         at Tangosol.Net.Messaging.Impl.Connection.DecodeMessage(DataReader reader) in c:\dev\release.net\coherence-net-v3.3\src\Coherence\Net\Messaging\Impl\Connection.cs:line 874
         I understood why it was happened, but I did not understood why it was masked and my client application was frozen until request time accured (180s).
         Why did you mask it?
         Regards,
         Dmitry.

    Hi
    Thanks for answered.
    I tried to import just 6 lines but the same error.
    Did you know, what could be?
    I am pasting the log.
    TOTAL STEPS  2
    1. Convert Data:         completed  in 1 sec.
    2. Load and Process:     Failed  in 1 sec.
    3. Import:               completed  in 1 sec.
    [Selection]
    FILE=\GrupoPit\FRATECO\DataManager\DataFiles
    41010100001.csv
    TRANSFORMATION=\GrupoPit\FRATECO\DataManager\TransformationFiles
    Frateco.xls
    CLEARDATA= Yes
    RUNLOGIC= Yes
    CHECKLCK= No
    [Messages]
    Convert Data
    Success
    Record Count : 6
    Accept Count : 6
    Reject Count : 0
    Skip Count   : 0
    Key cannot be null.
    Parameter name: key

  • Can a composite primary key column be null

    Hi All,
    It will be a silly question but still I would like to ask can a composite primary key column be null?
    Thanks,
    Rafi.

    Rafi,
    Why you think it would be allowed?
    SQL> drop table test purge;
    drop table test purge
    ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> create table test as select * from dba_objects;
    Table created.
    SQL> alter table test add primary key(object_id, owner);
    Table altered.
    SQL> insert into test(object_id, owner) values(null, 'aman');
    insert into test(object_id, owner) values(null, 'aman')
    ERROR at line 1:
    ORA-01400: cannot insert NULL into ("SYS"."TEST"."OBJECT_ID")
    SQL> insert into test(object_id, owner) values(1,null);
    insert into test(object_id, owner) values(1,null)
    ERROR at line 1:
    ORA-01400: cannot insert NULL into ("SYS"."TEST"."OWNER")
    SQL>HTH
    Aman....

  • Is their a difference between primary key and unique key with not null valu

    What is the difference in having a column as primary key and having unique key with not null for the column.
    vinodh

    SBH wrote:
    For quick review, below is the link
    http://www.dba-oracle.com/data_warehouse/clustered_index.htm
    You appear to have stumbled on a site that is a mine of disinformation about Oracle.
    >
    It would be helpful, if you explain it too..thnx !!
    The site is wrong and makes up its own terminology as it goes along.
    If the value for clustering factor approaches the number of blocks in the base table, then the index is said to be clustered. http://www.oracle.com/pls/db112/search?remark=quick_search&word=clustered+index
    There is no create clustered index in Oracle.
    - Clustering factor affects the efficiency of an index.
    - There can be clustered tables that you can create indexes on.
    - An Index Organized table is a similar concept to the Microsoft SQL Server clustered index, but it isn't the same thing at all.

  • Difference between PRIMARY KEY and UNIQUE KEY with NOT NULL

    What is the difference between PRIMARY KEY and UNIQUE KEY with NOT NULL constraint?
    Message was edited by:
    Nilesh Hole

    Answer for the master!!!
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8743855576462
    Thanks,
    Karthick

  • Why use key-partitioning and key-associator features?

    Why use key-partitioning and key-associator features?
    What kind of applications are suitable for using key-associator and key-partitioning features?
    Could you give me some example?
    Thank you

    So the typical way is to use KeyAssociation. This is a single interface that uses a method
    public Object getAssociatedKey();
    I believe this works on the ClusterService level (rather than say the Cache). So, say you have a Client and an Account cache where a Client can have multiple Accounts. Now both the Client and the Account object will implement KeyAssociation and return the client object as the AssociatedKey. This will cause these associated objects to live on the same partition.
    Now you can do some clever tricks since you know these are on the same partition. These include using the BackingMap and EntryProcessors / InvocationService / Aggregators to return all the AccountIds associated with a client account (essentially a join).
    Unfortunately, these are pretty advanced Coherence features so it is worth building them in a testcase first and getting them to work before you integrate them into your application.
    Best, Andrew.
    PS. You could also use the KeyPartitioningStrategy, but I prefer the KeyAssociation (as do most people).

  • Why Solman key is required while installing IDES SAP software ?

    HI All,
    Please clarify my doubt why solman key is required while installing SAP software it means SOLMAN should be installed before installing SAP IDES.
    Thanks and regards,
    Naveen.

    Hi Naveen
    Kindly refer the SAP Notes
    811923 - Generating the SAP Solution Manager key
    805390 - SAP Solution Manager is required for SAP Software
    Regards
    Sriram

  • SOAP Error : Server was unable to process request.   Key cannot be null.#

    HI, When I process SOAP call from ABAP using class csoaptransporthttp->request_response, I am getting following error message:
    "Server was unable to process request.   > Key cannot be null.##Parameter name: key"
    Is anybody as the clue to resolve this error ?

    Hi,
    if you're doing a SOAP client - did you compare with this example:
    http://help.sap.com/saphelp_47x200/helpdata/en/2d/64d053e74911d6b2e400508b6b8a93/content.htm
    Regards,
    Michal Krawczyk

  • Login Management screen System.ArgumentNullException: Key cannot be null

    Hi,
    We are following the below technical note to configure BAM:
    Tutorial: Oracle BAM Plans to collect data from JMS bus
    (Tutorial_2_BAM_Administrator.doc)
    Under the section "Creating a BAM user", when trying to create a new user, we noticed that there were two pre-existing entries for the user "aocdom1\aocrac" - one in lowercase and one in uppercase:
    aocdom1\aocrac
    AOCDOM1\AOCRAC
    We did not find the "Delete" option in the Login Management screen. So we clicked on the edit option and deleted the username and full name for the user "aocrac" from the fields and saved the information. Now we are getting the below error whenever we enter into the Login Management screen:
    System.ArgumentNullException: Key cannot be null.
    Parameter name: key
    at System.Collections.Hashtable.ContainsKey(Object key)
    at Oracle.BAM.Administrator.ManageLogins.IsUnknownUser(SystemObject soUser, Hashtable& rhtUnknowns)
    at Oracle.BAM.Administrator.ManageLogins
    The screen is accepting creation of new users though.
    Please let us know how to resolve above issue.
    Regards,
    Balu

    Hi,
    We are following the below technical note to configure BAM:
    Tutorial: Oracle BAM Plans to collect data from JMS bus
    (Tutorial_2_BAM_Administrator.doc)
    Under the section "Creating a BAM user", when trying to create a new user, we noticed that there were two pre-existing entries for the user "aocdom1\aocrac" - one in lowercase and one in uppercase:
    aocdom1\aocrac
    AOCDOM1\AOCRAC
    We did not find the "Delete" option in the Login Management screen. So we clicked on the edit option and deleted the username and full name for the user "aocrac" from the fields and saved the information. Now we are getting the below error whenever we enter into the Login Management screen:
    System.ArgumentNullException: Key cannot be null.
    Parameter name: key
    at System.Collections.Hashtable.ContainsKey(Object key)
    at Oracle.BAM.Administrator.ManageLogins.IsUnknownUser(SystemObject soUser, Hashtable& rhtUnknowns)
    at Oracle.BAM.Administrator.ManageLogins
    The screen is accepting creation of new users though.
    Please let us know how to resolve above issue.
    Regards,
    Balu

  • Import error - key cannot be null

    We upgraded to v7.5 (MS) back in December with no major issues, and everything has been functioning normally. But, a few days ago I tried to run an import package (we get our actual data into the program by creating a file from Oracle then importing it). I used our usual Transformation file, and was about to validate the data file. But, when I went to import the file it failed and said "Key cannot be null. Parameter name: key". Can somebody tell me what is causing this and how to fix it?

    Hi Shawn,
    If you are using CSV file for data upload, Try this and let me know if it works:
    1. Go to the last record in your Row and Select the entire Row next to your last record.
    2. Press "Shift", "Control" and "Down Arrow" key and delete the entire selection. It will not have any data anyways.
    3. Go to the last record in your Column and select the entire Column next to your last record.
    4. Press "Shift", "Control" and "Right Arrow" key and delete the entire selection.
    5. Save the file and try uploading it again.
    regards,
    Amit

  • Key cannot be null error

    Hi
    When loading data i'm getting the error
    Key cannot be null.
    Parameter name: key
    What does this error mean? I have done this with a large load, then started testing with a small load. But Im still getting the same  error.
    Here is the full log
    TOTAL STEPS  2
    1. Convert Data:         completed  in 0 sec.
    2. LOAD AND PROCESS:     Failed  in 0 sec.
    3. Import:               completed  in 0 sec.
    [Selection]
    FILE=\BPC\FINANCE\DataManager\DataFiles
    BPC_GL_DATA.TXT
    TRANSFORMATION=\BPC\FINANCE\DataManager\TransformationFiles
    BPC_Transformation.xls
    CLEARDATA= Yes
    RUNLOGIC= No
    CHECKLCK= No
    [Messages]
    Convert Data
    Success
    Record Count : 3
    Accept Count : 3
    Reject Count : 0
    Skip Count   : 0
    Key cannot be null.
    Parameter name: key
    I have looked at a similar thread and tried this. Was not helpfull for me.
    BPC excel error
    any assistance will be appreciated

    Hi
    I have looked more into this.
    If I use the import package with the option "Merge data values" it works fine.
    I can also use the clear data package fine with no problem.
    I only get this error when i say "Replace & Clear Data Values" when using the import package.
    This means my data is ok, my transformation is also ok.
    I'm using BPC 7.5, has anyone had a similar problem?? I also tried using BPC 7 import package, still get the same error.
    Any ideas is appreciated.

  • I paid second month for "Creative Cloud for education" already. Why require key when I open illustrator?

    I paid second month for "Creative Cloud for education" already.
    Why require key when I open illustrator?
    p.s. Login account was correctly.

    Since this is an open forum, not Adobe support... you need to contact Adobe staff to help
    Adobe contact information - http://helpx.adobe.com/contact.html
    -Select your product and what you need help with
    -Click on the blue box "Still need help? Contact us"

  • Why 10 key PinYin keyboard only for iphone sold in HK and China?

    Why 10 key PinYin keyboard only for iphone sold in HK and China? Have apple considers the other Chinese around the world?

    ZelinfromCHN wrote:
    Why 10 key PinYin keyboard only for iphone sold in HK and China? 
    Nobody in the forums can tell you why Apple has done this.  It really makes no sense at all.  You can tell them you want it elsewhere as well via
    http://www.apple.com/feedback

  • Why does getParameter("uri") returns null ???

    Hi !
    JAVA can be rather frustrating and I have run of of dukes. How about IOU ?
    Unfortunately none of the previous questions in the db shed light on my problem.
    I am trying to get at the "uri" and I have the following code fragment :
    package com.developer;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.IOException;
    import java.io.PrintWriter;
    public class proptest extends HttpServlet
      public void doGet( HttpServletRequest req,  HttpServletResponse resp)
        throws ServletException, IOException
        PrintWriter out = resp.getWriter();
        out.println("Parameter Name: " + req.getParameter("uri"));
      public void init() throws ServletException
        // initialie the servlet here. Use ServletConfig object to get
        //    initialization parameters...
        ServletConfig config = getServletConfig();
        // ... more stuff ...
      }

    Hi!
    In case anyone stumbles upon this in the database, I worked aroung it by using req.getRequestURI().
    However I still do not know why getParameter() returns null. It would be useful e.g. if you want to display a list of all request params e.g.:
    // stub code follows...
    java.util.Enumeration enum = rea.getParameterNames();
    while (enum.hasMoreElements())
    String name = (String) enum.nextElement();
    System.out.println("Parameter "+name + " " + req.getParameter(name))
    ...For me, nope, all nulls. If it works for you , do tell me.
    Also if you look at the "bugs db" there seems to be a number of issues concerning getParameter().

  • Why ResultSet getDate() method returns null when querying .csv file?

    Here is the full code:
    import java.sql.*;
    import java.sql.Types;
    import java.sql.Date;
    import myjava.support.CachedRowSetMaker;
    import javax.sql.rowset.CachedRowSet;
    import java.io.IOException;
    import java.text.SimpleDateFormat;
    import java.util.Calendar;
    class jdbc2{
    final private String s1="SELECT top 10 [DATE], [ADJ CLOSE] FROM [vwo-1.csv]";
    private ResultSet result=null;
    private Connection conn=null;
    public static void main(String[] args) throws SQLException{
    jdbc2 db=new jdbc2();
    try {
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              db.conn = DriverManager.getConnection("jdbc:odbc:STOCK_DATA");
              PreparedStatement sql=db.conn.prepareStatement(db.s1);
              db.result=sql.executeQuery();
    // check column names and types using the ResultSetMetaData object.
              ResultSetMetaData metaData = db.result.getMetaData();
         System.out.println("Table Name : " + metaData.getTableName(2));
         System.out.println("Field\t\tDataType");
         for (int i = 0; i < metaData.getColumnCount(); i++) {
         System.out.print(metaData.getColumnName(i + 1) + "\t");
         System.out.println(metaData.getColumnTypeName(i+1));
         System.out.print(metaData.getColumnName(1) + "\t"+metaData.getColumnName(2)+"\n");
              while (db.result.next()){
                   System.out.print(db.result.getDate("DATE", Calendar.getInstance()));
                   System.out.format("\t%,.2f\n", db.result.getFloat("Adj Close"));
    catch (Exception e) {
    System.out.println("Error: " + e.getMessage());
         finally {
              db.result.close();
              db.conn.close();
    Everything works well, until getting to the block
              while (db.result.next()){
                   System.out.print(db.result.getDate("DATE", Calendar.getInstance()));
                   System.out.format("\t%,.2f\n", db.result.getFloat("Adj Close"));
    The getDate("DATE", Calendar.getInstance())); always returns null, instead of the date value in the vwo-1.csv.
    Even though I change it to
    java.sql.Date d=db.result.getDate("DATE") and convert to String using .toString(), I still gets nulls. The dollar amount in "Adj Close" field is fine, no problem.
    The .csv fils is downloaded from YahooFinace.
    Can anyone review the code and shed some light as to what I did wrong?
    Thanks alot.

    CREATE TABLE `login` (
    `username` varchar(40) DEFAULT NULL,
    `password` varchar(40) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `amount` (
    `amountid` int(11) NOT NULL,
    `receiptid` int(11) DEFAULT NULL,
    `loanid` int(11) DEFAULT NULL,
    `amount` bigint(11) DEFAULT NULL,
    `latefee` int(11) DEFAULT NULL,
    `paymentid` int(11) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL,
    PRIMARY KEY (`amountid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `applicationfee` (
    `applicationfeeid` int(11) DEFAULT NULL,
    `applicationamount` int(11) DEFAULT NULL,
    `applicationfee` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `category` (
    `categoryid` int(11) DEFAULT NULL,
    `categoryname` varchar(40) DEFAULT NULL,
    `categorydescription` varchar(500) DEFAULT NULL,
    `cattype` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `commission` (
    `commissionid` int(11) DEFAULT NULL,
    `bussiness` int(11) DEFAULT NULL,
    `commission` int(11) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `customer` (
    `cacno` int(11) NOT NULL DEFAULT '0',
    `name` varchar(40) DEFAULT NULL,
    `age` int(11) DEFAULT NULL,
    `cphone` varchar(40) DEFAULT NULL,
    `cmobile` varchar(40) DEFAULT NULL,
    `caddress` varchar(500) DEFAULT NULL,
    `cstatus` varchar(20) DEFAULT NULL,
    `cphoto` longblob,
    `pid` int(11) DEFAULT NULL,
    PRIMARY KEY (`cacno`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `daybook` (
    `closingbal` varchar(40) DEFAULT NULL,
    `date` date DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `extraincome` (
    `categoryid` int(11) NOT NULL,
    `receiptid` int(11) DEFAULT NULL,
    `date` date DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `employee` (
    `empno` int(11) DEFAULT NULL,
    `empname` varchar(40) DEFAULT NULL,
    `age` int(11) DEFAULT NULL,
    `sal` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `image` (
    `id` int(11) DEFAULT NULL,
    `image` blob
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `loan` (
    `loanid` int(11) NOT NULL DEFAULT '0',
    `loanamt` varchar(40) DEFAULT NULL,
    `payableamount` double DEFAULT NULL,
    `installment` int(11) DEFAULT NULL,
    `payableinstallments` int(11) DEFAULT NULL,
    `monthlyinstallment` varchar(20) DEFAULT NULL,
    `surityname` varchar(20) DEFAULT NULL,
    `applicationfeeid` int(11) DEFAULT NULL,
    `interestrate` float DEFAULT NULL,
    `issuedate` date DEFAULT NULL,
    `duedate` date DEFAULT NULL,
    `nextduedate` date DEFAULT NULL,
    `cacno` int(11) DEFAULT NULL,
    `cname` varchar(20) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL,
    `interestamt` double DEFAULT NULL,
    `pendingamt` float DEFAULT NULL,
    PRIMARY KEY (`loanid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `md` (
    `mdid` int(11) NOT NULL DEFAULT '0',
    `mdname` varchar(40) DEFAULT NULL,
    `mdphoto` varchar(100) DEFAULT NULL,
    `mdphone` varchar(40) DEFAULT NULL,
    `mdmobile` varchar(40) DEFAULT NULL,
    `mdaddress` varchar(500) DEFAULT NULL,
    PRIMARY KEY (`mdid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `partner` (
    `pid` int(11) NOT NULL DEFAULT '0',
    `pname` varchar(40) DEFAULT NULL,
    `paddress` varchar(500) DEFAULT NULL,
    `pphoto` varchar(100) DEFAULT NULL,
    `pphone` varchar(40) DEFAULT NULL,
    `pmobile` varchar(40) DEFAULT NULL,
    `pstatus` varchar(20) DEFAULT NULL,
    `mdid` int(11) DEFAULT NULL,
    `mdname` varchar(40) DEFAULT NULL,
    `date` date DEFAULT NULL,
    `nextpaydate` date DEFAULT NULL,
    PRIMARY KEY (`pid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `partnerinvested` (
    `pid` int(11) DEFAULT NULL,
    `pname` varchar(20) DEFAULT NULL,
    `receiptid` int(11) DEFAULT NULL,
    `date` date DEFAULT NULL,
    `amountinvested` int(11) DEFAULT NULL,
    `latefee` int(11) DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `payments` (
    `paymentid` int(11) NOT NULL,
    `categoryid` int(11) DEFAULT NULL,
    `particulars` varchar(100) DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL,
    `paymentdate` date DEFAULT NULL,
    PRIMARY KEY (`paymentid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    CREATE TABLE `receipts` (
    `receiptid` int(11) DEFAULT NULL,
    `paiddate` date DEFAULT NULL,
    `amountid` int(11) DEFAULT NULL,
    `loanid` int(11) DEFAULT NULL,
    `latefee` int(11) DEFAULT NULL,
    `installment` int(11) DEFAULT NULL,
    `cacno` int(11) DEFAULT NULL,
    `cname` varchar(40) DEFAULT NULL,
    `pid` int(11) DEFAULT NULL
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

Maybe you are looking for