locked
VB 2015 / Pervasive SQL (Actian Zen (PSQL)) RRS feed

  • Question

  • my code runs fine until it hits the following cmd

    update UNIDB.seq_main set wo_note='HUSKY V1 INSPECTION AS PER SECTION 8.2 OF HUSKY EDS-31-15:
    
    PERFORM 100% VISUAL INSPECTION:
    
    - CASTINGS AS PER MSS-SP55
    
    - FORGINGS AS PER ASTM 182 SECTION 12 (ASTM A961) ?
    
    -
    
    VALVES WITH WELD ON FLANGES OR ANY PRESSURE CONTAINING WELD:
    
    - 10% OF ANY BUTTWELDED JOINTS OR ANY ALLOY WELDS
    
    (P4, P5, P6, P7, P9) SHALL BE 100% RT EXAMINED AS
    
    PER ASME SECTION V 2
    
    - 10% OF ANY FILLET, SOCKET OR FILLET WELD SHALL BE 100%
    
    MPI or LPI EXAMINED AS PER ASME SECTION V ARTICLE 6 (LPI)
    
    OR ARTICLE 7 (MPI)
    
    **ACCEPTANCE CRITERIA SHALL BE PER ASME B31.3 PARA. 341.2**' where seq_id=392;

    If I copy and paste to Pervasive Control Panel. It work

    Is there a character that is creating the issue?

    An unhandled exception of type 'Pervasive.Data.SqlClient.PsqlException' occurred in Pervasive.Data.SqlClient.dll

    Code :

    If the_inst.Length = 0 Then
     'Console.WriteLine(the_inst.Length)
     'Nothing
    Else
    erp_cmd.CommandText = "update UNIDB.seq_main set wo_note='" & the_inst.Replace("'", "''") & "' where seq_id=" & seq_id & ";"
    erp_cmd.ExecuteNonQuery()
    End If

    Please help !!!

    John

    Monday, April 20, 2020 6:02 PM

All replies

  • Hello,

    I've never used this database but would think you might be (and unsure) needing to have a stored procedure where erp_cmd.CommandText points to a SP name and you need to set the command type to stored procedure, this is only a guess if the SQL works outside of Visual Studio.



    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Monday, April 20, 2020 7:06 PM
  • Thank you for answering my post

    The problem as the "?" character

    Pervasive has a problem with it

    erp_cmd.CommandText = "update UNIDB.seq_main set wo_note='" & the_inst.Replace("'", "''").Replace("?", "") & "' where seq_id=" & seq_id & ";"



    Monday, April 20, 2020 7:13 PM
  • Again this is a guess; let's say it was Microsoft Access ? would represent a parameter marker while in SQL-Server @FirstName is a specific parameter marker. Access parameters are ordinal while SQL-Server are named parameters.

    With that said I wonder if your ? happens to be a parameter, if so you need to setup a parameter. I did a quick search, see parameter markers on this page.

    If the ? is not a parameter I don't know what else to suggest, sorry.


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    StackOverFlow
    profile for Karen Payne on Stack Exchange

    Monday, April 20, 2020 7:20 PM
  • Hi Bre-x,

    How is the question going? 

    I note that Pervasive SQL is the third party API. Unfortunately, we don't provide support for third party products in the forums, so if your problem is not solved, I suggest that you could post in other related forum for more help.

    Thank you for your understanding.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, April 22, 2020 1:55 AM