Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8052511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:33:45+00:00 2026-06-05T07:33:45+00:00

I had return a program it will check which file is present or not

  • 0

I had return a program it will check which file is present or not and it will check no of column

create or replace procedure chkcsvfile
(P_UTLDIR VARCHAR2,
P_FILENAME  VARCHAR2,
P_tabnam   VARCHAR2
)
is
  P_fieldel varchar2(2):= ',';
    V1 VARCHAR2(32767) ;
   P_errlen number :=0;
   lv_a number;
   lv_b number;
   lv_c number;
   lv_d number;
   lv_check_file_exist boolean; 
   v_file utl_file.file_type;  

 cursor c1  is
  select count(*) from user_tables where TABLE_NAME =P_tabnam;

  cursor c2  is
  select count(*) from user_tab_columns where TABLE_NAME =P_tabnam;

begin

open c1;
fetch c1 into lv_c;
if lv_c = 0 then
dbms_output.put_line('table name is invalid : ' || P_tabnam);
end if;

--'test wheather file is  available or not'
dbms_output.put_line ('test wheather file is  available or not');
utl_file.fgetattr (P_UTLDIR,P_FILENAME, lv_check_file_exist, lv_a, lv_b );
if lv_check_file_exist then

dbms_output.put_line('file  ' ||P_FILENAME  ||'  exists');

v_file := utl_file.fopen(P_UTLDIR,P_FILENAME, 'R');

UTL_FILE.get_line (v_file ,V1,32767);

DBMS_OUTPUT.put_line ('V1 :' || V1);

if (REGEXP_like (V1, ',',1))
then
P_errlen  := P_errlen +1 ;
dbms_output.put_line ('errrooooooooooooooooooooooooooooooooooorr'); 
dbms_output.put_line (P_errlen );

end if;

end if;
if not lv_check_file_exist then
dbms_output.put_line('file ' ||  P_FILENAME  ||'  does not exist');
end if;
if lv_check_file_exist is null then
dbms_output.put_line('file check null');
end if;
if lv_check_file_exist is not null then
dbms_output.put_line('file check not null');
end if;
dbms_output.put_line('lv_a-->'||lv_a);
dbms_output.put_line('lv_b-->'||lv_b);

open c2;
fetch c2 into lv_d;
dbms_output.put_line ('No of columns in a table : ' || lv_d );

end;
/

NOW my problem is i have to match ” , ” in a string and i want the count of it . i had written the program but it not give me specific count .

data in string is given in below format

7839,KING      ,PRESIDENT,0000,17-nov-1981, 005000.00 ,000000.00,10,

please help me
thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T07:33:47+00:00Added an answer on June 5, 2026 at 7:33 am

    Since you’re using 11g, you can use the regexp_count function.

    select regexp_count('7839,KING      ,PRESIDENT,0000,17-nov-1981, 005000.00 ,000000.00,10,',',')
    from dual
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a program that will open a text file with
I had an issue with my search not return the results I expect. I
I have written a program which will serialize and de-serialize, it does this fine
I'm trying to create a program that will display bar graphs with * the
I had this code: int foo(void){ return 1; } int main(void){ static const int
I had two separate interfaces, one 'MultiLingual' for choosing language of text to return,
I had a version 1 of a function like: def f(a,b,c): #Some processing return
When working with unpack, I had hoped that b3 would return a bitstring, 3
While developing an application, I had the following problem. I wanted to return an
My C program had a lot of strstr function calls. The standard library strstr

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.