|
|
sybperl-l Archive
Up Prev Next
From: Tunc Beyhan <tbeyhan at bline dot net dot tr>
Subject: Re: Insert Record
Date: Jan 28 1998 7:28AM
The insert statement should be
$dbh->dbcmd("insert myTable
values (23561, 2020, 0, 'Some text', 0, NULL, 1, 26643, 1102, 'Why
me?',
'Feb 4 1998 3:55PM', 'MDB', 'Hello', 0)");
You should use single qoutes for dates and strings and nothing for NULL
Hope this helps,
Tunc
Rob Truban wrote:
>
> Greeting All,
>
> Could someone please post an example of how to do an insert command. I
> tried something like this
> with no luck.
>
> #!/apps/perl/perl5/perl
>
> use Sybase::DBlib;
>
> use Getopt::Long;
>
> $dbh = new Sybase::DBlib $User, $Password, $server;
>
> $dbh->dbcmd("insert myTable
> values (23561, 2020, 0, "Some text", 0, "NULL", 1, 26643, 1102, "Why
> me?",
> "Feb 4 1998 3:55PM", "MDB", "Hello", 0)");
>
> $dbh->dbsqlexec;
>
> $dbh->dbresults;
>
> I know this is beginner's stuff, I apologize... I just want to insert a
> record on the fly, nothing fancy.
>
> Thanks In Advance
>
> Rob Truban
|