Runs a custom SuiteQL query in NetSuite. Useful for gathering information of all types. It is limited to 5000 rows without pagination. PAGINATION IS MANDATORY FOR LARGE RECORD TYPES High-volume record types such as customer, item, transaction, salesorder, journalentry, employee, contact, and vendor routinely contain hundreds or thousands of records. For these types, ALWAYS paginate from the very first query:1. Set pageSize to 1000 and pageIndex to 0 on the first call.2. Read totalResults and numberOfPages from the response.3. Loop through all remaining pages (pageIndex 1, 2, … numberOfPages-1) to collect the complete dataset.4. Never assume a single query returns all records — a result that looks complete may be silently truncated.Only skip pagination when querying record types that are inherently small (e.g., subsidiary, currency, location, department) or when a WHERE clause tightly constrains results to a handful of rows. Before using this tool, you should first call ns_getSuiteQLMetadata to understand the record structure. This tool executes custom SuiteQL queries in NetSuite for retrieving various types of information. Ensure that you consider these differences between SuiteQL vs standard SQL.- Bold: String concatenation. Standard SQL often uses + or CONCAT, while SuiteQL uses the || operator. [^2_10][^2_11]Standard SQL:```sql-- SQL ServerSELECT 'Hello' + ' World';-- MySQLSELECT CONCAT('Hello', ' World');```SuiteQL:```sqlSELECT 'Hello' || ' World';```- Bold: WITH/CTE support. Common Table Expressions (WITH ...) are not supported in SuiteQL; inline subqueries or temporary logic must be used instead.[^2_12][^2_13]Standard SQL:```sqlWITH temp_table AS (SELECT id FROM users)SELECT * FROM temp_table;```SuiteQL:```sql-- Rewrite without WITH:SELECT u.idFROM (SELECT id FROM employee) u;```- Bold: Date literals. Standard SQL typically compares to quoted date literals, whereas SuiteQL commonly requires Oracle-style conversion functions like TO_DATE.[^2_10][^2_14]Standard SQL:```sqlSELECT * FROM orders WHERE order_date = '2024-01-01';```SuiteQL:```sqlSELECT * FROM transactionWHERE trandate = TO_DATE('2024-01-01', 'YYYY-MM-DD');```- Bold: Oracle outer join operator. SuiteQL does not allow the legacy Oracle (+) outer join operator and requires ANSI JOIN syntax.[^2_12]Standard SQL (legacy Oracle):```sqlSELECT a.idFROM account a, account bWHERE a.id (+) = b.id;```SuiteQL (ANSI):```sqlSELECT a.idFROM account aRIGHT JOIN account b ON a.id = b.id;```- Bold: Mixed join syntax. Mixing ANSI JOINs with comma-style joins in the same statement is disallowed in SuiteQL.[^2_12]Standard SQL:```sqlSELECT *FROM t1, t2WHERE t1.id = t2.idLEFT JOIN t3 ON t1.id = t3.ref_id;```SuiteQL:```sqlSELECT *FROM t1JOIN t2 ON t1.id = t2.idLEFT JOIN t3 ON t1.id = t3.ref_id;```- Bold: IN list size. SuiteQL imposes a maximum number of expressions in an IN (...) list (commonly 1000).[^2_12]Standard SQL:```sqlSELECT * FROM products WHERE id IN (1,2,3,...);```SuiteQL:```sql-- Split into chunks or use a JOIN to a temp table equivalent:SELECT * FROM item WHERE id IN (/* up to limit */);```- Bold: Result-set cap. SuiteQL queries are capped (commonly 100,000 rows) and require paging when accessed via APIs.[^2_15][^2_12]Standard SQL:```sql-- No vendor-imposed cap beyond resourcesSELECT * FROM customers;```SuiteQL:```sql-- Retrieve in pages or constrain results:SELECT * FROM customer WHERE ROWNUM <= 100000;```- Bold: SQL standard level. SuiteQL targets SQL-92 compliance with Oracle SQL features, whereas many platforms support newer SQL standards.[^2_16][^2_9]Standard SQL:```sql-- Uses features from SQL:1999+ (e.g., WINDOW, WITH RECURSIVE)SELECT 1;```SuiteQL:```sql-- Stick to SQL-92 core plus Oracle-style functions where supportedSELECT 1 FROM DUAL;```- Bold: OFFSET/FETCH support. OFFSET-style pagination is not supported in SuiteQL; use ROWNUM-based paging or API pagination techniques.[^2_17][^2_18]Standard SQL:```sqlSELECT *FROM employeesORDER BY idOFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY;```SuiteQL:```sqlSELECT *FROM ( SELECT ROWNUM rn, e.* FROM employee e ORDER BY e.id)WHERE rn BETWEEN 11 AND 20;```- Bold: Recursive CTEs. Recursive WITH RECURSIVE queries are not available in SuiteQL.[^2_12]Standard SQL:```sqlWITH RECURSIVE t(n) AS ( SELECT 1 UNION ALL SELECT n+1 FROM t WHERE n < 10)SELECT * FROM t;```SuiteQL:```sql-- Emulate recursion with iterative logic outside SQL or flatten hierarchiesSELECT * FROM some_table;```- Bold: Performance with deep nesting. Deeply nested SELECTs and complex expressions can cause performance issues/timeouts in SuiteQL; simplify queries.[^2_14]Standard SQL:```sqlSELECT * FROM (SELECT * FROM (SELECT * FROM t));```SuiteQL:```sql-- Flatten nested subqueries where possibleSELECT cols FROM t;```- Bold: TOP/LIMIT vs ROWNUM. SuiteQL uses Oracle-style ROWNUM filtering; TOP/LIMIT syntax found in other dialects is not supported.[^2_19][^2_20]Standard SQL:```sql-- SQL ServerSELECT TOP 10 * FROM customers;-- MySQL/PostgreSQLSELECT * FROM customers LIMIT 10;```SuiteQL:```sqlSELECT * FROM customer WHERE ROWNUM <= 10;```- Bold: Current date/time functions. SuiteQL supports Oracle-style CURRENT_DATE/SYSDATE rather than vendor-specific NOW()/GETDATE().[^2_10]Standard SQL:```sql-- SQL ServerSELECT GETDATE();-- MySQLSELECT NOW();```SuiteQL:```sqlSELECT CURRENT_DATE FROM DUAL;SELECT SYSDATE FROM DUAL;```- Bold: Substring and string functions. SuiteQL uses Oracle-style names like SUBSTR rather than SUBSTRING/LEFT/RIGHT.[^2_10]Standard SQL:```sql-- SQL ServerSELECT SUBSTRING('Hello', 1, 3);-- MySQLSELECT LEFT('Hello', 3);```SuiteQL:```sqlSELECT SUBSTR('Hello', 1, 3);```- Bold: NULL-handling functions. SuiteQL uses NVL rather than ISNULL (SQL Server) or IFNULL (MySQL).[^2_10]Standard SQL:```sql-- SQL ServerSELECT ISNULL(field, 'default');-- MySQLSELECT IFNULL(field, 'default');```SuiteQL:```sqlSELECT NVL(field, 'default');```- Bold: Aggregate string functions. Some aggregate string functions common in other systems (e.g., vendor-specific LISTAGG/STRING_AGG/GROUP_CONCAT variants) may be unsupported in SuiteQL.[^2_10]Standard SQL:```sql-- SQL ServerSELECT STRING_AGG(name, ', ') FROM t;-- MySQLSELECT GROUP_CONCAT(name) FROM t;```SuiteQL:```sql-- Use supported aggregates or aggregate outside SQL if unavailableSELECT name FROM t;```- Bold: Pagination constraints via APIs. When executing SuiteQL via REST, enforce page sizes and iterate pages to retrieve large datasets due to platform limits.[^2_21][^2_15]Standard SQL:```sql-- Not applicable to DB-native accessSELECT * FROM big_table;```SuiteQL:```sql-- Retrieve pages in client code and aggregate resultsSELECT * FROM some_record WHERE ROWNUM <= :page_size;```- Bold: Function whitelist. SuiteQL enforces a whitelist of supported/unsupported functions; calls outside this set are rejected.[^2_16][^2_10]Standard SQL:```sql-- Vendor dialects often allow wide function setsSELECT COALESCE(col, 'x');```SuiteQL:```sql-- Use only supported functions (see docs)SELECT NVL(col, 'x');```