473,503 Members | 722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to pass table name in DB2 Procedure?

how to pass table name in DB2 Procedure. i passed as IN variable. like this

Expand|Select|Wrap|Line Numbers
  1. CREATE PROCEDURE PROC1 (IN TNAME CHAR (12))
  2.    BEGIN
  3.       UPDATE TNAME P
But it throws an error as

Category Timestamp Duration Message Line Position
Error 11/2/2010 11:50:03 AM 0:00:00.000 DB2 Database Error: ERROR [42601] [IBM][DB2/AIX64] SQL0104N An unexpected token "DECLARE ACCNT_WID_CURSOR FOR SELEC" was found following "SQLSTATE '02000'; ". Expected tokens may include: "<psm_set_token>". LINE NUMBER=11. SQLSTATE=42601
108 0
Nov 2 '10 #1
0 1865

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

Similar topics

9
2146
by: Max | last post by:
I'm new with Javascript and can't seem to figure out what I'm doing wrong here as I'm not able to pass a simple variable to a function. In the head of doc I have: <script...
5
13659
by: adi | last post by:
Hi all, Seems like a fundamental question to me but I dont have a definite answer for it, Gurus please enlighten me. I have a table 'Table1' whose structure changes dynamically based on some...
3
52293
by: ryanmhuc | last post by:
Is it possible to have a dynamic table name within a query or a table name that is a variable? This does not work but gives an example: SELECT * FROM concat('table', 'name') - OR - SET @table...
11
3736
by: kennthompson | last post by:
Trouble passing mysql table name in php. If I use an existing table name already defined everything works fine as the following script illustrates. <?php function fms_get_info() { $result =...
0
2139
by: Afaque Khan | last post by:
HI All, I have a requirement, I need to pass table as IN parameter in the stored procedure. But when I do this it just says Table 'database.strtable' doesn't exist . Can you guys please advice...
6
26808
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...
4
3305
azimmer
by: azimmer | last post by:
I need a function that can calculate percentiles of various tables and columns. I cannot seem, however, to be able to pass table name as a parameter to the function. Here's the code: create...
3
2913
by: jojo41300000 | last post by:
Hi, I am trying to pass the table name to stored procedure and then use the passing table name in select, update or delete query statement. When I tried to do that, I got the error such as...
2
1782
by: Krishbiztech | last post by:
hi all I have developed an asp.net application that handles college operations.. and i have created a stored procedure to delete the records under some constraints.. I have passed table...
2
2696
by: BulbFresh | last post by:
Hi, I'm a novice Access user and have a simple question but can't seem to find the answer. I have tables imported and named by the user on import e.g. January. I then need to run a query on the...
0
7089
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
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7463
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...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
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...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3157
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.