Home » RDBMS Server » Server Administration » Dynamic SQL error
Dynamic SQL error [message #370164] Tue, 26 December 2000 21:45 Go to next message
Kiki
Messages: 13
Registered: November 2000
Junior Member
I have dynamic sql which return an error. what it does is to open many table from differnt column.
command:= 'select'||column_name||' from ' ||table_name
even though that column_name are either number or string will return string value.
it works fine for other table, however, only having a problem for one table only, in particular with one field which has number(2). the error number is ORA-06255( SOrry I am not really sure about this, I ll confirm that later, if required). it return an error numeric or value error.

does anyone help me what should I do?
Re: Dynamic SQL error [message #370165 is a reply to message #370164] Tue, 26 December 2000 22:51 Go to previous messageGo to next message
P. Lavanya
Messages: 8
Registered: November 2000
Junior Member
Hi,

The error 'Numeric or Value error' is probably coming because the length of the variable declared in your procedure to hold the column values, is lesser than the actual field length defined in the table.

For ex:

create or replace procedure tab_col(col in varchar2, tabl in varchar2)
is
vcol varchar2(3);
..........

Dept table:
Deptno number(10
Dname varchar2(30)
loc varchar2(30)

Suppose you want 'Dname' column values.
SQL> exec tab_col('dname','dept')

vcol length is 3 in the procedure whereas the dname field length is 30 in the table dept.

Bye,
lavP
Re: Dynamic SQL error [message #370167 is a reply to message #370165] Tue, 26 December 2000 23:04 Go to previous message
Kiki
Messages: 13
Registered: November 2000
Junior Member
THX,
I thought the same way, however, it seems that it wasn't the problem. because, It works fine for other columns with the same size of the column ->> number(2). So I still could not figure it out that problem..

Thx:)
Previous Topic: Date Format wrong
Next Topic: help
Goto Forum:
  


Current Time: Fri May 17 01:05:23 CDT 2024