ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table
One of our developers has problems with a select of different tables:
SELECT ROWID, TMP_TABLE_ALIAS.* FROM (select a.*, B.*, (SELECT MAX(TMP_CODEMP) FROM ATE_TABLE WHERE TMP_IDTRE = TRE_ID and TMP_FI is null ) AS TRE_CODEMP, (SELECT MAX(REV_DATA) FROM AR_TABLE WHERE REV_ID = TRE_ID ) AS TRE_DATREV FROM AT_TABLE a, AP_TABLE B WHERE PER_ID = TRE_ID (+) ) TMP_TABLE_ALIAS;
This statement works on the development environment, but in the production environment it fails with:
ORA-01445: cannot select ROWID from, or sample, a join view without a key-preserved table 01445
The database versions is the same in both environments: Oracle 10g Release 2 (10.2.0.5).
After reviewing the tables in the production environment, I noticed that one of the tables has no primary key, and that caused the ORA-01445. Even with a unique index the select fails, it’s mandatory to declare primary keys for the tables when they are involved in joins.
Compress a folder with tar
To archive and compress a folder with tar use this command:
$ tar -czvf folder.tar.gz folder
Be careful with the parameters order: tar -czvf is not the same as tar -cvfz. The fist one is ok, but the second one ends with an error:
$ tar -cvfz folder.tar.gz folder tar: folder.tar.gz: Cannot stat: No such file or directory folder/ folder/file1.txt folder/file2.txt folder/file3.txt tar: Exiting with failure status due to previous errors
An ls will show a z file. The reason is that the -f parameter takes the next argument as the filename to archive, thus the z file in our folder. So you have to use the tar -czvf syntax.
Install less on Ubuntu with YUI-compressor
Some days ago I’ve been testing twitter bootstrap and I’m very interested on using less on my projects.
Less brings programming into CSS files. Learn more about less in the less website.
To compile the .less files in Ubuntu, first install the requiered packages [please refer to the updated note at the end of the post]:
$ sudo apt-get install lessc
Now you can create your first less file:
@color: #4D926F;
#header {
color: @color;
}
h2 {
color: @color;
}
and compile it:
$ lessc my_first_less_file.less
#header {
color: #4d926f;
}
h2 {
color: #4d926f;
}
You can redirect the standard otuput to a file to get the css file:
$ lessc my_first_less_file.less > my_first_less_file.css
To output the minified CSS, just add the -x option:
$ lessc -x my_first_less_file.less
#header{color:#4d926f;}
h2{color:#4d926f;}
You can also use the YUI Compressor with less:
$ lessc --yui-compress my_first_less_file.less
#header {
color: #4d926f;
}
h2 {
color: #4d926f;
}
Yep! Something’s wrong… Is there an error with less –yui-compress?
I think there’s a problem with the –yui-compress option.
To workaround this, I’ve installed yui-compressor:
$ sudo apt-get install yui-compressor <em id="__mceDel">
Now, I generate the css with lessc and then compress it with YUI:
$ lessc --yui-compress my_first_less_file.less > my_first_less_file.css
$ yui-compressor my_first_less_file.css
#header{color:#4d926f}h2{color:#4d926f}
I will do further investigation about the less –yui-compress fail.
Updated!
I’ve installed the incorrect version of less, and the –yui-compress was not working:
I previously installed this packages:
<pre>$ sudo apt-get install libc-ares2 libev4 libnode-less libv8-3.1.8.22 nodejs
But this installs an old version of less:
$ lessc --version lessc 1.1.0 (LESS Compiler) [JavaScript] $ sudo apt-get remove lessc --purge $ sudo apt-get install lessc $ lessc --version lessc 1.3.3 (LESS Compiler) [JavaScript]
Now I can compile with –yui-compress working!
Subversion: svn add recursive
The subversion svn add command does not support the recursive option to add several unversioned files.
But you can use this trick from your working copy:
$ svn add --force *
Splitting files with 7zip without compression
I have to copy a large (12GB) file to an external USB Drive that’s formatted in FAT32, which is limited to a maximum of 4GB per file.
I can split the files with the split command, but the owner of the disk has Windows, so I decided to generate a multipart 7zipped file from command line. As the original file is already compressed, I use no compression switch:
$ 7z -a <filename> -mx0 -v4000m <file_to_be_compressed>
The switches stands for:
- -mx0: level of compression, where 0 means copy mode, i.e., no compression (usr/share/doc/p7zip-full/DOCS/MANUAL/switches/method.htm)
- -v4000m: create volume size of 4000 MB (/usr/share/doc/p7zip-full/DOCS/MANUAL/switches/volume.htm)
If you use -v4g to generate 4GB chunks, this 4GB will be grater than the FAT32 4GB, and it will be impossible to copy to the FAT32 USB drive .
Once completed, you’ll have several files deppending on the size of the file to compress, named filename.7z.001, filename.7z.002, …
2012 in review
The WordPress.com stats helper monkeys prepared a 2012 annual report for this blog.
Here’s an excerpt:
19,000 people fit into the new Barclays Center to see Jay-Z perform. This blog was viewed about 93.000 times in 2012. If it were a concert at the Barclays Center, it would take about 5 sold-out performances for that many people to see it.

Recent Comments