473,414 Members | 1,606 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,414 software developers and data experts.

Concat variable to form Table name inside Select statement

Are you looking for this?
Expand|Select|Wrap|Line Numbers
  1. SET @a = 'table';
  2. SET @x := CONCAT('SELECT * FROM ', CONCAT(@a, '_', 'name'));
  3. Prepare stmt FROM @x;
  4. Execute stmt;
This is equal to
Expand|Select|Wrap|Line Numbers
  1. SELECT * FROM table_name;




i need help,
how to Concat variable to form Table name inside insert statement in PL/SQL in oracle 7.3 ?

thank you..
Jan 22 '08 #1
4 10876
mwasif
802 Expert 512MB
Hi soelistyani,

Welcome to TSDN!!!

I am moving the question to Oracle Forum.
Jan 22 '08 #2
debasisdas
8,127 Expert 4TB
try like the following sample code snippet.

Expand|Select|Wrap|Line Numbers
  1. declare
  2. t_name carchar2(30) :=&t_name;
  3. str_ins varchar2(200);
  4. begin
  5. str_ins:='insert into' || t_name || 'values  (...........,........,..........);
  6.  
  7. execute immediate str_ins ;
  8. end;
  9.  
  10.  
Jan 23 '08 #3
vallis
1
Hello
I m also having requiremnet of same kind.
I would like to know how to concat a variable to a table in pl/sql
as i need to insert data from the concated table to a custom table
please help

thanks
Jan 25 '08 #4
debasisdas
8,127 Expert 4TB
Hello
I m also having requiremnet of same kind.
I would like to know how to concat a variable to a table in pl/sql
as i need to insert data from the concated table to a custom table
please help

thanks
kindly post the code that you are working on for reference of our experts.
Jan 25 '08 #5

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

Similar topics

4
by: Nomen Nescio | last post by:
can anyone be so kind as to look at http://www.mysolution.ws/HYPOCRITE.php and let me know why it isn't passing the form data to http://www.mysolution.ws/insertHYPOCRITES.php for the most...
6
by: BigDadyWeaver | last post by:
I am using the following code in asp to define a unique and unpredictable record ID in Access. <% 'GENERATE UNIQUE ID Function genguid() Dim Guid guid =...
3
by: Tim | last post by:
Hi All, I have a small issue that I can't seem to figure out. I have a SQL statement that is dependant on the results of a drop down to chose which table to select from. Unfortunately it does not...
3
by: r rk | last post by:
I am trying to write a utility/query to get a report from a table. Below is the some values in the table: table name: dba_daily_resource_usage_v1...
25
by: Lyn | last post by:
Hi, I am working on a genealogy form. The only table (so far) lists everybody in the family, one record per person. Each record has an autonum ID. The parent form (frmMainForm) displays the...
6
by: GarryJones | last post by:
I think the following statement .... $ml_collect='SELECT *, DATE(CONCAT(field1, field2)) AS thedate FROM ml_lopp LEFT JOIN scfmforening ON (scfmforening.scfmnum = ml_lopp.scfmnum) LEFT JOIN...
8
by: tnspc | last post by:
I'm trying to access a Request.Form variable and plug it into an SQL statement, so that the statement will select just the particular data I need. Here's the offending snippet of code: sql =...
6
by: antmail | last post by:
Hi guys, I have spend several days now trying to solve this problem inside a stored procedure. I want to call a procedure providing 3 variables. The variables area used to select the appropriate...
5
by: plumba | last post by:
Hi all I have a form (see below), which for some reason has decided to stop functioning all together. It just does not call up the function. It is called up in the opening <form> tag but...
3
by: adiel_g | last post by:
Hello everyone, I am trying to move a field name to a variable in vb.net. For example, first I retrieve the record from the database and save its value: .... userGroup =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.