Forum Discussion

MP2's avatar
MP2
New Contributor II
3 months ago

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

  • 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.

  • Cosimo's avatar
    Cosimo
    Contributor II

    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?

     

     

     

    • MP2's avatar
      MP2
      New Contributor II

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

      • DanielWillis's avatar
        DanielWillis
        Valued Contributor

        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);”