What is ‘Where 1=1, 1=2’ in Oracle SQL?

Question (Posted by Michael using Contact Form under ‘Contact US’ page):
What is the purpose of using where 1=1 and 1=2 in Oracle SQL?

Answer by TechOneStop:
Hi Michael, thank you for posting your question on our discussion forum.
In Oracle database, where 1=1 means true and 1=2 means false because 1 is never equal to 2 🙂
You could use any number like 2=3 or 3=3, only thing that matters here is both numbers are same or not. 
Let us give you an example. Suppose we have to create a table (table_b) same as another table (table_a) but do not want to copy any record from table_a, only table structure will be same for both tables. Here we can write query like below:
– This will create table_b same as table_a without copying records from table_a, only table description will be copied to table_b.

Now if we want everything from table_a will be copied to table_b, write query like below 
– This will copy table structure, all records from table_a to table_b.

Even you could use string also like ‘tech’ = ‘techonestop’ or ‘tech’=’tech’. You could use ‘where 1=1’ or ‘1=2’ in any query like SELECT COUNT(*) FROM TABLE_A WHERE 1=2; 

Please let us know if it was helpful. If you want to add more information, please feel free to comment here.

What is Caret Browsing ( or Caret Navigation) ?

Have you heard about Caret Browsing? This is quite old technical term but if you are not keyboard savvy person, you would not be familiar with caret browsing or caret navigation.
Like most of the people, you probably use mouse to select text on a webpage during internet browsing and just for typing purpose, you use keyboard. But what would you call it, if you can select text on a webpage by using keyboard only? This is what we call as called Caret Browsing or Caret Navigation where a caret (also known as ‘text cursor’ or ‘text insertion cursor’ or ‘text selection cursor) is used to navigate within webpage, same as Microsoft Word. But this feature is not supported by all browsers, Internet Explorer and Mozilla Firefox support Caret Browsing.
To enable or disable Caret Browsing on a webpage, just press ‘F7’ function key. It will prompt you to turn Caret Browsing on, press ‘Yes’ and Caret Browsing will be enabled. Now you can use various navigation keys on your keyboard including ‘Home’, ‘End’, ‘Page Up’, ‘Page Down’, 4 arrow keys to select text, hold ‘Shift’ key and move the caret to select multiple lines. Almost it looks like a cellphone browser, quite useful when you are using laptop touchpad rather than a mouse.

To enable caret browsing in Internet Explorer and Mozilla Firefox:
– Press F7 function key and then click ‘Yes’ on the popup window

What is Caret Browsing - techonestop.com

– To enable Caret Browsing for new window and tabs (only for Internet Explorer), click on ‘Tools’ (‘Gear’ icon on top right hand corner), go to Internet Options > Advanced and mark the check box ‘Enable Caret Browsing for new windows and tabs‘ true.

Caret browsing - techonestop.com

To disable Caret Browsing, press F7 again. If the checkbox ‘Enable Caret Browsing for new windows and tabs‘ is marked, uncheck it.

For more updates on recent activities, follow ‘TechOneStop‘ on Facebook / Twitter / LinkedIn or join our website as follower.

How to display barcode on Oracle BI Publisher report

We all know use of barcode, right! It helps business to track a product or order quickly and accurately. Like in any supermarket, barcode helps to identify items easily and accurately. But how to generate barcode from Siebel or any other system? Can we generate and display barcode on Oracle Business Intelligence Publisher Report?
Answer is YES, we can use BI Publisher as barcode generator and print/display barcode on report.

Recently, I was working on a requirement for one manufacturing company where they were looking for better approach to track Service Request and RMA (Return Material Authorization) of products distributed among different systems. So easiest and reliable solution is Barcode but how will it help them to meet their goal? Well, let me give you a business scenario. Right now, business uses Siebel CRM application to create service request of any product or order. Suppose for RMA type service request, Siebel system will generate the RMA number and then send it to dispatch section for mail communication. So for dispatch section, it is manual task to enter RMA number into System. Next for RMA working department, it is another manual task to enter RMA number into their system. In complex system, business could have more hierarchy and more hierarchy means higher chance of doing wrong entry. So they need automation of this manual task to make the process faster and error free (almost error free) and best solution is barcode automation. Siebel will generate the RMA number and send it to reporting system (here business is using BI Publisher for reporting purpose). Then BI Publishers will change the RMA number to barcode which will be referred by all other business units. To read barcode, business units need only barcode scanner which will change the barcode to actual number and make an entry on their system. Faster and error free, isn’t it!!

