By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,852 Members | 2,123 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,852 IT Pros & Developers. It's quick & easy.

create table MyVariable

P: 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
Share this Question
Share on Google+
2 Replies


Expert 100+
P: 700
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

P: 2
It really works, thanks.
Oct 13 '08 #3

Post your reply

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