Главная страница


ru.perl

 
 - RU.PERL ----------------------------------------------------------------------
 From : Alex Lazarev                         2:5052/7.39    17 May 2000  08:03:01
 To : Ilya Lobahin
 Subject : Re: DBI
 -------------------------------------------------------------------------------- 
 
 
 Wednesday May 17 2028 01:09, you wrote to Anton Petrusevich:
  IL>                       Пpивет Anton!
  IL>  Засыпаю я утром ( 16 мая 2000 ),и вижу Anton Petrusevich писал к Ilya
  IL> Lobahin:
 
  IL> В psql - все катит:
  IL> update users set username = 'Ivanov' where usernumber = 2;
  IL> в perl же, не хочет:
  IL> update users set username = $username where usernumber = $usernumber;
  IL> ругается на нее.
 
 Извини, но я совсем запутался.
 Что получается в результата из твоей строки update?
 ну скажи ты my $sql = "update ...... "; print $sql;
 или my $sql = 'update ..... '; print $sql; (какие у тебя там кавычки стоят?)
 и самому понятней станет. и вопросов не надо будет задавать :)
 Первое, что приходит на ум - у тебя строка запроса получается (и передается
 драйверу)
 update users set username = Ivanov where usernumber = 2
 или
 update users set username = $username where usernumber = $usernumber
 и то, и другое - бред и не похоже на то, что ты вводишь в psql
 
  IL> Если все на поверхности - ткните плиз в модуль, а еще желательно в
  IL> точное место в нем. Если это не поддержиается - вопрос, как это
  IL> обойти, т.е. как внести изменения в конкретную строчку?
 
 ну попробуй так:
 $sth = $dbh->prepare('update users set username=? where usernumber=?');
 
 $sth->bind_param(1, $username, {TYPE=>SQL_VARCHAR});
 $sth->bind_param(2, $usernumber, {TYPE=>SQL_INTEGER});
 $sth->execute;
 
 (уточни насчет типов - почитай доку на postgress, я с ним практически не
 знаком)
 
 Alex
 
 --- GoldED/W32 3.0.1
  * Origin: Дурак справедлив, но суров (2:5052/7.39)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 DBI   Ilya Lobahin   13 May 2000 19:55:04 
 DBI   Oleg Bakiev   13 May 2000 23:01:11 
 DBI   Ilya Lobahin   14 May 2000 10:55:39 
 DBI   Oleg Bakiev   14 May 2000 14:47:04 
 DBI   Ilya Lobahin   15 May 2000 19:27:29 
 Re: DBI   Anton Petrusevich   16 May 2000 13:20:37 
 DBI   Ilya Lobahin   17 May 2000 02:09:13 
 Re: DBI   Anton Petrusevich   17 May 2000 07:51:41 
 DBI   Sergey Kazinin   17 May 2000 11:31:31 
 Re: DBI   Alex Lazarev   17 May 2000 08:03:01 
 Re: DBI   Anton Petrusevich   18 May 2000 13:08:52 
 DBI   Oleg Bakiev   18 May 2000 18:14:34 
 Re: DBI   Anton Petrusevich   19 May 2000 11:26:05 
 DBI   Oleg Bakiev   19 May 2000 15:14:01 
 Re: DBI   Alex Lazarev   18 May 2000 16:00:01 
 DBI   Bastrakov Oleg   14 May 2000 07:27:35 
 Re: DBI   Andrey Babkin   13 May 2000 17:21:26 
 Re: DBI   Alex Lazarev   16 May 2000 07:56:03 
 DBI   Alexander Temerev   15 May 2000 23:31:14 
 DBI   Ilya Lobahin   18 May 2000 01:32:24 
 Re: DBI   Anton Petrusevich   18 May 2000 13:06:49 
 DBI   Alexander Temerev   18 May 2000 22:31:32 
 Re: DBI   Pavel Kurnosoff   18 May 2000 15:45:36 
 Re: DBI   Alex Lazarev   18 May 2000 12:09:46 
 Re: DBI   Vlad Shikhalev   15 May 2000 21:35:17 
Архивное /ru.perl/283439226096.html, оценка 1 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional