本文介绍了表结构中的动态表creation_help的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我想知道我们是否可以在运行时执行DDL命令.例如,我想维护特定客户预订的机票记录.我没有得到应该创建的表的结构.如果客户ID是主键,并且我们需要存储通过该ID预订的票证的详细信息,那我该怎么办?
对于EG:

Hi,

I wanted to know if we can execute DDL commands at runtime. For eg I want to maintain the record of the tickets booked by a particular customer. I am not getting what should be the structure of tables to be created. If the customer ID is the primary key and we need to store the details of the tickets booked by that ID, how should I so that??

FOR EG :

CUST_ID  ,  CUST_NAME  ,  CUST_ADD



如果客户预订了票证,则应将其添加到数据库中的某处,即每笔交易的票证号应保存在某处.现在的问题是,我们应该将票保存在哪里.如果我们创建一个以CUST_ID作为主键引用Customer表的表,那么表的结构应该是什么.我不认为我们可以在运行时创建列.
如果我这样说:-



If the Customer books a ticket, it should be added somewhere in the database i.e the Ticket Numbers for each transaction should be saved somewhere. Now the question is, where should we save the tickets. If we create some table with the CUST_ID as the Primary key referring the Customer table, then what should be the structure of the table.i don''t think that we can create columns at runtime.
If I have put in this way:-

CUST_ID , TICKET_1, TICKET_2, TICKET_3,TICKET_4


它只能保存4张票,并且由于票数趋于增加,因此不合适.

是否是以前为所有用户创建的所有表,其表名称为CUST_ID之类的名称,客户在购买票证时以及插入票证时都会在其中插入数据.

我是这个领域的新手,请为我提供一些帮助.提前谢谢.

问候
Jashobanta Chakraborty


it can save only 4 tickets, and as the tickets will tend to increase in number, it would not be appropriate.

Is it the case that all tables are previously created for all users with something like the table name as the CUST_ID where the data is inserted as and when the customer books a ticket.

I am new in this area, so please provide me some help. Thanks in advance.

Regards
Jashobanta Chakraborty

推荐答案


这篇关于表结构中的动态表creation_help的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 10:50