I've got a couple of questions about how to use a DBLINK from Oracle (9i) to SQLSERVER2005. The link is created and as long as I know the name of a table in SQLSERVER I can read it from Oracle, but I would like to be able to see what tables exist in SQLSERVER from Oracle. I want to run something like :
select * from all_tables@dblinkname
but whatever I try always comes back empty. Is there anyway I can find all the SQLSERVER tables from Oracle ?
Next question is that my application actually runs on a second Oracle instance. So it news to access the first instance through a link and then access SQLSERVER through another link so something like this :
select * from tablename@firstoraclelink@sqlserverlink
but that doesn't seem valid. Is there a way to use a DBLINK on a remote database ?
As per your second question, I would point to a view on the second database that is relying on a DBLink pointing to the third database.
Ugly, very ugly but it should work.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Yes good plan. The only thing is that I need to access all tables that come back from the select from all_tables, so I can't create a view because I don't know what I want to access until it is time to access it!
If that's the case mon cher ami you are in troubles.
I would change the strategy, that three tier strategy is complicated and also both performance challenged and unscalable. Experience says that if it looks too complicated and you go for it anyway you are going to bring increasingly bad things to your plate. Just MHO
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
I think I might have found a way to do what I need (but I'll have to hard code the table names) - but one more question, can I execute a stored procedure remotely ?
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Ok thanks got that now. I'm a bit new to stored procedures. I've set a string equal to my generated SQL statement, and then used Execute Immediate stringname; to run it, but it complains if the the sql statement/string is over 255 characters. Is there anyway I can execute a generated statement that is longer than 255 characters in the procedure ?
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Oracle is not complaining about your sql statement being larger than 255 characters.
You are getting the error at line 24; dbms_output.put_line cannot print more than 255 characters in a single line and that's a hard coded limit.
You can always do it by yourself perhaps resorting to dbms_output.new_line function.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Bookmarks