473,395 Members | 2,468 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

create table MyVariable

2
Can I write in a plpgsql function a code like this:
declare mytablename char(10);
..........................
Expand|Select|Wrap|Line Numbers
  1.     if .... then
  2.       mytablename='John';
  3.     else
  4.       mytablename='Johnson';
  5.    end if;
  6.  
  7.  
  8.     create temp table mytablename as.........;
.................??
Oct 9 '08 #1
2 3053
rski
700 Expert 512MB
you can try create table using dynamic sql
Expand|Select|Wrap|Line Numbers
  1. execute 'create temp table '||table_name ....
  2.  
Oct 9 '08 #2
danciu
2
It really works, thanks.
Oct 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Phil Powell | last post by:
create table if not exists nnet_produkt_varegruppe ( nnet_produkt_varegruppe_id int not null auto_increment, primary key(nnet_produkt_varegruppe_id), nnet_produkt_varegruppe_navn varchar(255) not...
1
by: seberino | last post by:
Python lets me access module level variables from *anywhere*. All I have to do is add module name in front. e.g. mymodule.myvariable Is this considered a 'global'? Or, does a 'global...
1
by: poohnie08 | last post by:
i have a excel spreadsheet showing staff name, date,work hour, ot hour, slot1, slot2, slot3, slot4 and others). The "()" will keep repeating from day 1 until end of month. eg in excel spreadsheet,...
8
by: jtippen | last post by:
Can anyone point me in the right direction on how I can import a comma delimited webpage off a website into a table in Access 2003? If someone knows of an example of how to do this that would...
6
by: Peter Nurse | last post by:
For reasons that are not relevant (though I explain them below *), I want, for all my users whatever privelige level, an SP which creates and inserts into a temporary table and then another SP...
27
by: max | last post by:
Hello, I am a newbye, and I'm trying to write a simple application. I have five tables with three columns; all tables are identical; I need to change some data in the first table and let VB...
1
by: ApexData | last post by:
I have a Combobox called cboCITY that I attempt to populate from a LookupTable of 45000 records containing CITY STATE and ZIPCODES. It is bound to a Field called CITY in my MainTable and the the...
4
by: etuncer | last post by:
Hello All, I have Access 2003, and am trying to build a database for my small company. I want to be able to create a word document based on the data entered through a form. the real question is...
6
by: Devin | last post by:
So Python can have unicode variable names but you can't "explode" (**myvariable) a dict with unicode keys? WTF? -Devin
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.