Just in case you "really" want to use SQL to create the index:

$statement_t:=""
$statement_t:=$statement_t+"CREATE INDEX "+$index_Name
$statement_t:=$statement_t+" "  // Need a space
$statement_t:=$statement_t+"ON "+$tableName_t+" ("+$fieldName+")"

  //example:  $statement_t:="CREATE INDEX CITY_IDX ON ADDRESSES (City)"

Begin SQL
        EXECUTE IMMEDIATE :$statement_t;
End SQL


Randy Engle, Director
XC2 Software LLC – XC2LIVE!

-----Original Message-----
From: 4D_Tech <4d_tech-boun...@lists.4d.com> On Behalf Of Jody Bevan via 4D_Tech
Sent: Friday, June 22, 2018 10:45 AM
To: 4D iNug Technical <4d_tech@lists.4d.com>
Cc: Jody Bevan <jody.be...@gmail.com>
Subject: Creating Tables by running a method

I know that this feature has been around for a long time  ~ 4D 2011.

I am now using 16R6. I now have a method that creates a table with the fields I 
want added.

The challenge I am having is setting indexes (and index types), as well as 
Primary Keys. 

I looked in the Knowledge Base for code examples but do not see any - hmmm.

I am not a SQL person, so reading the 4D SQL Reference on this is a bigger 
challenge to me.

Can anyone pass along a point to example code, or reference for this.

Thanks




Jody Bevan
Developer

Argus Productions Inc. <https://www.facebook.com/ArgusProductions/>
+1 587-487-6120



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to