Problem with using TOracleDataSet

007x

Member
I want to change table name dynmaicaly so I write the sql statement in OracleDataSet like this :
OracledataSet1.Sql.Text := 'SELECT * FROM %S'

At run time, I use the following command to change the sql statement.
OracleDateSet1.Sql.Text := Format(OracleDataSet1.Sql.Text,['TheTableName'])

But when I Open the DataSet , there are error message 'ORA-1460 unimplemented or unreasonable convention requested'.
But it only happen in then first time running this sql statement. When I try to run it again(the program without reset) it is ok and work find.

Can anyone have this experience...
Thanks
 
Perhaps you can use our Oracle Monitor utility to find out what statement is executed when this error occurs?

------------------
Marco Kalter
Allround Automations
 
Originally posted by mkalter:
Perhaps you can use our Oracle Monitor utility to find out what statement is executed when this error occurs?


I use OracleMonitor and found that there are two sql statement automaticaly run in the first executation of my select statement.
The error occure when the second statement execute.
There are the statements :

1.****************************************************************************************

begin
begin
select user, table_name into :table_owner, :table_name
from sys.user_tables where table_name = :name;
exception when no_data_found then
begin
select user, view_name into :table_owner, :table_name
from sys.user_views where view_name = :name;
exception when no_data_found then
begin
select table_owner, table_name into :table_owner, :table_name
from sys.user_synonyms where synonym_name = :name;
exception when no_data_found then
begin
select table_owner, table_name into :table_owner, :table_name
from sys.all_synonyms where owner = 'PUBLIC' and synonym_name = :name;
exception when no_data_found then
:table_owner := null; :table_name := null;
end;
end;
end;
end;
end;

2.****************************************************************************************

select constraint_name, column_name from sys.all_cons_columns
where owner =
redface.gif
wner and table_name = :table_name
and constraint_name not like 'SYS_C%'
order by constraint_name, position

******************************************************************************************
 
Problem Slove.
I havne't add all field in the field editor.
But I don't know why.
In design time, I haven't a real table name, only have a parameter %s, so I can't all those field into the field editor. I try to give a actual table name and add fields in field editor and change the table name back to %S. After I do this, I can't run properly.

Thanks for help
 
I'm not sure I understand the relation between the problem and the sulution. I'm also puzzled why the second statement would lead to an ORA-01460 exception, regardless of the table name. Can you verify what the value of the :owner and :table_name variables are when the error occurs?

------------------
Marco Kalter
Allround Automations
 
'ORA-1460 unimplemented or unreasonable convention requested'.

I don't know if this is relevant but we started getting this all over the place, PL/SQL suffers from it as well ( at least the version we have does).

The reason that it occurred in our applications was due to the way the user is logged in. If the connect type was set to caNormal we would get the above error if its set to the caSYSDBA we wouldn't. Now we couldn't guarantee that the user would have DBA priviledges so we changed which tables it was accessing ie to USER_TABLES etc.

I've just seen the same error message happening in PL/SQL developer when I log in as a NORMAL user and try and edit the tables.

Anyway it may have absolutly nothing to do with this problem.

Cybrey

[This message has been edited by Cybrey (edited 14 January 2003).]
 
Back
Top