Featured Post

Python Program: JSON to CSV Conversion

Image
JavaScript object notion is also called JSON file, it's data you can write to a CSV file. Here's a sample python logic for your ready reference.  You can write a simple python program by importing the JSON, and CSV packages. This is your first step. It is helpful to use all the JSON methods in your python logic. That means the required package is JSON. So far, so good. In the next step, I'll show you how to write a Python program. You'll also find each term explained. What is JSON File JSON is key value pair file. The popular use of JSON file is to transmit data between heterogeneous applications. Python supports JSON file. What is CSV File The CSV is comma separated file. It is popularly used to send and receive data. How to Write JSON file data to a CSV file Here the JSON data that has written to CSV file. It's simple method and you can use for CSV file conversion use. import csv, json json_string = '[{"value1": 1, "value2": 2,"value3

How I Resolved ORA Invalid Number Error

While executing SQL query in Oracle SQL developer, I got an error that 01722 - ORA Invalid number. Here, I have shared an example and resolution for this error.

Invalid Number Error


Initially, I did not understand why I got the error. Later, I did query analysis manually and identified the issue. Below, you will find the error and resolution for it.

SQL Query executed


Create table


create table my_hr (
name char(20), pay_id number, user_id char(6)
);

create table my_dept (
name char(20), user_id char(6)
);


Insert values

insert into my_hr values ('Srini', 567, '123456');
insert into my_dept values ('Srini',  '123456');

Select query

select * from my_hr a, my_dept b
where name = 'Srini'
and pay_id='123456'
and a.user_id = b.user_id;

Now, I got ORA-01722 invalid number error. I have then corrected the value for pay_id.


Fix for the error

Below is the modified SQL query.  The correction is - removed single quotes for pay_id.

select * from my_hr a, my_dept b
where name = 'Srini'
and pay_id=123456
and a.user_id = b.user_id;

SQL Query reference books


Keep reading

Comments

Popular posts from this blog

7 AWS Interview Questions asked in Infosys, TCS

How to Decode TLV Quickly

Hyperledger Fabric: 20 Real Interview Questions