Welcome to Dream.In.Code
Become a C++ Expert!

Join 150,018 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 1,464 people online right now. Registration is fast and FREE... Join Now!




sql change in c code

 
Reply to this topicStart new topic

sql change in c code

andriss
29 Nov, 2006 - 05:00 AM
Post #1

New D.I.C Head
*

Joined: 29 Nov, 2006
Posts: 1


My Contributions
Hi I need help!
I have some sql which do selecy from DB. But i have to change one string in select if only will be ne key from config file.

I have to change string “and (tlog.msgcls = '2') or (tlog.msgcls = '4' and tlog.msgclsorg = '2'))”
to the "and (tlog.msgcls = '1' or (tlog.msgcls = '4' and tlog.msgclsorg = '1')) ", bu if only key ONLYAUTH exists.

Do you know how can i do this? And how sql and c code will look?

CODE

#ifdef ORACLE_SQL    

        if ( onlyauth )
            sprintf( select_buf,
            "insert into txnexp_batch "    
            "select tlog.id "
            ", tlog.msgcls, tlog.fncode, tlog.pan"
            ", tlog.crdseqno, tlog.aiid, tlog.rrn, tlog.amttxn "
            "%s"
            "tlog.sysdate1 = '%s' "    /* NMR010298 WLi 5/11/2003 */
            "%s %s %s %s %s %s %s "
            "and    tlog.msgfn    between '0' and '3' "
            "and    tlog.txnstatus    in (7, 8, 11, 12) "
            "and    ((tlog.txncode in (0,1,2,10,11,20,22,26 %s) "
            "    and ((tlog.msgcls = '2') "
            "    or (tlog.msgcls = '4' and "
            "       tlog.msgclsorg = '2'))) "
                                   " or tlog.msgcls not in ('1', '2', '4')) "
            "and    (tlog.fncode <> 690 or tlog.actioncode <> '0'"
            "    or tlog.rspcode not in ('05', '06')) ",
            btchtyp_buf,
            db_sysdate,
            btch_buf,
            onus_buf,
            tc_buf,
            mcc_buf,
            fc_buf,        
            txnstatus_buf,
            xife_buf,     
            inclcashin ? ",28" : "" );
        }
#endif /* ORACLE_SQL */
    }


This post has been edited by Dark_Nexus: 29 Nov, 2006 - 02:13 PM
User is offlineProfile CardPM
+Quote Post

Trogdor
RE: Sql Change In C Code
1 Dec, 2006 - 05:43 AM
Post #2

D.I.C Addict
Group Icon

Joined: 6 Oct, 2006
Posts: 549



Thanked: 4 times
Dream Kudos: 125
My Contributions
I do not understand what you mean, nor is the code you provided sufficient to find out anything.
User is offlineProfile CardPM
+Quote Post

Reply to this topicStart new topic
Time is now: 1/8/09 09:11PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month