Now, question is how BI Publisher will generate barcode and print it on report? 
Barcode is nothing but special kind of font which barcode scanner only can read. There are few free barcode fonts and few paid fonts. As per requirement, you could pick free font or paid. For our requirement, we have used free barcode font 39HIHR.ttf of barcode39 font family. In Microsoft Word, 39HIHR.ttf looks like below (barcode above and number down).
How to display barcode on Oracle BI Publisher report www.techonestop.com
You can download the font from Google. If the font file is zipped, then unzip it and paste it under C:WindowsFonts folder. Once you paste Code39.ttf, it will be installed automatically and you should see many other barcode fonts like 39HI.TTF, 39HIHR.TTF, 39HITLHR.TTF. To verify the new barcode font, open one word doc in MS word, write any text and select one barcode font. You will see the text in barcode font. Now our first step is completed. We have successfully installed barcode font on our system so that we could build our report template using barcode font. Here we have used 39HIHR.ttf as business needs barcode bar above and RMA number down what exactly this barcode font provides
Next check BI Publisher Desktop is installed on your system or not. We need it to build template with barcode font. If BI Publisher Desktop is installed, then you could see Oracle BI Publisher Add Ins tab in MS word. I hope you know how to add bookmark to display field in report. Here we have added two bookmarks, one for SR number and another for RMA Number and we have picked BC 39 HI HR font (which is nothing but display name of 39HIHR.ttf font) for both two fields.
display barcode on Oracle BI Publisher report www.techonestop.com
Once report template is ready, see the preview to check barcode font. To see preview, first add the font in xdo.cfg file, located under ..BI Publisher DesktopTemplate Builder for Wordconfig. If you are doing for first time, then you may have xdo_example.cfg instead of xdo.cfg. We have to rename this file as xdo.cfg and add below script under ‘<!– Font setting –>’ section.
<font family=”BC 39 HI HR” style=”normal” weight=”normal”>
<truetype path=”C:Program FilesJavajre6libfonts39HIHR.ttf” />
It should look like below
xdo.cfg www.techonestop.com
Now we can see the preview of the template. To see preview, click on Preview option from Oracle BIP Toolbar and select the report type (example PDF, DOC, HTML). If the template preview does not meet our requirement, modify it and verify it again. Once the template is ready, generate XLIFF file from the original template. At runtime, original template is applied for the layout and the XLIFF file is applied for translation.
Follow below steps to generate an XLIFF file from an RTF template
    – Open the template in Microsoft Word and click on Add-Ins tab
    – From the Template Builder menu, select Tools > Translate Template > Extract Text, BI Publisher 
      will extract the translatable strings from the template
    – Save the file with .xlf extension
Now our template and XLIFF file are ready. Next step is font mapping in BI Publisher so that we could use BIP as Barcode Generator. Follow below steps to configure new font in BIP.
Step 1:
Check the java path which is getting referred by Business Intelligence Publisher server and copy the font file (39HIHR.ttf) from C:WindowsFonts to .. Javajre(version no)libfonts
    – Make sure, font file extension (.ttf) is in small letter otherwise font may not appear in font mapping dropdown
    – If the extension is in Caps, then change it to small letter first and then copy it
    – Restart the werserver (OC4J/Tomcat) service if required

Step 2:
Login to BI Publisher Application and Navigate to Admin > Runtime Configuration > Font Mappings
Oracle BI Publisher font mapping www.techonestop.com
Step 3:
As per report template type (RTF or PDF), click on ‘Add Font Mapping’ button to add font. As we have used RTF template for our requirement, font mapping for RTF template type will be sufficient, no need to do anything on pdf font mapping option.
              Base font = BC 39 HI HR (Base Font value should be same as font display name in MS Word)
              Style = Normal
              Weight = Normal 
              Target Font Type = Truetype
              Target Font = Actual font file (39HIHR.ttf)
              TTC Number = (keep it blank)

