Home » SQL & PL/SQL » SQL & PL/SQL » %type variables
%type variables [message #217867] Mon, 05 February 2007 22:42 Go to next message
t.sampath
Messages: 1
Registered: February 2007
Junior Member
Hi all
I want to declare a variable using %type. I am using the table of another database and i want my variable in the PLSQL block to be of the same type as that of a column in this table. Like i wan to use

declare
v_first table@someDB.first%type;

begin
--some statemnets
end;
/


When i exec this block, it says 'Unable to access another database
'someDB.first'

I have access to this database. Please let me know how to solve this...

Regards
Sampath Thiruvengadachari
Re: %type variables [message #217894 is a reply to message #217867] Tue, 06 February 2007 00:32 Go to previous message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
Quote:
v_first table@someDB.first%type;

I assume table is the table name and first is the column name and someDB is databaselink name.

In this case, you have to refer the particular column as
table.first@someDB
instead of
table@someDB.first
By
Vamsi
Previous Topic: how to count columns in table
Next Topic: Help required in using IN clause
Goto Forum:
  


Current Time: Sun Dec 04 12:34:10 CST 2016

Total time taken to generate the page: 0.09860 seconds