Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Dynamic query generation

by chanakya (Friar)
on May 05, 2005 at 12:19 UTC ( [id://454329]=note: print w/replies, xml ) Need Help??


in reply to Re: Dynamic query generation
in thread Dynamic query generation

Joost
Thanks for pointing out the error,
Here's the updated code
%ORA_MAPPING = ( 'Data_id' => 'Ticket_Data_seq.nextval', 'Action' => "Problem Submit", 'Cust_Ticket_Number' => "", 'Our_Ticket_Number' => "$data->{'TicketNumber'}", 'msg_id' => "", 'time_stamp' => "", 'Description' => "", 'EL_Edesc' => "", 'prov_id' => "EECO::UTN::BPL", 'provclientid' => "BPC::123", 'prov_client_org' => "", 'prov_client_buz' => "", 'prov_schema_type' => "" ); my $query = "INSERT INTO Ticket_Data ("; if ($action eq 'Problem Submit') for $key ( keys %ORA_MAPPING ) { $value = $ORA_MAPPING{$key}; next if $key eq "Data_id"; $query .=" $key, "; } $query .= " ) VALUES ($ORA_MAPPING{$_} )"; } elsif ($action eq 'Update') { ... }
Is it possible to build the query using the above code or is there any other better approach.
I'd like to know that approach as well.
Many thanks for your time

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://454329]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-24 22:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found