Creating a temporary table dynamically

Hi


How can i create/drop a table in server script
I tried sql(query) generated This statement can cause implicit commit error

Thanks



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

commit your transaction before doing this. use webnotes.conn.commit()

MySQL does not allow DDL statements within transactions.


W: https://erpnext.com
T: @rushabh_mehta

On 07-Dec-2012, at 3:05 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

How can i create/drop a table in server script
I tried sql(query) generated This statement can cause implicit commit error

Thanks



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi


Its again generates error Commands out of sync; you can’t run this command now

Here is my code.

def create_table(self):

webnotes.conn.commit()
result = sql("""
DROP TEMPORARY TABLE IF EXISTS __TempTable;
CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
Thanks

On Fri, Dec 7, 2012 at 3:06 PM, Rushabh Mehta <rm...@gmail.com> wrote:
webnotes.conn.commit()



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Seems like a strange error - you might have to Google it up!

What are you trying to achieve?


W: https://erpnext.com
T: @rushabh_mehta

On 07-Dec-2012, at 3:17 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

Its again generates error Commands out of sync; you can't run this command now

Here is my code.

def create_table(self):
webnotes.conn.commit()
result = sql(""" 
DROP TEMPORARY TABLE IF EXISTS `__TempTable`;
CREATE TEMPORARY TABLE `__TempTable` (
  `date` date NOT NULL,
  `amount` float NOT NULL,
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
Thanks

On Fri, Dec 7, 2012 at 3:06 PM, Rushabh Mehta <rm...@gmail.com> wrote:
webnotes.conn.commit()




You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi Arun,

There is a syntax error in your query (extra comma before the closing bracket)

try this:
webnotes.conn.commit()
webnotes.conn.sql("DROP TEMPORARY TABLE IF EXISTS `__TempTable`")
webnotes.conn.sql("""CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8""")

Thanks,
Anand.

On 07-Dec-2012, at 3:19 PM, Rushabh Mehta <rm...@gmail.com> wrote:

Seems like a strange error - you might have to Google it up!

What are you trying to achieve?


W: https://erpnext.com
T: @rushabh_mehta

On 07-Dec-2012, at 3:17 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

Its again generates error Commands out of sync; you can't run this command now

Here is my code.

def create_table(self):
webnotes.conn.commit()
result = sql(""" 
DROP TEMPORARY TABLE IF EXISTS `__TempTable`;
CREATE TEMPORARY TABLE `__TempTable` (
  `date` date NOT NULL,
  `amount` float NOT NULL,
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
Thanks

On Fri, Dec 7, 2012 at 3:06 PM, Rushabh Mehta <rm...@gmail.com> wrote:
webnotes.conn.commit()




You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 




You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi

I removed the TEMPORARY from sql
Now no error generated

Thanks

On Fri, Dec 7, 2012 at 3:31 PM, Anand Doshi <an…@iwebnotes.com> wrote:
Hi Arun,

There is a syntax error in your query (extra comma before the closing bracket)

try this:
webnotes.conn.commit()
webnotes.conn.sql("DROP TEMPORARY TABLE IF EXISTS `__TempTable`")
webnotes.conn.sql("""CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8""")

Thanks,
Anand.

On 07-Dec-2012, at 3:19 PM, Rushabh Mehta <rm...@gmail.com> wrote:

Seems like a strange error - you might have to Google it up!

What are you trying to achieve?


W: https://erpnext.com
T: @rushabh_mehta

On 07-Dec-2012, at 3:17 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

Its again generates error Commands out of sync; you can't run this command now

Here is my code.

def create_table(self):
webnotes.conn.commit()
result = sql("""
DROP TEMPORARY TABLE IF EXISTS `__TempTable`;
CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
Thanks

On Fri, Dec 7, 2012 at 3:06 PM, Rushabh Mehta <rm...@gmail.com> wrote:

webnotes.conn.commit()





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi


If i use webnotes.conn.commit() no any error/Exceptions raised. But data not getting saved into the db
But in the form it is showing that the form is saved. Could you please check and let me know

Thank n regards
Arun

On Fri, Dec 7, 2012 at 3:48 PM, Arun Emmanuel <ar...@gmail.com> wrote:
Hi
I removed the TEMPORARY from sql
Now no error generated

Thanks


On Fri, Dec 7, 2012 at 3:31 PM, Anand Doshi <an...@iwebnotes.com> wrote:
Hi Arun,

There is a syntax error in your query (extra comma before the closing bracket)

try this:
webnotes.conn.commit()
webnotes.conn.sql("DROP TEMPORARY TABLE IF EXISTS `__TempTable`")
webnotes.conn.sql("""CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8""")

Thanks,
Anand.

On 07-Dec-2012, at 3:19 PM, Rushabh Mehta <rm...@gmail.com> wrote:


Seems like a strange error - you might have to Google it up!

What are you trying to achieve?

On 07-Dec-2012, at 3:17 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

Its again generates error Commands out of sync; you can't run this command now

Here is my code.

def create_table(self):
webnotes.conn.commit()
result = sql("""
DROP TEMPORARY TABLE IF EXISTS `__TempTable`;
CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
Thanks

On Fri, Dec 7, 2012 at 3:06 PM, Rushabh Mehta <rm...@gmail.com> wrote:

webnotes.conn.commit()





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Arun,


You need to read up on how MySQL handles transactions.

- Rushabh


On Mon, Dec 10, 2012 at 10:20 AM, Arun Emmanuel <ar…@gmail.com> wrote:
Hi

If i use webnotes.conn.commit() no any error/Exceptions raised. But data not getting saved into the db
But in the form it is showing that the form is saved. Could you please check and let me know

Thank n regards
Arun

On Fri, Dec 7, 2012 at 3:48 PM, Arun Emmanuel <ar...@gmail.com> wrote:
Hi
I removed the TEMPORARY from sql
Now no error generated

Thanks


On Fri, Dec 7, 2012 at 3:31 PM, Anand Doshi <an...@iwebnotes.com> wrote:
Hi Arun,

There is a syntax error in your query (extra comma before the closing bracket)

try this:
webnotes.conn.commit()
webnotes.conn.sql("DROP TEMPORARY TABLE IF EXISTS `__TempTable`")
webnotes.conn.sql("""CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8""")

Thanks,
Anand.

On 07-Dec-2012, at 3:19 PM, Rushabh Mehta <rm...@gmail.com> wrote:


Seems like a strange error - you might have to Google it up!

What are you trying to achieve?

On 07-Dec-2012, at 3:17 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

Its again generates error Commands out of sync; you can't run this command now

Here is my code.

def create_table(self):
webnotes.conn.commit()
result = sql("""
DROP TEMPORARY TABLE IF EXISTS `__TempTable`;
CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
Thanks

On Fri, Dec 7, 2012 at 3:06 PM, Rushabh Mehta <rm...@gmail.com> wrote:

webnotes.conn.commit()





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







--



Twitter: @rushabh_mehta



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Ok Rushabh … I will do that. If u have any files which creates / deletes some table in the run time please share that with me

So that i can get a better idea about it

Thanks


On Mon, Dec 10, 2012 at 10:22 AM, Rushabh Mehta <rm…@gmail.com> wrote:

Arun,

You need to read up on how MySQL handles transactions.

- Rushabh


On Mon, Dec 10, 2012 at 10:20 AM, Arun Emmanuel <ar…@gmail.com> wrote:
Hi

If i use webnotes.conn.commit() no any error/Exceptions raised. But data not getting saved into the db
But in the form it is showing that the form is saved. Could you please check and let me know

Thank n regards
Arun

On Fri, Dec 7, 2012 at 3:48 PM, Arun Emmanuel <ar...@gmail.com> wrote:
Hi
I removed the TEMPORARY from sql
Now no error generated

Thanks


On Fri, Dec 7, 2012 at 3:31 PM, Anand Doshi <an...@iwebnotes.com> wrote:
Hi Arun,

There is a syntax error in your query (extra comma before the closing bracket)

try this:
webnotes.conn.commit()
webnotes.conn.sql("DROP TEMPORARY TABLE IF EXISTS `__TempTable`")
webnotes.conn.sql("""CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8""")

Thanks,
Anand.

On 07-Dec-2012, at 3:19 PM, Rushabh Mehta <rm...@gmail.com> wrote:


Seems like a strange error - you might have to Google it up!

What are you trying to achieve?

On 07-Dec-2012, at 3:17 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

Its again generates error Commands out of sync; you can't run this command now

Here is my code.

def create_table(self):
webnotes.conn.commit()
result = sql("""
DROP TEMPORARY TABLE IF EXISTS `__TempTable`;
CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
Thanks

On Fri, Dec 7, 2012 at 3:06 PM, Rushabh Mehta <rm...@gmail.com> wrote:

webnotes.conn.commit()





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







--



Twitter: @rushabh_mehta



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

You also need to learn grep :slight_smile:



On Mon, Dec 10, 2012 at 10:25 AM, Arun Emmanuel <ar…@gmail.com> wrote:
Ok Rushabh .. I will do that. If u have any files which creates / deletes some table in the run time please share that with me
So that i can get a better idea about it

Thanks


On Mon, Dec 10, 2012 at 10:22 AM, Rushabh Mehta <rm...@gmail.com> wrote:

Arun,


You need to read up on how MySQL handles transactions.

- Rushabh


On Mon, Dec 10, 2012 at 10:20 AM, Arun Emmanuel <ar…@gmail.com> wrote:
Hi

If i use webnotes.conn.commit() no any error/Exceptions raised. But data not getting saved into the db
But in the form it is showing that the form is saved. Could you please check and let me know

Thank n regards
Arun

On Fri, Dec 7, 2012 at 3:48 PM, Arun Emmanuel <ar...@gmail.com> wrote:
Hi
I removed the TEMPORARY from sql
Now no error generated

Thanks


On Fri, Dec 7, 2012 at 3:31 PM, Anand Doshi <an...@iwebnotes.com> wrote:
Hi Arun,

There is a syntax error in your query (extra comma before the closing bracket)

try this:
webnotes.conn.commit()
webnotes.conn.sql("DROP TEMPORARY TABLE IF EXISTS `__TempTable`")
webnotes.conn.sql("""CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8""")

Thanks,
Anand.

On 07-Dec-2012, at 3:19 PM, Rushabh Mehta <rm...@gmail.com> wrote:


Seems like a strange error - you might have to Google it up!

What are you trying to achieve?

On 07-Dec-2012, at 3:17 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

Its again generates error Commands out of sync; you can't run this command now

Here is my code.

def create_table(self):
webnotes.conn.commit()
result = sql("""
DROP TEMPORARY TABLE IF EXISTS `__TempTable`;
CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
Thanks

On Fri, Dec 7, 2012 at 3:06 PM, Rushabh Mehta <rm...@gmail.com> wrote:

webnotes.conn.commit()





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







--



Twitter: @rushabh_mehta



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







--



Twitter: @rushabh_mehta



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Ok sure… I will do that


Thanks

On Mon, Dec 10, 2012 at 10:27 AM, Rushabh Mehta <rm…@gmail.com> wrote:
You also need to learn grep :)


On Mon, Dec 10, 2012 at 10:25 AM, Arun Emmanuel <ar...@gmail.com> wrote:
Ok Rushabh .. I will do that. If u have any files which creates / deletes some table in the run time please share that with me

So that i can get a better idea about it


Thanks



On Mon, Dec 10, 2012 at 10:22 AM, Rushabh Mehta <rm…@gmail.com> wrote:

Arun,


You need to read up on how MySQL handles transactions.

- Rushabh


On Mon, Dec 10, 2012 at 10:20 AM, Arun Emmanuel <ar…@gmail.com> wrote:
Hi

If i use webnotes.conn.commit() no any error/Exceptions raised. But data not getting saved into the db
But in the form it is showing that the form is saved. Could you please check and let me know

Thank n regards
Arun

On Fri, Dec 7, 2012 at 3:48 PM, Arun Emmanuel <ar...@gmail.com> wrote:
Hi
I removed the TEMPORARY from sql
Now no error generated

Thanks


On Fri, Dec 7, 2012 at 3:31 PM, Anand Doshi <an...@iwebnotes.com> wrote:
Hi Arun,

There is a syntax error in your query (extra comma before the closing bracket)

try this:
webnotes.conn.commit()
webnotes.conn.sql("DROP TEMPORARY TABLE IF EXISTS `__TempTable`")
webnotes.conn.sql("""CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8""")

Thanks,
Anand.

On 07-Dec-2012, at 3:19 PM, Rushabh Mehta <rm...@gmail.com> wrote:


Seems like a strange error - you might have to Google it up!

What are you trying to achieve?

On 07-Dec-2012, at 3:17 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

Its again generates error Commands out of sync; you can't run this command now

Here is my code.

def create_table(self):
webnotes.conn.commit()
result = sql("""
DROP TEMPORARY TABLE IF EXISTS `__TempTable`;
CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
Thanks

On Fri, Dec 7, 2012 at 3:06 PM, Rushabh Mehta <rm...@gmail.com> wrote:

webnotes.conn.commit()





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







--



Twitter: @rushabh_mehta



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







--



Twitter: @rushabh_mehta



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

 

 

Hi


we have to use webnotes.conn.begin() after creating the table
Now its working as i expected

On Mon, Dec 10, 2012 at 11:06 AM, Arun Emmanuel <ar…@gmail.com> wrote:
Ok sure.. I will do that

Thanks


On Mon, Dec 10, 2012 at 10:27 AM, Rushabh Mehta <rm...@gmail.com> wrote:
You also need to learn grep :)


On Mon, Dec 10, 2012 at 10:25 AM, Arun Emmanuel <ar...@gmail.com> wrote:
Ok Rushabh .. I will do that. If u have any files which creates / deletes some table in the run time please share that with me

So that i can get a better idea about it


Thanks



On Mon, Dec 10, 2012 at 10:22 AM, Rushabh Mehta <rm…@gmail.com> wrote:

Arun,


You need to read up on how MySQL handles transactions.

- Rushabh


On Mon, Dec 10, 2012 at 10:20 AM, Arun Emmanuel <ar…@gmail.com> wrote:
Hi

If i use webnotes.conn.commit() no any error/Exceptions raised. But data not getting saved into the db
But in the form it is showing that the form is saved. Could you please check and let me know

Thank n regards
Arun

On Fri, Dec 7, 2012 at 3:48 PM, Arun Emmanuel <ar...@gmail.com> wrote:
Hi
I removed the TEMPORARY from sql
Now no error generated

Thanks


On Fri, Dec 7, 2012 at 3:31 PM, Anand Doshi <an...@iwebnotes.com> wrote:
Hi Arun,

There is a syntax error in your query (extra comma before the closing bracket)

try this:
webnotes.conn.commit()
webnotes.conn.sql("DROP TEMPORARY TABLE IF EXISTS `__TempTable`")
webnotes.conn.sql("""CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8""")

Thanks,
Anand.

On 07-Dec-2012, at 3:19 PM, Rushabh Mehta <rm...@gmail.com> wrote:


Seems like a strange error - you might have to Google it up!

What are you trying to achieve?

On 07-Dec-2012, at 3:17 PM, Arun Emmanuel <ar...@gmail.com> wrote:

Hi

Its again generates error Commands out of sync; you can't run this command now

Here is my code.

def create_table(self):
webnotes.conn.commit()
result = sql("""
DROP TEMPORARY TABLE IF EXISTS `__TempTable`;
CREATE TEMPORARY TABLE `__TempTable` (
`date` date NOT NULL,
`amount` float NOT NULL,
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
""")
Thanks

On Fri, Dec 7, 2012 at 3:06 PM, Rushabh Mehta <rm...@gmail.com> wrote:

webnotes.conn.commit()





You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







--



Twitter: @rushabh_mehta



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.







--



Twitter: @rushabh_mehta



You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er…@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un…@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.








You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

To post to this group, send email to er...@googlegroups.com.

To unsubscribe from this group, send email to erpnext-developer-forum+un...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.