PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: Re: Stored Procedure
Date: Apr 7 2000 2:04PM

AGaneshalingam@globewireless.com writes:
 > Hello to all,
 > 
 > 1)
 > I am using Sybase 11. I'm trying to write a stored procedure (SP) which have
 > 2 parameters that are text  type. However, when I tried to compile this SP,
 > I get the following  error:
 > 
 > Server Message:  Number  2739, Severity  16
 > Server 'DBServer', Procedure 'storedProcedure', Line 1:
 > TEXT and IMAGE datatypes are invalid for parameters or local variables. 
 > 
 > How can I use the Sybperl to insert text by using a stored procedure ?

You can't. And you can't use a stored proc to insert text/image stuff
using any other tool either. Use ct_send_data() and friends instead.

 > 
 > 2) When I have about 10 parameters that I want to pass to the stored
 > procedure, what is the easiest way to code this in Sybperl. I usually do the
 > following when I pass the parameters:
 > 
 > // sending one parameter to the Stored Procedure
 > $sql_stmt = qq!cust.dbo.storedProcedure!;
 > 	%param = (name => '@acct', datatype => CS_CHAR_TYPE, status =>
 > CS_INPUTVALUE, value => 'AAK001', indicator => CS_UNUSED);
 > 	$dbh->ct_command( CS_RPC_CMD, $sql_stmt, CS_NULLTERM, CS_UNUSED);
 > 	$dbh->ct_param(\%param);
 > 	$dbh->ct_send();

I tend to use straight SQL instead of the ct_param() calls, because
it's a little simpler.

Michael
-- 
Michael Peppler         -||-  Data Migrations Inc.
mpeppler@peppler.org    -||-  http://www.mbay.net/~mpeppler
Int. Sybase User Group  -||-  http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com