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

Stored procedure input...

Hi,
I know I'm missing something but I can't figure out what it is? Something trivial I'm shure.

Expand|Select|Wrap|Line Numbers
  1. create or replace PROCEDURE CREATE_BLOK_ID(transId IN NUMBER) AS
  2.  
  3.  
  4. BEGIN
  5.  
  6. EXECUTE IMMEDIATE 'CREATE TABLE Temp_BlokID_Values AS (SELECT TRANSPORT_ID,MARK_1,PORT_ID FROM DATABASE.TABLE WHERE DATABASE.TABLE.TRANSPORT_ID = transId)';
  7.  
  8.  
  9. END CREATE_BLOK_ID;


That's the procedure I have written and the code is used to call the procedure is the code underneath.

Expand|Select|Wrap|Line Numbers
  1. DECLARE
  2.  
  3.  
  4.  
  5. BEGIN 
  6.  
  7.       IFSAPP.CREATE_BLOK_ID('25196'); 
  8. END;
The stored procedure compiles fine, but on executing it it gives an error.

"TRANSID": invalid identifier at "DATABASE.CREATE_BLOK_ID", line 11 at line 6

I'm thinking that it has something to do with the input value of the procedure or the value type of the table I'm checking against with the WHERE clause.

Thanks in advance for the help.
Feb 29 '08 #1
4 1593
Never mind people, I found the sollution myself. The only thing I needed was a dynamic cursor. The funniest part if it all was the fact that I found it on the scripts forum.
Mar 1 '08 #2
debasisdas
8,127 Expert 4TB
what is this DATABASE.TABLE.TRANSPORT_ID
Mar 3 '08 #3
I think, i am not sure

when we use script means within inverted commas that means both compilation and execution happen at a time. so we can not pass value like this.
try this
Expand|Select|Wrap|Line Numbers
  1.  
  2.  CREATE OR REPLACE PROCEDURE procc
  3.     (p_item IN number,p_rows_del OUT varchar2)
  4.   IS
  5.     cursor_name   INTEGER;
  6.     a varchar2(200);
  7.   BEGIN
  8.     a:='CREATE TABLE Temp_BlokID_Values AS (SELECT ename,empno FROM emp WHERE deptno=)'|| p_item
  9.     cursor_name := DBMS_SQL.OPEN_CURSOR;
  10.     DBMS_SQL.PARSE(cursor_name, a,
  11.                 DBMS_SQL.NATIVE );
  12.     p_rows_del := DBMS_SQL.EXECUTE (cursor_name);
  13.     DBMS_SQL.CLOSE_CURSOR(cursor_name);
  14.  END;
  15.  /
  16.  
this creating procedure successfully but while executing its showing problem. if
you able to solve. plq alap let me know
Mar 5 '08 #4
amitpatel66
2,367 Expert 2GB
Why dont you make use of EXECUTE IMMEDIATE rather than DBMS_SQL package.

Try EXECUTE IMMEDIATE.....USING clause to CREATE a table and post back if it does not work.
Mar 5 '08 #5

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

Similar topics

7
by: Bill Kellaway | last post by:
Hi there - this should be fairly simple for someone. Basically I can't figure out how to pass the parameters from ASP to a Stored Procedure on SQL. Here's my code: I just need to help in...
3
by: dinesh prasad | last post by:
I'm trying to use a servlet to process a form, then send that data to an SQL server stored procedure. I'm using the WebLogic 8 App. server. I am able to retrieve database information, so I know my...
0
by: Nashat Wanly | last post by:
HOW TO: Call a Parameterized Stored Procedure by Using ADO.NET and Visual C# .NET View products that this article applies to. This article was previously published under Q310070 For a Microsoft...
3
by: Rhino | last post by:
I've spent the last couple of hours trying to figure out how to debug a Java stored procedure and am just going in circles. The last straw came when I got "Cannot open input stream for default"...
2
by: Dino L. | last post by:
How can I run stored procedure (MSSQL) ?
0
by: Amber | last post by:
Stored procedures are faster and more efficient than in-line SQL statements. In this article we will look at two SQL Server stored procedures; one using an input parameter and one not, and see how...
3
by: Bilbo | last post by:
I have a a headscratcher here: I have a form that when submitted should do 2 things when a user enters data and then clicks the Add button. Here goes: 1. Call a stored procedure called...
7
by: Siv | last post by:
Hi, I have a stored procedure that I want to execute and then wait in a loop showing a timer whilst it completes and then carry on once I get notification that it has completed. The main reason...
2
by: jed | last post by:
I have created this example in sqlexpress ALTER PROCEDURE . @annualtax FLOAT AS BEGIN SELECT begin1,end1,deductedamount,pecentageextra FROM tax
0
by: SOI_0152 | last post by:
Hi all! Happy New Year 2008. Il hope it will bring you love and happyness I'm new on this forum. I wrote a stored procedure on mainframe using DB2 7.1.1 and IBM language c. Everything works...
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:
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
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
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
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
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.