如何根据现存表创建新表(用PB程序控制)
我的客户端采用PB6.5和OPEN CLIENT,服务器端是ADAPTIVE SERVER 11.5。我想通过PB编程实现根据现存表创建新表。服务器的的数据库名称是'cybigdb'。我在服务器的sql
advantage中运行'select * into newtablename from oldtablename'可以根据
oldtablename表创建新表newtablename。在PB的DATABASE ADMINISTRATOR中运行该语句则提示select error:There is an already an object named 'newtablename' in the database。但确实创建了新表newtablename。我在PB的代码中使用
Execute immediate :ls_sql执行该语句,结果不能不能创建新表,并返回sqlerrtext:
'CREATE TABLE'command is not allowed within a multi_statement transaction
in the 'cybigdb' database。
我想知道原因。或者有其它的实现方法也可以。