PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Newbie sql question
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Newbie sql question

Réponse
 
LinkBack Outils de la discussion
Vieux 13/10/2007, 15h14   #1
len
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Newbie sql question

I have an ARDTLDB file (AR detail table) which contain primary key
Ar_Sid, then policyno, trxtype, amount, and applytono. The trxtype's
are 'Inv', 'Cr', 'Dr', 'Pmt'. The problem I have is that a change was
made to the program which applies payments (Pmt) and the program
overwrote the 'Inv' record with the payment data. Now I need to write
a program to recreate the 'Inv' records. I am new to SQL and so is
the rest of the company hence stupid mistake no one. I figure I could
I have a couple of options; We have a policy table (Primary Key
Policy_Sid, Policyno and Premium amount). I could write an SQL
statement that reads through the Policy file and comparies it to the
ARDTLDB and if it does not find a record create it from the data in
the policy. I could also read through the ARDTLDB for 'Pmt' records
and then some how read back into the ARDTLDB for 'Inv' record and if
not found recreate the record for the Policy file again. I have
picked up the book Introduction to SQL about a week ago and have
started to learn SQL but I'm not that far in the book yet I have
skimmed for the answer and I think I will need to use some type of
subquery and maybe a special type of join. If this were just a
problem in the book I wouldn't bother the group but this is a problem
at work and I have a time crunch. I don't need a detailed answer but
some guidenance.

Thanks
lsumnler

  Réponse avec citation
Vieux 13/10/2007, 21h22   #2
Kees Nuyt
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Newbie sql question

On Sat, 13 Oct 2007 06:14:39 -0700, len
<lsumnler@gmail.com> wrote:

>I have an ARDTLDB file (AR detail table) which contain primary key
>Ar_Sid, then policyno, trxtype, amount, and applytono. The trxtype's
>are 'Inv', 'Cr', 'Dr', 'Pmt'. The problem I have is that a change was
>made to the program which applies payments (Pmt) and the program
>overwrote the 'Inv' record with the payment data. Now I need to write
>a program to recreate the 'Inv' records. I am new to SQL and so is
>the rest of the company hence stupid mistake no one. I figure I could
>I have a couple of options; We have a policy table (Primary Key
>Policy_Sid, Policyno and Premium amount). I could write an SQL
>statement that reads through the Policy file and comparies it to the
>ARDTLDB and if it does not find a record create it from the data in
>the policy. I could also read through the ARDTLDB for 'Pmt' records
>and then some how read back into the ARDTLDB for 'Inv' record and if
>not found recreate the record for the Policy file again. I have
>picked up the book Introduction to SQL about a week ago and have
>started to learn SQL but I'm not that far in the book yet I have
>skimmed for the answer and I think I will need to use some type of
>subquery and maybe a special type of join. If this were just a
>problem in the book I wouldn't bother the group but this is a problem
>at work and I have a time crunch. I don't need a detailed answer but
>some guidenance.
>
>Thanks
>lsumnler


Restore your backup of that database (status: just before
the Pmt program was changed) on a different machine.
Next best thing to do would be to evaluate the MySQL logs
to find the original INSERTs of Inv rows.
If this data has any formal status, please get
professional to keep your auditor and the IRS happy.
--
( Kees
)
c[_] The bigger they are, the harder they hit you. (#165)
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h22.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10323 seconds with 10 queries