[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sapdb-general
Subject:    Re: General error; Invalid char position in string function
From:       Alexey Gaidukov <gaid () dc ! baikal ! ru>
Date:       2005-06-30 0:30:33
Message-ID: 42C33D29.90602 () dc ! baikal ! ru
[Download RAW message or body]

Following this logick the code should be compiled

CREATE DBPROC test(
    IN p varchar) AS
BEGIN
    select '44' from dual where :p='112';
END;

But it's copiled without error.

In Oracle 8.1.6 my example with varchar and substr compiles and works 
without problems.


Schroeder, Alexander пишет:

>You should explizitely specify the length, i.e.
>
>CREATE DBPROC test(IN p VARCHAR(10)) AS
>BEGIN
>    INSERT INTO table(field)
>    VALUES (substr(:p,3,1));
>END;
>
>otherwise 1 is assumed as length, which renders your substr function call invalid.
>
>See http://dev.mysql.com/doc/maxdb/en/03/5087f083c411d4bb3a00508b5d5211/content.htm
>
>Regards
>Alexander Schröder
>SAP DB, SAP Labs Berlin
>
>
>  
>
>>-----Original Message-----
>>From: Alexey Gaidukov [mailto:gaid@dc.baikal.ru] 
>>Sent: Wednesday, June 29, 2005 11:56 AM
>>To: maxdb@lists.mysql.com
>>Subject: General error; Invalid char position in string function
>>
>>
>>
>>Auto Commit: On, SQL Mode: Internal, Isolation Level: Committed
>> General error;-3046 POS(319) Invalid char position in string function
>>
>>
>>
>>CREATE DBPROC test(IN p varchar) AS
>>VAR
>>    pp varchar(10);
>>BEGIN
>>    SET pp = p;
>>    INSERT INTO table(field)
>>    VALUES (substr(:pp,3,1));
>>END;
>>
>>
>>Compiles well. Is check of length of VARCHAR in compile time in this 
>>situation correct?
>>
>>-- 
>>MaxDB Discussion Mailing List
>>For list archives: http://lists.mysql.com/maxdb
>>To unsubscribe:    
>>http://lists.mysql.com/maxdb?unsub=alexander.schroeder@sap.com
>>
>>
>>    
>>
>
>  
>


-- 
MaxDB Discussion Mailing List
For list archives: http://lists.mysql.com/maxdb
To unsubscribe:    http://lists.mysql.com/maxdb?unsub=sapdb-general@progressive-comp.com

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic