Skip to main content
Newcomer
Sep 16, 2024 6:36 PM UTC
Solved

Create Table in SIC

I want to create a table and columns in SIC, but only the table name is being created. I want to know how to fix this problem. Below is my sample query and code.

Dim sql as new text.stringbuilder 

Sql.appendline(“Create Table employee(Name varchar(255) not null ,age int null);”

using dbconnap as dbconninfo = brapi.database.createexternaldbconninfo(si,”SICconnectionname”)

Brapi.database.executesql(dbconnapp,sql.tostring,true)

end using

    MP2Answer
    Newcomer
    Sep 17, 2024 5:02 PM UTC

    I have inserted few rows as well and it is running fine. When i ran query in my data adapter it is not fetching anything. 


    The business rule implementation issue has been resolved. The CSV-to-DataTable conversion was defaulting all columns to string data type. Defining explicit data types for each column resolved the issue.

    5 replies

    Contributor
    Sep 16, 2024 7:36 PM UTC

    What version of SIC are you using? I know I've seen issue with version 7.4 not on creating tables but queries not returning column headers if a query doesn't return any records. OS Support indicated that my issue is fixed in latest v8 version and maybe yours also?

     

     

     

    MP2Author
    Newcomer
    Sep 16, 2024 7:48 PM UTC

    I am using v8 version but somehow it is not working. I can see table but not columns 

    Contributor
    Sep 17, 2024 12:24 AM UTC

    When you say you can see the table but not columns, what are you viewing table in? Sounds very strange.

    What database is it?

    Have you tried inserting a row of data after you created it?

    Something like,

    sql.AppendLine(“INSERT INTO employee(Name,age) VALUES ('TestName',20);”