472,374 Members | 1,500 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,374 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 10787
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: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
1
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
DizelArs
by: DizelArs | last post by:
Hi all) Faced with a problem, element.click() event doesn't work in Safari browser. Tried various tricks like emulating touch event through a function: let clickEvent = new Event('click', {...

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.