I have run this query to get the result as below, but, even if my query is running fine, that I do not get the expected result.
I'm looking for only column compare to my same target table as a table source.
My query:
Select case when column_name_s is null and column_name_t is not null
then "alter table GRADE_CONVERSION drop | column_name_t | ';'
When column_name_s is not null and column_name_t is null
then "alter table GRADE_CONVERSION add | column_name_s | ' ' || data_type_s | « ; »
else 'alter table modify GRADE_CONVERSION | column_name_t | ' ' || data_type_t | « ; »
alterations of the end
from (select s.column_name column_name_s, t.column_name column_name_t,
s.data_type data_type_s, t.data_type data_type_t
(select column_name, column_id, data_type
of all_tab_cols@database
where owner = 'erhan.
and table_name = "GRADE_CONVERSION."
+ 1
full outer join
(select column_name, column_id, data_type
of all_tab_cols@database
where owner = 'sarigul.
and table_name = "GRADE_CONVERSION."
+ 6
on s.column_name = t.column_name
)
Tables:
Target table: table GRADE_CONVERSION in sarigul@database
LETTER_GRADE | VARCHAR2 (2) | |
GRADE_POINT | NUMBER (3.2) | |
MAX_GRADE | NUMBER (3) | |
MIN_GRADE | NUMBER (3) |
Table source: Table GRADE_CONVERSION in erhan@database
LETTER_GRADE | VARCHAR2 (2) | |
GRADE_POINT | NUMBER (3.2) | |
MAX_GRADE | NUMBER (3) | |
MIN_GRADE | NUMBER (3) | |
CREATED_BY | VARCHAR2 (30) | |
CREATED_DATE | DATE | |
MODIFIED_BY | VARCHAR2 (30) | |
MODIFIED_DATE | DATE |
want to see output that is similar to this * (please ignore the names of column here it's just a clear example :))
ALTER table Target_table change BOOK_ID Varchar2 (4);
ALTER table Target_table I addSBN_10 Varchar2(13), null;
ALTER table drop TITLE Target_table;
Erhan_toronto wrote:
1.I used src.nullable src_nullable and tgt.nullable tgt_nullable but only show Yes as below: but want to see the result as not null or null
ALTER table TEST_TARGET change the NUMBER of MAX_GRADE (3, 2) Yes
Ok. So it's all about the Yes and the no decoding to Default Null or Not Null, isn't it?
So, to test, change one of the table of sample for NOT NULL columns in the source table, and then run the following query:
with src as ( select src.table_name src_table_name, src.column_name src_col_name, src.data_type src_data_type, src.data_length src_data_len, src.data_precision src_data_precision, src.data_scale src_data_scale, src.nullable src_nullable from user_tab_columns src where table_name = 'TEST_SOURCE' ), tgt as ( select tgt.table_name tgt_table_name, tgt.column_name tgt_col_name, tgt.data_type tgt_data_type, tgt.data_length tgt_data_len, tgt.data_precision tgt_data_precision, tgt.data_scale tgt_data_scale, tgt.nullable tgt_nullable from user_tab_columns tgt where table_name = 'TEST_TARGET' ), col_details as ( select src.src_table_name, nvl(tgt.tgt_table_name, first_value(tgt_table_name) over(order by tgt_table_name nulls last)) tgt_table_name, src.src_col_name, src.src_data_type, src.src_data_len, src.src_data_precision, src.src_data_scale, src.src_nullable, tgt.tgt_col_name, tgt.tgt_data_type, tgt.tgt_data_len, tgt.tgt_data_precision, tgt.tgt_data_scale, tgt.tgt_nullable from src left outer join tgt on ( src.src_col_name = tgt.tgt_col_name ) ) select * from ( select case when tgt_data_type != src_data_type or tgt_data_len != src_data_len or tgt_data_precision != src_data_precision or tgt_data_scale != src_data_scale or src_nullable != tgt_nullable then 'alter table ' || tgt_table_name || ' modify ' || tgt_col_name || ' ' || src_data_type || ' (' || case when src_data_type in ('DATE') then null else case when src_data_type in ('VARCHAR', 'VARCHAR2') then nvl(to_char(src_data_len), ' ') || ') ' else decode(nvl(src_data_precision, -1), -1, null, nvl(to_char(src_data_precision), ' ') || ', ' || nvl(to_char(src_data_scale), ' ') || ')') end end || decode(src_nullable, 'NO', ' NOT NULL', ' DEFAULT NULL') when tgt_col_name is null then 'alter table ' || tgt_table_name || ' add ' || src_col_name || ' ' || src_data_type || case when src_data_type in ('DATE') then null else case when src_data_type in ('VARCHAR', 'VARCHAR2') then nvl(to_char(src_data_len), ' ') || ') ' else decode(nvl(src_data_precision, -1), -1, null, nvl(to_char(src_data_precision), ' ') || ', ' || nvl(to_char(src_data_scale), ' ') || ')') end end || decode(src_nullable, 'NO', ' NOT NULL', ' DEFAULT NULL') end alter_statement from col_details ) where alter_statement is not null;
Erhan_toronto wrote:
2. when I run below under user sarigul and erhan I get the result as OWNER, TABLE_NAME, COLUMN_NAME DATA_TYPE... I have a link between two users. They have access to two tables.
- Select * from all_tab_columns
where owner = 'erhan' and table_name = "TEST_SOURCE."
- Select * from all_tab_columns
where owner = 'sarigul' and table_name = "TEST_TARGET."
Alright. This means that you both users are on the same database. Only change, you will have to do in the above query is so change user_tab_columns to all_tab_columns and add the OWNER predicate respectively with the clause.
Tags: Database
Similar Questions
-
It began to appear in the first inch of each merchant site I visit with the new version, "Congratulations!" Every $5 spent at JCPenney saves you a chance to win a $500 gift card. I have run scans and nothing appears not infected, but I don't get that annoying block in Internet Explorer. I uninstalled and reinstalled firefox and when I did, the first thing is present at his inauguration was a message that says: "you have joined the shop now...". "something or another and I had to click OK, it was a microsoft OK message. How can I get rid of this?
URL of affected sites
http://www.BestBuy.com, target.com, any site of retail trade
Your problem can be caused by Malware. You can run and update according to free anti-virus software:
1. Malwarebytes (free version) - http://www.malwarebytes.org
2. Spybot Search & Destroy - http://www.safer-networking.org
3. Spyware Terminator - http://www.spywareterminator.com
In addition, there are a number of forums, you can use to help get rid you of your infection. It is:
-
cable not connected network adapter
I have norton antivirus online via my ISP and I had to disable, because it comes with an error that says "cable not connected or missing network adapter" I use dial-up and do not use any type of router and I'm not on a network. I also tried to disable my network card & it still says the same error. I have an internal network card that came w / the computer (NOT a PCI one) and I wonder if there is a cord or a plug inside my computer that must be plugged. I made some changes on the internal hardware and might have missed an and I didn't have to open my Tower if it wasn't. It's a big hassle! Help, please!Hello
1. Once you get the error message?
2. do you get the error when you try to disable Norton anti-virus?
3. are you able to access the Internet explore?
Temporarily disable the antivirus on the computer running software and check if you are able to install the software.
Disable the anti-virus software
http://Windows.Microsoft.com/en-us/Windows-Vista/disable-antivirus-software
WARNING: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.
-
I transferred files using a windows vista belkin easy transfer cable to windows 7
* original title - I moved from my old laptop to my new files but can't open them as they say that they are not supported. Some files that I can open it but its just gibberish. Any suggestions would be appreciated.*
Hello
You must have the program, the files were written in vista installed in windows 7 to read
you do not have file extensions
read this
You must have the program installed to be able to read the files of programs
for example, if it's a .doc file, you installed Word
.xls, you need Excel
. PPS, you need Powerpoint
etc.
but fortunately, there are FREE viewers provided by Microsoft for the file extensions above which will save you having to buy Microsoft Office
Here are the download links for free Microsoft Word, Excel and PowerPoint viewers:
Word Viewer
View, print and copy Word documents, even if you don't have Word installed. This download is a replacement for Word Viewer 2003 and all previous Word Viewer versions.
Excel Viewer
Open, view, and print Excel workbooks, even if you don't have Excel installed. This download is a replacement for Excel Viewer 97 and all previous Excel Viewer versions.
PowerPoint 2007 Viewer
Microsoft Office PowerPoint 2007 Viewer allows you to view the presentations of all the features created in PowerPoint 97 and later versions.
and you can try the FREE Open Office applications game to read these file extensions
and here's how to set file associations
How do I... Change file extension associations in Windows Vista?
-
Can I connect offline and still run my acer netbook. I have the software synth, sonic foundry, and I have a book with cd on the internet. FTP and all that. All I need is the news and e-mail is it possible to change or do I remove all internet components?
Hello
The computer may be disconnected from the Internet by disabling the wireless network adapter on the computer (usually a button switch or the keyboard on the computer) or by disconnecting the wired connection. This means that all the files/folders that are not stored locally on the computer will be unavailable.
You can copy the files/folders on the local computer if the software allows it.
Chkdsk /f ask the user to follow the instructions here http://support.microsoft.com/kb/315265
-
Help! I've tried chrome and Explorer and when I get to the download page for the InDesign trial, nothing happens. I tried to start Adobe Downloader in advance, but he told me he needed to be updated and could not be updated due to a potential "configuration problem. I uninstalled and reinstalled the program and then tried again using these two browsers. Nothing. Internet Explorer gives me an error message after consulting the download page that says ""some content or files on this webpage require a program that you have not installed. " "
I really need quickly. Any help would be greatly appreciated! Thank you.
Sierra94 please see install and update apps - https://helpx.adobe.com/creative-cloud/help/install-apps.html for more information on how to install InDesign via the Cloud Desktop creative application.
To resolve the error you encounter in Chrome and Internet Explorer, I would recommend review AAM is not updated for Creative Cloud desktop Application.
-
I have a HP Deskjet 3050 a J611 all-in-one. I have used this printer with the same laptop that were purchased together.
He was works fine, but now when I try the CD to install, an error message comes up with cannot load drivers or cannot find the port to monitor? I tried everything to implement without change.
Have you tried to download the drivers from the Web site. Here is a link that will help you with it. http://goo.GL/BVOOg
-
It would be nice if Adobe has a helpline that they staff. I guess that this Byzantine system is designed to counteract the customer so that they give UP. I'm not a happy camper!
For these questions, you should contact customer service.
[subject moved to cloud Document PDF Services forum]
-
Why this query does not work on the CF when it works fine on MYSQL?
Subject says it all. I can run it through console mysql and get the result that I need, but when I place it inside a cfquery that he will not treat.
SET @saldo = 20000;
SELECT
IF (Co.transtipo=0,@saldo:[email protected],@saldo:=@saldo+t.transmonto),
@saldo: = @saldo - t.transmonto.
t.TransID,
t.cuentaid,
t.operacionid,
t.fechatrans,
t.voucher,
t.cheque,
t.transtitular,
t.transmonto,
t.transdetalle,
t.modificado,
Co.transtipo,
Co.Operacion
OF cuentastrans t
LEFT JOIN cuentasoperacion co ON t.operacionid = co.operacionid
WHERE the t.cuentaid = 7
ORDER BY t.fechatrans ASCFixed, coldfusion must be labeled with 'AS' of the expressions in the opposite case he used to index the column.
-
Have mutiple e-mail addresses in the Apex messaging features
Hello
I would like to be able to use a multiple selection box or the shuttle that will fill the e-mail for thought email Apex addressess.
I use 10g and Apex 3.2. I am able to send email through the application with an e-mail address. Please let me know if this is possible, as I couldn't find anything for this.
Thank you
MaryIf we put aside the actual sending of mail temporarily, let's see what we produce here:. If you don't mind, can you try this?
If you can reproduce this code snippet (either by commenting on relevant information or simply create a new one pulled by the same button (whilist by disabling the first).)
declare v_sql varchar2(4000); begin v_sql := replace(:p4_slct_eml,':', ', '); wwv_flow.debug('email string [ '||v_sql||' ]'); end;
Switch to debug mode, choose the email addresses that you want to test in your multselect article and click on the appropriate button. Chain of HRT being passed in the parameter of email address should appear in square brackets. Once you have done this, let us know the result.
-
I get a very strange bug with firefox after yesterday the upgrade to version 9.01
You are not on the latest version of Firefox. Update today
to get the best of the Web!
3/4 times it appears at startup which is strange because it is the most recent version and I removed the other oldest out of my system manually before installing.
I have seen this reported recently reset the default home page (subject: House) solves the problem. Ref:
https://support.Mozilla.com/en-us/questions/907328 Why my start page says "you are not on the latest version of Firefox. Update today to get the best of the Web! "when in fact I have the latest version?
Solution (Posted by SafeBrowser):
You can see this message under the Google search box on www.google.com/firefox which is the old default Firefox homepage. It seems that this page is no longer maintained by Google. You seem to have the latest version of Firefox.
If you want the Google search page as home page, change your home page to about: House (a new version of the old homepage Google/Firefox update is now integrated into Firefox).
See-> http://support.mozilla.com/en-US/kb/How+to+set+the+home+page
Also see-> https://support.mozilla.com/en-US/kb/Finding+your+Firefox+version
You can also see your version on the help > troubleshooting information display.The simple solution is to go to Start, the home page, tabs and download settings and click on the button "Restore Default", explained How to set the home page.
-
I have fixed everything at the time of my desktop computer starts up to a screen black with no explorer.exe running (the explorer.exe running only showed a folder at a time, until I restarted it.) and now I have a connection problem.
My netgear router has a connection with my computer, it shows green in the taskbar. However, my actual connection to the internet is not as lucky as the connection with the router.
I see the networks that I am able to connect to, but as soon as I did, I said that I am not currently connected to any network. If I go to "Connect to a network" I see clearly that I'm "connected with limited access" to Snet-G, which is one of the networks available to connect.
In my options of netgear, I am also connected to Snet-G, and it shows that it is actually connected.
My problem is the fact that I can "ipconfig" and I find none of my information, and when I try to ipconfig/all, it gives me an error something while not connected, so it says that I'm connected and does not, at the same time. My local internet does not work (can not navigate to 192.168.1.1 and others), and of course for this reason, my global internet does not work.
I need a fix for this, because I just put a ton of subscriptions for this month, which are already paid, and if I can't use this month is a good slice of $50 trash just because I fixed something.
Thanks, that's a well advanced topic.
I tried the following:
System Restore (6 days back, the problem started 2 days ago)
Restarting the computer
Unplug modem (30 seconds)
Restarting the router/Reset
Connection to the Snet-N instead of the Snet-GThings to take note, if you do not already consider: I can't connect to my router config (192.168.1.1), my computer says I am connected locally, but not in the world.I have some information about the modem if necessary.-I have restored my computer 6 days ago, but only changed my problem with explorer.exe back. Internet broke again-. -.Hello
Method 1:
I suggest you to follow the links and check out them.
Windows wireless and wired network connection problems
Network connection problems
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-network-connection-problems
The problems of Internet connection
http://Windows.Microsoft.com/en-us/Windows-Vista/troubleshoot-Internet-connection-problems
Method 2:
I also suggest that you see the link and search for connected with limited access
Message when a device on a Windows Vista-based computer uses a network bridge to access the network: "connected with limited access".
-
Bought Office Acrobat 11 DC Pro to my PC running Windows 7 - I have more than enough RAM and storage, but get the message: "this application cannot be installed on this operating system. The installation program will end now. Please refer to the minimum requirements to... "Can't determine the location on the Adobe Web site to get answers. Any suggestions?
I deleted an earlier version of Acrobat Pro from my computer. Still, I get the same message.
Hi John,.
Please specify if you have purchased DC Acrobat or Acrobat 11 or upgrade you to the latest patch for Acrobat 11, that is to say 11.0.11 so that we can help you accordingly.
I wonder if you have checked your system requirements before you download Acrobat.
I would also ask to share with you the screenshot of the error message with us.
You could probably uninstall Acrobat using cleaning tool. Here is the link for the same thing.
http://labs.Adobe.com/downloads/acrobatcleaner.html
If you were installing DC, check out the following link to download.
https://helpx.Adobe.com/Acrobat/KB/Acrobat-downloads.html (classic)
https://helpx.Adobe.com/Acrobat/KB/Acrobat-DC-downloads.html (continued)
Concerning
Sukrit diallo
-
I wonder if my Macbook must be sent to the trash since I can no longer get updates to the OS. I have 10.6.8. When I try it tells me that they will not be installed on this computer. It works fine but I do not receive security and other software updates any more. What can I do?
The computer has a value for someone who does not have a new OS X and does not use
the last iDevices; Thus the old app from iTunes and stuff would be a good deal, as it is.
Without more information on the model number and build year, propose any later version
OS X update (because there may be one or two; if nothing shows up on the Mac App Store)
However, without more information, such as the about this Mac can show you the
Details on my side that are not lacking.
• How to identify MacBook - Apple Support models
{This page to support old shows original - and also new macbook 12 in. of retina series}
What is your MacBook (13-inch, mid 2010) computer model?
This is the May 2010
Abandoned by July 2011
Model identifier MacBook7, 1
Model number A1342
EMC 2395
MC516LL/A order number
The link to the support page above also includes how to identify the details in a separate link in it
that tells how to find the serial number and other specifications. Sites such as the
http://EveryMac.com include most if not all Apple product specifications.
If the computer that you have is a MacBook 13-inch Mid-2010, he could run the new OS X
However, if the old hard drive is full, saved from the old stuff, you want to get an external
Hard drive and create an archive of it; Perhaps a clone of the complete system. However if you
use a time Machine, which can help in some cases. The original hard disk can be
have worn out, so it might be a good idea to replace it with a new larger capacity
hard drive. In addition, chips of memory could be improved to higher total capacity, too.
Those things would give the MacBook OSX current or most recent advantage.
If the computer is far from the trash. Those who are still worth something, too, if sold at
an individual and not some buy-TI - cheap.com. If you choose to be rid of the macbook:
• What to do before you sell or give away your Mac - Apple Support
• How to prepare your Mac for sale:
http://www.thesafemac.com/how-to-prepare-your-Mac-for-sale/
The browser upgrade: your model may use Mozilla's Firefox, he sees updates...
• How to download and install Firefox on Mac - Mozilla Firefox Help:
https://support.Mozilla.org/en-us/KB/how-download-and-install-Firefox-Mac
Anyway, the computer is new enough to be of good use.
Most of my friends is older than that!
-
I installed Windows 7 RC today and trying the route of a local domain in C:/Windows/System32/drivers/etc/hosts, but get an error when you try to save it with Notepad:
"You don't have permission to save in this location. Contact the administrator for approval. »
If I try to save it to my documents and then copy the file over I have another error:
"You need give the administrator permission to copy to this folder."
My account is the only account is already an administrator.
How can I do this?
See you soon.
Right click on Notepad, and choose Run as administrator. Click on file, then open, then navigate to
\Windows\system32\drivers\etc
In the menu drop-down edit files text (*.txt) to all files (*. *)
Open the hosts file and change now :-)
Maybe you are looking for
-
How can I get back are erased the music on my iPod nano?
Well, I sort of accidentally "erased and synced" all the music from my iPod nano. I've lost countless songs and albums. Is it possible to recover or restore lost music files? Please tell me that I have not just stupidly everything lost! Thank you
-
Is there a way to automatically update iOS applications during synchronization?
I noticed that with iOS 9.2.1 apps that I've updated in iTunes don't are not automatically updated in my devices iOS during the synchronization process. I need to scroll through the entire apps list, select the update apps I want to transfer my devic
-
Satellite A200 - 23 k - view corruption during outdoor display is connected
HY everybody :)If this problem occurs in 95% of the time when the external display is connected. Picture looks like it has some artifacts and color everything is blurred. ATI tools does not detect objects, and the system reboot or wake after sleep "s
-
HP PhotoSmart 5520 - Airport Extreme - Airprint - 'no AirPrint printer found. '
Dear HP I used to be able to print from my iPad, iPad Mini, iPhone 5 c or iPhone 5 for my PhotoSmart 5520 using AirPrint. No more. I can: 1. see and print from my Mac Pro and iMac 2 see and print from Android Nexus 4 of my brother 3. see and configur
-
HP mini 210 1040eh: a 10.8V or a 11.8V battery
Hello! I have my netbook (hp mini 210 1040eh) years. I change the battery because that primary is not working properly. It has a characteristic of 10.8V. I was looking for a replacement with the largest capacity (5600mAh) and especially found only 11