Refer to return valid CPF

Scripts Diversos para o Oracle SQL*Plus. (Relacionado a ferramenta Oracle SQL*Plus, para questões de SQL, usar o forum SQL)
Post Reply
edson.amorim
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 135
Joined: Thu, 04 Oct 2007 3:36 pm
Location: Belo Horizonte - MG

Dear colleague,

I have in my bank, in the CPF field, several CPFs that have not actually been verified during the registration of them.
I need to make an appointment to check which records are with the correct CPFs.
I created a function called v_cpf to do the digit scan but need to make a query via PLSQL on the bench to show which ones are correct.
How to do this?

grateful,
edson.amorim
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 135
Joined: Thu, 04 Oct 2007 3:36 pm
Location: Belo Horizonte - MG

Dear Moderator,

I'm sorry, I sent this post to the wrong place, that is for the "SQLPlus",
please, redirect to the correct place I wanted to: Plsql.

I apologize again,

grateful,

Edson
diegolenhardt
Moderador
Moderador
Posts: 1177
Joined: Thu, 15 Oct 2009 10:28 am
Location: Recife

Select all

 
select * 
from suatabela 
where suafuncao(cpf) = 'I' --assumo que I seria os invalidos, o retorno da funcao I,  
edson.amorim
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 135
Joined: Thu, 04 Oct 2007 3:36 pm
Location: Belo Horizonte - MG

Dear Diego,

Great .. AGORTA Another question: My function receives besides the CPF number, the type of person ie; "PF" physical person and "pj" for legal person. NetSE Case, how do I include the type of person here in the query?

Thanks !!
diegolenhardt
Moderador
Moderador
Posts: 1177
Joined: Thu, 15 Oct 2009 10:28 am
Location: Recife

Select all

 
select * 
from suatabela 
where suafuncao(cpf,tipopessoa) = 'I' --assumo que I seria os invalidos, o retorno da funcao I,  
then you have to see how you defined the order of the parameters in the function, if first is the type of the person, or if the CPF,

99]] no secret, falow
edson.amorim
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 135
Joined: Thu, 04 Oct 2007 3:36 pm
Location: Belo Horizonte - MG

Dear Diego,

I did and it was cool in my testing environment. In production, the Boolean returns function and is not working cool. How to get around Issocoma function returning Boolean ??
diegolenhardt
Moderador
Moderador
Posts: 1177
Joined: Thu, 15 Oct 2009 10:28 am
Location: Recife

Face, even has a function that you can give a to_number something like this in the boolean and return so that can be treated ..

I do not remember the name, a solution would be to do in plsql you do Loop in the table and forehead inside the line the line returning to a variable the exit of the function,

+ - thus


99]] Via Select I can not remember how the Boolean conversation was .. = (

Maybe someone can help you more ..
edson.amorim
Rank: Analista Sênior
Rank: Analista Sênior
Posts: 135
Joined: Thu, 04 Oct 2007 3:36 pm
Location: Belo Horizonte - MG

Dear Diego,

Certainly !! is that so. As I'm interacting better about this part of use of functions, I'm enjoying and exploring here the great goodwill your mainly. I'm sorry for asking one more !! But that's not so necessary: ??it's '' Popular I show a good amount of records on the output tab ?? or yet; Can I show the result of an accountant ??

Thanks a lot for help !! Thanks,
Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 11 guests