Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Please look at this code!

2 posts in General Discussion (old) Last posting was on 2000-02-25 17:34:50.0Z
S.Brooks Posted on 2000-02-25 14:18:13.0Z
Newsgroups: sybase.public.easerver
Date: Fri, 25 Feb 2000 09:18:13 -0500
From: "S.Brooks" <sbrooks@fnac-usa.com>
Reply-To: sbrooks@fnac-usa.com
Organization: FN
X-Mailer: Mozilla 4.5 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Please look at this code!
Content-Type: multipart/alternative; boundary="------------82936AC451A451CAAB5CD2EE"
Lines: 90
NNTP-Posting-Host: 38.196.35.35
Message-ID: <347_38B68F25.DAF042CC@fnac-usa.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:27812
Article PK: 159160

HI,
Could someone take a look at this code and tell me what is wrong.
I am updating a text field in PD.  I have a call to addText sending 4 parameters

addText ("perdb..project_notes","testing_guidlines",sqlEscape(guide),sqlEscape(project_id)) 

Here is the function:

function addText(table,column,textData,pk)
{
    sql= "declare @ptr varbinary(16)";
    sql += "select @ptr = textptr(" + column + ")";
    sql += " from "+ table+ " ";
    sql += "where project_id = convert(int,"+pk+")";
    sql += " writetext " + table + "."+column + " @ptr with log \""+ textData + "\" ";
    myQuery8 = connection.CreateQuery(sql);
    document.writeln(myQuery8.GetErrorInfo())
 
}

Now everything works fine on the addText call, but if I have

addText ("perdb..project_notes","testing_guidlines",sqlEscape(guide),sqlEscape(project_id))
addText("perdb..project_notes","developer_notes",sqlEscape(notes),sqlEscape(project_id))                   

I will get an error on the second addText.

The error is:

ct_command(): user api layer: external error: This routine cannot be called when a command has been initialized
but not sent.

I have reversed the order of the calls to see if there was an inhereant problem with that particular field.  There is not.  Do I need to call a separate function for the second call that esentially does the same thing?

Thanks
samantha
 


S.Brooks Posted on 2000-02-25 17:34:50.0Z
Newsgroups: sybase.public.easerver
Date: Fri, 25 Feb 2000 12:34:50 -0500
From: "S.Brooks" <sbrooks@fnac-usa.com>
Reply-To: sbrooks@fnac-usa.com
Organization: FN
X-Mailer: Mozilla 4.5 [en] (WinNT; I)
X-Accept-Language: en
MIME-Version: 1.0
Subject: Re: Please look at this code!
Content-Type: multipart/alternative; boundary="------------D7DFF1AA55C84A2B07FFF8C2"
Lines: 96
NNTP-Posting-Host: 38.196.35.35
Message-ID: <347_38B6BD3A.A31130F7@fnac-usa.com>
References: <347_38B68F25.DAF042CC@fnac-usa.com>
Path: forums-1-dub!forums-1-dub!forums-master.sybase.com!forums.sybase.com
Xref: forums-1-dub sybase.public.easerver:27797
Article PK: 154586

Hi,
Got it.. for whatever reason i had to close the query this time.
Thanks
samantha
 

"S.Brooks" wrote:

HI,
Could someone take a look at this code and tell me what is wrong.
I am updating a text field in PD.  I have a call to addText sending 4 parameters

addText ("perdb..project_notes","testing_guidlines",sqlEscape(guide),sqlEscape(project_id))

Here is the function:

function addText(table,column,textData,pk)
{
    sql= "declare @ptr varbinary(16)";
    sql += "select @ptr = textptr(" + column + ")";
    sql += " from "+ table+ " ";
    sql += "where project_id = convert(int,"+pk+")";
    sql += " writetext " + table + "."+column + " @ptr with log \""+ textData + "\" ";
    myQuery8 = connection.CreateQuery(sql);
    document.writeln(myQuery8.GetErrorInfo())

}

Now everything works fine on the addText call, but if I have

addText ("perdb..project_notes","testing_guidlines",sqlEscape(guide),sqlEscape(project_id))
addText("perdb..project_notes","developer_notes",sqlEscape(notes),sqlEscape(project_id))

I will get an error on the second addText.

The error is:

ct_command(): user api layer: external error: This routine cannot be called when a command has been initialized
but not sent.

I have reversed the order of the calls to see if there was an inhereant problem with that particular field.  There is not.  Do I need to call a separate function for the second call that esentially does the same thing?

Thanks
samantha