|
|
sybperl-l Archive
Up Prev Next
From: Brazier Stephen F Civ 27 IS/SCOS <stephen dot brazier at langley dot af dot mil>
Subject: RE: update question
Date: Aug 17 1999 9:37PM
Daz,
Just a thought - in your code:
> foreach $thisrow (@rows) {
> my $test2 = ${$thisrow}[0];
> print qq[$test2 ];
> my $test3=("$test2" . "$test");
> $cmd = qq[UPDATE calls SET resolution = "$test3" where CALLNUMBER
Where you concatenate "$test2" with "$test"
make sure the spaces in the sql are imbedded correctly -
this has bit me in my code too... :>
Michael is right in his latest message: Print out your SQL stmnt prior to
sending it so you can tear it apart and test it in ISQL
Good Luck,
Steve
-----Original Message-----
From: Daz [mailto:dazol@patriot.net]
Sent: Tuesday, August 17, 1999 4:33 PM
To: SybPerl Discussion List
Subject: Re: update question
If this is not the correct list to post this to, my apologies. Which
list would be better? Im not asking for a fix(example code), just a
'why' this is happening. Even a flame would be appreciated at this
point (Im going crazy not being able to figure this out)
David
Daz wrote:
>
> New to the list so please bear with me :)
> Also new to perl, so more 'bearing' please ;)
>
> I am trying to write a CGI script that will call a certain row from
> MSSQL 6.5, save the results into one variable, take the cgi input as the
> second variable concatonate the two, then update the previously called
> row with the new information (making sure to keep the original
> information). the newest problem (Ive solved most, I think) is this
> error:
>
> Server message:
> Message number: 105, Severity 15, State 1, Line 1
> Server 'SERVERNAME'
> Message String: Unclosed quote before the character string 'how'.
>
> Server Message:
> Message number: 170, Severity 15, State 1, Line 1
> Server 'SERVERNAME'
> Message String: Line 1: Incorrect syntax near 'how'.
>
> The only text this particular column has is the word 'how'.
> Here is the code I am using(I know its goulish, but Ive only been using
> perl for a month or so)
>
> #!/usr/bin/sybperl
> BEGIN {
> $ENV{SYBASE} = '/home/opt/sybase';
> }
> use CGI;
> use Sybase::CTlib;
> use CGI qw (:standard);
> my $query= new CGI;
> print $query->header;
> print $query->start_html(-title =>"Update a Ticket",
> -bgcolor => '#FFFFFF');
> print qq[Upate a ticket];
> print $query->startform;
> print qq[Put in some garbage ];
> print $query->textfield( -name => 'test' );
> print $query->submit;
> print $query->endform;
>
> #attempt the sql part
> $dbh = new Sybase::CTlib ('username', 'password', 'DATABASE');
> if ($query->param('test')) {
> $dbh->ct_sql("use DATABASE");
> $test = $query->param('test');
>
> my $cmd1 = qq[SELECT resolution FROM calls WHERE callnumber = 30000];
> my @rows = $dbh->ct_sql($cmd1);
> my $thisrow;
> foreach $thisrow (@rows) {
> my $test2 = ${$thisrow}[0];
> print qq[$test2 ];
> my $test3=("$test2" . "$test");
> $cmd = qq[UPDATE calls SET resolution = "$test3" where CALLNUMBER =
> 30000];
> $dbh->ct_sql("use DATABASE");
> $dbh->ct_sql($cmd);
>
> print qq[$test3 ];
> }
> }
> print $query->end_html;
>
> Any suggestions would be most appreciated.
> David
begin 600 winmail.dat
M>)\^(A,5`0:0"``$```````!``$``0>0!@`(````Y`0```````#H``$(@`<`
M&````$E032Y-:6-R;W-O9G0@36%I;"Y.;W1E`#$(`06``P`.````SP<(`!$`
M$0`E`!0``@`[`0$@@`,`#@```,\'"``1`!$`)0`/``(`-@$!"8`!`"$````S
M,D0Y-#(V-T4X-31$,S$Q038P,S`P,C`T.#`T14(T-0#0!@$$@`$`%````%)%
M.B!U<&1A=&4@<75E`""`&``````#`````````1@`````1A0````````,`"8`(
M(`8``````,````````!&`````!B%````````'@`*@`@@!@``````P```````
M`$8`````-H4```$````!`````````!X`"X`((`8``````,````````!&````
M`#>%```!`````0`````````>``R`""`&``````#`````````1@`````XA0``
M`0````$`````````"P`-@`L@!@``````P````````$8``````(@````````+
M``Z`"R`&``````#`````````1@`````%B`````````(!"1`!````.0@``#4(
M``!>#P``3%I&=>8UR/L#``H`(R`T-T97@%00$#`??_"H`"I`/D
M!Q,"@`_S`%`$5C\(50>R$24.40,!`@!C:.$*P'-E=#(&``;#$27V,P1&$[V.Q@?#C`U$2(,8&,`4+,+"0%D,S864`NG8P$PP"!$87HL(`KC
M"H`(2G5S!4!A('1H20A@9V@%0"T@"X`@VGD(82`%H`$`.AV4'90^/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`0``
M`"`````\,S=".4,W,3@N-#DV1D9%.$%`<&%T`#%``0````H```!"4D%:24524T8````#
M`!I``````!X`,$`!````"@```$)205I)15)31@````,`&4```````P#]/^0$
M```#`"8```````,`-@```````P"`$/____\"`4<``0```"X```!C/553.V$]
M1$U3.VP]3$9)+4U3+3`R-2TP+3DY,#@Q-S(Q,S`/@_`0```"$```!"`#A``0````H```!"4D%:24524T8````"`?L_`0```%(`````````
MW*=`R,!"$!JTN0@`*R_A@@$`````````+T\]3U)'04Y)6D%424].+T]5/4Q!
M3D=,15DO0TX]4D5#25!)14Y44R]#3CU"4D%:24524T8````>`/H_`0```"$`
M``!"`#E``0``
M``H```!"4D%:24524T8```!````#T`
M`0````4```!213H@`````!X`'0X!````$````'5P9&%T92!Q=65S=&EO;@`>
M`#40`0```$8````\-#DQ-30R0S1#,C5&1#(Q,4$U0T$P,#(P-#@P-$5"-#4P
M03,T,D5`;&9I+6US+3`R-2TP,2YL86YG;&5Y+F%F+FUI;#X````+`"D`````
M``L`(P```````P`&$(-PM04#``<0#0D```,`$!```````P`1$``````>``@0
M`0```&4```!$05HL2E535$%42$]51TA4+4E.64]54D-/1$4Z1D]214%#2"14
M2$E34D]7*$!23U=3*4U9)%1%4U0R/20D5$A)4U)/5S`[4%))3E1143Q0)%1%
M4U0R/"]0.TU9)%1%4U0S/2@B``````(!?P`!````1@```#PT.3$U-#)#-$,R
M-49$,C$Q035#03`P,C`T.#`T14(T-3!!,S0R14!L9FDM;7,M,#(U+3`Q+FQA
2;F=L97DN868N;6EL/@```,(!
`
end
|