Re: How to create a table with dynamic table name
Posted in 2003
This is a multi-part message in MIME format. ------=_NextPart_000_492e_5252_339 Content-Type: text/plain; format=flowed Hi Cathy. If you are using IDS 9.x, then use exec_sql_udr . exec_sql_udr is downloadble at http://www.iiug.org/index_ORDBMS.html Regards. -- Tsutomu Ogiwara from Tokyo Japan. ICQ#:168106592 _________________________________________________________________ MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. http://join.msn.com/?page=features/virus ------=_NextPart_000_492e_5252_339 Content-Type: message/rfc822 X-Message-Info: TSNaxu8CDoc9hJ4AgzwuydK6WUmE1uSQ Received: from mc1-f13.law16.hotmail.com ([65.54.236.20]) by mc1-s19.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Wed, 16 Jul 2003 09:14:33 -0700 Received: from ace.iiug.org ([216.177.38.212]) by mc1-f13.law16.hotmail.com with Microsoft SMTPSVC(5.0.2195.5600); Wed, 16 Jul 2003 09:14:08 -0700 Received: from ace.iiug.org (localhost [127.0.0.1]) by ace.iiug.org (8.12.8p1/8.12.8) with ESMTP id h6GEamVk011532; Wed, 16 Jul 2003 10:36:48 -0400 (EDT) Received: (from smmsp@localhost) by ace.iiug.org (8.12.8p1/8.12.8/Submit) id h6GEamEf011531; Wed, 16 Jul 2003 10:36:48 -0400 (EDT) Received: from hotmail.com (law9-f76.law9.hotmail.com [64.4.9.76]) by ace.iiug.org (8.12.8p1/8.12.8) with ESMTP id h6GEakVk011514 for <informix-list@iiug.org>; Wed, 16 Jul 2003 10:36:46 -0400 (EDT) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 16 Jul 2003 07:33:57 -0700 Received: from 167.206.83.130 by lw9fd.law9.hotmail.msn.com with HTTP; Wed, 16 Jul 2003 14:33:57 GMT X-Originating-IP: [167.206.83.130] X-Originating-Email: [cathyyanwang@hotmail.com] From: "cathy wang" <cathyyanwang@hotmail.com> To: informix-list@iiug.org Subject: How to create a table with dynamic table name Date: Wed, 16 Jul 2003 10:33:57 -0400 Mime-Version: 1.0 Content-Type: text/html Message-ID: <Law9-F76oe2U8QVjp3b000000a2@hotmail.com> X-OriginalArrivalTime: 16 Jul 2003 14:33:57.0817 (UTC) FILETIME=[4A822290:01C34BA7] Sender: owner-informix-list@iiug.org Precedence: bulk Return-Path: owner-informix-list@iiug.org <html><div style='background-color:'><DIV> <DIV class=Section1> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Hello,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">For a web application, I need to create a table with a dynamic name. I wonder if it is possible to have the following procedure created in INFORMIX. If not, what is the proper way to handle this ?<SPAN style="mso-spacerun: yes"> </SPAN>Thanks in advance !<SPAN style="mso-spacerun: yes"> </SPAN>-Cathy<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">----------------------------------------------<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">Procedure to create table with dynamic<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt">CREATE PROCEDURE <SPAN class=SpellE>sfa_newtable</SPAN>(<SPAN class=SpellE>tablename</SPAN> char)<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><SPAN style="mso-tab-count: 1"> </SPAN>Create<SPAN style="mso-spacerun: yes"> </SPAN>TABLE<SPAN style="mso-spacerun: yes"> </SPAN><SPAN class=SpellE>tablename</SPAN>(<SPAN style="mso-spacerun: yes"> </SPAN><o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN><SPAN class=SpellE><SPAN class=GramE>terr_nbr</SPAN></SPAN><SPAN style="mso-spacerun: yes"> </SPAN>char(7),<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><SPAN style="mso-spacerun: yes"> </SPAN><SPAN style="mso-tab-count: 1"> </SPAN><SPAN class=SpellE><SPAN class=GramE>act_date</SPAN></SPAN><SPAN style="mso-spacerun: yes"> </SPAN>date,<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><SPAN style="mso-tab-count: 1"> </SPAN><SPAN class=SpellE><SPAN class=GramE>form_nbr</SPAN></SPAN><SPAN style="mso-spacerun: yes"> </SPAN>char(15),<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><SPAN style="mso-tab-count: 1"> </SPAN><SPAN class=SpellE><SPAN class=GramE>fid</SPAN></SPAN><SPAN style="mso-tab-count: 2"> </SPAN>integer,<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><SPAN style="mso-tab-count: 1"> </SPAN><SPAN class=SpellE><SPAN class=GramE>fname</SPAN></SPAN><SPAN style="mso-tab-count: 1"> </SPAN>char(35),<o:p></o:p></SPAN></FONT></P> <P class=MsoNormal style="mso-layout-grid-align: none"><FONT face="Times New Roman" size=3><SPAN style="FONT-SIZE: 12pt"><SPAN style="mso-tab-count: