Hi,
Please let me know if there is any particular length of
query perl
supports.
E.g. I have to execute following 8 queries to do my task or
to execute main
single query.
insert_string = ();
$insert_string[1] = "insert into
SID_FIELD_PERIODS (SURVEYID,
FIELD_PERIOD, OUTPUT_CODE, TLA, SURVEY_YEAR_CODE,
CALENDAR_YEAR_CODE)
values ($surveyid, $field_period, $output_code,
'$survey_tla',
'$survey_year_code', '$calendar_year_code')";
$insert_string[2] = "update
SID_FIELD_PERIODS set
STAGE_CODE='$stage_code', SURV_SAMP=$surv_samp,
USED=$used,
QUOTAS=$quotas, ADDS=$adds, FIELD_STAR='$start_date',
FIELD_FIN='$end_date' where
FIELD_PERIOD=$field_period";
$insert_string[3] = "update
SID_FIELD_PERIODS set
ADVANCE_LETTERS=$advance_letters, POST=$post,
RELEASE_DATE=$release_date,
READY_TO_GO=$ready_to_go, BLAISE_NAME=$blaise_name where
FIELD_PERIOD=$field_period";
$insert_string[4] = "update
SID_FIELD_PERIODS set
BLAISE_VERSION=$blaise_version, COMPLETED=$completed,
SAMPLING_FRAME=$sampling_frame, SF_DATE=$sf_date,
SAMPLE=$sample where
FIELD_PERIOD=$field_period";
$insert_string[5] = "update
SID_FIELD_PERIODS set
SAMPLE_DATE=$sample_date, ADDRESS_LIST=$address_list,
ADDRESS_LIST_DATE=$address_list_date, SAT_READY=$sat_ready
where
FIELD_PERIOD=$field_period";
$insert_string[6] = "update
SID_FIELD_PERIODS set
SAT_DATE=$sat_date, RESPONSE=$response,
SADJ_SAMP=$sadj_samp,
SEFF_SAMP=$seff_samp, SCO_OP=$sco_op, SRESPONSE=$sresponse
where
FIELD_PERIOD=$field_period";
$insert_string[7] = "update
SID_FIELD_PERIODS set
FADJ_SAMP=$fadj_samp, FEFF_SAMP=$feff_samp, FCO_OP=$fco_op,
FRESPONSE=$fresponse, FIELD_END=$field_end,
STAGE_NAME=$stage_name where
FIELD_PERIOD=$field_period";
$insert_string[8] = "update
SID_FIELD_PERIODS set
REISSUES=$reissues, REISSUE_FF=$reissue_ff,
REISSUE_STAR=$reissue_star,
REISSUE_FIN=$reissue_fin,
ORIGSTATEATTEMPT=$origstateattempt,
RESISSTAGEATTEMPT=$resisstageattempt, ACTIVEFP=$activefp
where
FIELD_PERIOD=$field_period";
Then I execute query using a loop.
for ($x = 1; $x <= $num_inserts; $x++)
{
print "insert_string_$x =
$insert_string[$x] n" if $debug;
$db->sql($insert_string[$x]);
$db->sql("commit");
}
Is there any way I can do it at one go instead of making so
many small
small queries.
Regards,
Hemant
Thanks & Regards,
Hemant Verma
Xansa, A Steria Company
Office for National Statistics, Southampton.
Mob: 07715759776, Direct CUG: 8889776
Ext: 0132-981-3575
For the latest data on the economy and society consult
National Statistics at http://www.statistics.go
v.uk
************************************************************
*********************
Please Note: Incoming and outgoing email messages are
routinely monitored for compliance with our policy on the
use of electronic communications
************************************************************
*********************
Legal Disclaimer : Any views expressed by the sender of
this message are not necessarily those of the Office for
National Statistics
************************************************************
*********************
The original of this email was scanned for viruses by the
Government Secure Intranet virus scanning service supplied
by Cable&Wireless in partnership with MessageLabs. (CCTM
Certificate Number 2007/11/0032.) On leaving the GSi this
email was certified virus free.
Communications via the GSi may be automatically logged,
monitored and/or recorded for legal purposes.
|