Barcode font mapping on Oracle BI Publisher report www.techonestop.com

Step 4:
Click on ‘Apply’ button from right hand side top corner and restart the webserver (OC4j or tomcat) service.

That’s all. Now goto Siebel application, upload files (template file and XLIFF file) on Administration-BI Publisher and generate reports. You could see nice barcode on the template.

Few things to remember:
– Font file extension (.ttf) must be in small letters otherwise font may not appear in font mapping dropdown
– Sometimes barcode scanner needs barcode terminator to read the code properly, mainly if you are using code39 barcode font. Here we have used * (asterisk) as terminator.

If you have any doubt or question, feel free to ask us. To get more updates on recent activities, follow ‘TechOneStop’ on Facebook/Twitter/LinkedIn or join our website as followers. In our next article, we will discuss about how to display MICR code and QR code on BIP Report.

Watch our video as well:

Junk characters in SoapUI response – how to fix it

Getting junk characters in SoapUI response?weird characters in SoapUI response

Well, this is quite common issue in SoapUI during web service testing.

These junk characters are nothing but SoapUI compressed response.

Follow below steps so that you can see actual XML response without encoding:

1) Navigate to File > Preferences > ‘HTTP Settings’ on SoapUI interface

2) Verify ‘Response compression‘ property on HTTP Settings page

            – Uncheck the option ‘Accept compress responses from hosts

3) Verify ‘Disable Response Decompression‘ property (just below ‘Response compression’ )

            – Make sure ‘Disable decompression of compressed responses‘ checkbox is unchecked

soapui response encoding

That’s it!

Now submit the request XML once again and you will get the response in XML structure.

If you have any of these two options checked, SoapUI encodes the response file and you see junk characters instead of XML.

You can still see the encoded SoapUI response if there is any encoding rule in WSDL file.

Please leave your comment below if the above solution does not fix your problem and still see junk characters in SoapUI response.

Would you like simpler and lighter web service testing tool than SoapUI?

Then read this article – 5 SoapUI alternative applications.

Keep in touch, follow TechOneStop on Facebook / Twitter / LinkedIn / Google+.

What is ActiveX

ActiveX is nothing but a small piece of code(better known as Add-ons), created by Microsoft. If you have Internet Explorer installed on your computer, then ActiveX is also installed. Purpose of this ActiveX is to improve the browsing experience but it only works with Microsoft applications like MS Word, Excel, PowerPoint, Internet Explorer.  The Idea behind ActiveX is that same piece of code can be used in more than one place.

For Example, a spell checker functionality is required in MS Word as well as in e-mail application like Microsoft Outlook. So instead of writing same code twice, write a spell checking functionality in one place (i.e Windows Operating System) and call spell checker object wherever it is required.
ActiveX technology started as Object Linking and Embedding (OLE). In earlier version of windows, OLE used for cross application functions like Cut , Copy, Paste. Now a day, OLE has been transformed into Compound Object Module (COM). Spell checker is an example of COMs. It is an independent program in windows which can be used by any windows applications. ActiveX control is another COM which is used in larger applications. 

For example, if you want to play flash files(.swf) in Internet Explorer, you need Adobe Flash player installed on your system first, as IE cannot play flash files directly. But if the whole website is built in flash and you don’t want to install Adobe Flash Player, then IE gives you an option to download and install Flash ActiveX at your OS level. After that IE can play the files in the browser itself.

As it is a piece of code, there is a risk of misuse also. Using ActiveX, applications/websites can access your personal information, also it could throw unwanted pop-ups. So before installing any ActiveX, make sure it is trust worthy.
How to install ActiveX ? 
When any application needs ActiveX control, IE displays a dialog box asking your permission to install, provided Pop-Up blocker option in IE level is not set to ‘Yes’. Right click on the dialog box and click on ‘Install ActiveX Control’ option to install it.

How to uninstall ActiveX ?
Open Internet Explorer and then goto Tools > Manage Add-ons option. You can see the list of all add-ons, installed in your system. Select the ActiveX control you want to delete and then either click on Delete option or Disable.