Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting ODBC error while executing the sql query in excel(DB)
#1
Not Solved
Hi All,

I am new to this forum and even in Automation field also.Actually my problem is: In my application i am doing export to excel and then considering the excel as db and running the sql statment like below:
select disctint(count empid) from <filename>
but getting error as ODBC

But when i am execting select * from <filename> where empid=10 then it is getting executed.
-2147418113 catastrophic failue error getting Sad
i am not sure what is issue.So could you please suggest any tips for this
Reply
#2
Not Solved
disctint should be DISTINCT in "select disctint(count empid) from <filename>"

Reply
#3
Not Solved
Its Typeo Error Smile I did the same things but still issue persist.Please let me know any solution for it.

Actually if i am doing select * from <filename>emp....its working fine.I am not why the above query is not working.
Reply
#4
Not Solved
Hi All

Can We use all SQL commands in CSV file(considering CSV as a database)?

And also if we exported our data in CSV and then considering it like database.I want to get the non-repeatable records from CSV.How can i do this.Please suggest me asap
Reply
#5
Not Solved
What exactly you are trying to achieve? as far as I can understand you want the count of all distinct empid in a sheet. Very sorry I did not notice earlier. the correct query would be
Select Count( Distinct <columnname>) from <Sheet>

but I doubt this will work in excel as Count(Distinct) does not work with Access, it only works with Oracle and SQL

For you question Can We use all SQL commands in CSV file(considering CSV as a database)?
I have not tried it yet, but seems not feasible. CSV file can be treated as flat file and I dont think we can query to that.

Reply
#6
Not Solved
Thanks a lot...But could you please suggest me the automation script to remove the duplicates from the CSV.As i need to do comparsion between count visible in application and CSV counts.It should match...Because of this i am removing the duplicate and then take the count.

Please let me know asap as it is very urgent for me.

Thanks in Advance
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  error when executing an UFT automation script alexalloza 0 1,561 10-30-2018, 06:17 PM
Last Post: alexalloza
  Executing via create "RES"xx folder? nishitd 0 1,294 03-07-2018, 01:09 AM
Last Post: nishitd
  QTP-Re-executing script after completion of all iterations JwalantBhatt0602 1 2,713 03-24-2016, 12:37 AM
Last Post: JwalantBhatt0602
  Exe invoked through UFT is unable to access IIS and SQL Server service bkdevise 0 2,194 08-25-2015, 05:49 PM
Last Post: bkdevise
  QTP is getting closed after executing first test in MTM(Batch) Shyama 0 2,166 10-07-2014, 07:26 PM
Last Post: Shyama

Forum Jump:


Users browsing this thread: 1 Guest(s)