SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
funct_format_sql_statement.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include   "constant_definition.h"
#include   "case_constant_definition.h"
#include   "case_constant_sql_stmt_def.h"
#include   "constant_oracle_versions.h"

extern vaciar_cadena();
extern pasar_amayus ();
extern stmtsqlncmp ();

char *formatear_sql_statement ( void *punt_cadena )
        {
        static char order_stmt [MAX_STMT_SIZE];
        static char auxi_stmt [MAX_STMT_SIZE];
        static char auxiliar [MAX_WORD_STMT];

       int    profu_parent =0;
       int    profu_comita =0;
       int    profu_comilla =0;

       int    contador_blanco =0;
       int    largo_cadena=0;
       int    posicion1=0;
       int    posicion2=0;
       int    posicion3=0;
       int    caracter=0;

       largo_cadena = (int )strlen ((char *) punt_cadena);
       vaciar_cadena (order_stmt, MAX_STMT_SIZE);
       vaciar_cadena (auxi_stmt, MAX_STMT_SIZE);

       posicion2=0;

       /* ************ Quitando espacios en blanco ************* */
       for (posicion1=0; posicion1 <= largo_cadena; posicion1++)
               {
               caracter = ((char *) punt_cadena )[posicion1];
               if ( caracter == ASCII_SPACE )
                       if ( contador_blanco == 0 )
                               {
                               contador_blanco++;
                               auxi_stmt [posicion2]=caracter;
                               posicion2++;
                               }
               if ( caracter != ASCII_SPACE)
                       {
                       contador_blanco=0;
                       auxi_stmt[posicion2]=caracter;
                       posicion2++;
                       }
               }
       auxi_stmt[posicion2]=ASCII_FIN_LINEA;
       /* ************ ||||||||||||||||||||||||||| ************* */
       largo_cadena=(int )strlen(auxi_stmt);
       posicion2=0;
       posicion3=0;
       vaciar_cadena (auxiliar,MAX_WORD_STMT);
       for (posicion1=0; posicion1 <= largo_cadena; posicion1++)
               {
               caracter = auxi_stmt [posicion1];
/*             printf ("C [%c=%d] ",caracter,caracter);               */
               if ( caracter != ASCII_SPACE )
                       {
                       auxiliar[posicion3]        = caracter;

                                      Página 1
funct_format_sql_statement.c
/*                  order_stmt[posicion2] = caracter;
                    posicion2++;
                    order_stmt[posicion2] = ASCII_FIN_LINEA;
*/
                     posicion3++;
                     auxiliar[posicion3] = ASCII_FIN_LINEA;
                     }
             else if (caracter == ASCII_SPACE )
                     {
                     if ( ( stmtsqlncmp (auxiliar,"select",6)==0 ) )
                             {
                             strcat (order_stmt," n");
                             strcat (order_stmt,auxiliar);
                             strcat (order_stmt," n");
                             posicion3=0;
                             vaciar_cadena (auxiliar,MAX_WORD_STMT);
                             }
                     else if ( (stmtsqlncmp (auxiliar,"from",4)==0 ) )
                             {
                             strcat (order_stmt," n");
                             strcat (order_stmt,auxiliar);
                             strcat (order_stmt," n");
                             posicion3=0;
                             vaciar_cadena (auxiliar,MAX_WORD_STMT);
                             }
                     else if ( (stmtsqlncmp (auxiliar,"where",5)==0 ) )
                             {
                             strcat (order_stmt," n");
                             strcat (order_stmt,auxiliar);
                             strcat (order_stmt," n");
                             posicion3=0;
                             vaciar_cadena (auxiliar,MAX_WORD_STMT);
                             }
                     else if ( (stmtsqlncmp (auxiliar,"group",5)==0) )
                             {
                             strcat (order_stmt," n");
                             strcat (order_stmt,auxiliar);
                             strcat (order_stmt," n");
                             posicion3=0;
                             vaciar_cadena (auxiliar,MAX_WORD_STMT);
                             }
                     else if ( (stmtsqlncmp (auxiliar,"order",5)==0) )
                             {
                             strcat (order_stmt," n");
                             strcat (order_stmt,auxiliar);
                             strcat (order_stmt," n");
                             posicion3=0;
                             vaciar_cadena (auxiliar,MAX_WORD_STMT);
                             }
                     strcat (order_stmt,auxiliar);
                     strcat (order_stmt,"    ");
                     posicion3=0;
                     vaciar_cadena (auxiliar,MAX_WORD_STMT);
                     }
             }
     return (order_stmt);
     }




                                 Página 2

Weitere ähnliche Inhalte

Andere mochten auch

Func time sleep.c
Func time sleep.cFunc time sleep.c
Func time sleep.calbertinous
 
Funciones auxiliares.c
Funciones auxiliares.cFunciones auxiliares.c
Funciones auxiliares.calbertinous
 
Func dyn proc_func_set.c
Func dyn proc_func_set.cFunc dyn proc_func_set.c
Func dyn proc_func_set.calbertinous
 
Func dyn size_set.c
Func dyn size_set.cFunc dyn size_set.c
Func dyn size_set.calbertinous
 
Func dyn title_set.c
Func dyn title_set.cFunc dyn title_set.c
Func dyn title_set.calbertinous
 
Orastat line command
Orastat line commandOrastat line command
Orastat line commandalbertinous
 

Andere mochten auch (8)

Func time sleep.c
Func time sleep.cFunc time sleep.c
Func time sleep.c
 
Funciones auxiliares.c
Funciones auxiliares.cFunciones auxiliares.c
Funciones auxiliares.c
 
Func dyn proc_func_set.c
Func dyn proc_func_set.cFunc dyn proc_func_set.c
Func dyn proc_func_set.c
 
Func dyn size_set.c
Func dyn size_set.cFunc dyn size_set.c
Func dyn size_set.c
 
Func dyn title_set.c
Func dyn title_set.cFunc dyn title_set.c
Func dyn title_set.c
 
Orastat line command
Orastat line commandOrastat line command
Orastat line command
 
Menu orastat.c
Menu orastat.cMenu orastat.c
Menu orastat.c
 
Senten500.c
Senten500.cSenten500.c
Senten500.c
 

Ähnlich wie Funct format sql_statement.c

Ugly code
Ugly codeUgly code
Ugly codeOdd-e
 
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)Climbing the Abstract Syntax Tree (Midwest PHP 2020)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)James Titcumb
 
Climbing the Abstract Syntax Tree (IPC Fall 2017)
Climbing the Abstract Syntax Tree (IPC Fall 2017)Climbing the Abstract Syntax Tree (IPC Fall 2017)
Climbing the Abstract Syntax Tree (IPC Fall 2017)James Titcumb
 
Interpret this... (PHPem 2016)
Interpret this... (PHPem 2016)Interpret this... (PHPem 2016)
Interpret this... (PHPem 2016)James Titcumb
 
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)Climbing the Abstract Syntax Tree (ScotlandPHP 2018)
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)James Titcumb
 
Climbing the Abstract Syntax Tree (DPC 2017)
Climbing the Abstract Syntax Tree (DPC 2017)Climbing the Abstract Syntax Tree (DPC 2017)
Climbing the Abstract Syntax Tree (DPC 2017)James Titcumb
 
Climbing the Abstract Syntax Tree (phpDay 2017)
Climbing the Abstract Syntax Tree (phpDay 2017)Climbing the Abstract Syntax Tree (phpDay 2017)
Climbing the Abstract Syntax Tree (phpDay 2017)James Titcumb
 
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)James Titcumb
 
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)James Titcumb
 
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)James Titcumb
 
QA Auotmation Java programs,theory
QA Auotmation Java programs,theory QA Auotmation Java programs,theory
QA Auotmation Java programs,theory archana singh
 
Climbing the Abstract Syntax Tree (PHP UK 2018)
Climbing the Abstract Syntax Tree (PHP UK 2018)Climbing the Abstract Syntax Tree (PHP UK 2018)
Climbing the Abstract Syntax Tree (PHP UK 2018)James Titcumb
 
Climbing the Abstract Syntax Tree (Southeast PHP 2018)
Climbing the Abstract Syntax Tree (Southeast PHP 2018)Climbing the Abstract Syntax Tree (Southeast PHP 2018)
Climbing the Abstract Syntax Tree (Southeast PHP 2018)James Titcumb
 
Climbing the Abstract Syntax Tree (Forum PHP 2017)
Climbing the Abstract Syntax Tree (Forum PHP 2017)Climbing the Abstract Syntax Tree (Forum PHP 2017)
Climbing the Abstract Syntax Tree (Forum PHP 2017)James Titcumb
 
Climbing the Abstract Syntax Tree (PHP Russia 2019)
Climbing the Abstract Syntax Tree (PHP Russia 2019)Climbing the Abstract Syntax Tree (PHP Russia 2019)
Climbing the Abstract Syntax Tree (PHP Russia 2019)James Titcumb
 
Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)ujihisa
 
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)James Titcumb
 
Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and GoEleanor McHugh
 

Ähnlich wie Funct format sql_statement.c (20)

Ugly code
Ugly codeUgly code
Ugly code
 
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)Climbing the Abstract Syntax Tree (Midwest PHP 2020)
Climbing the Abstract Syntax Tree (Midwest PHP 2020)
 
Climbing the Abstract Syntax Tree (IPC Fall 2017)
Climbing the Abstract Syntax Tree (IPC Fall 2017)Climbing the Abstract Syntax Tree (IPC Fall 2017)
Climbing the Abstract Syntax Tree (IPC Fall 2017)
 
Interpret this... (PHPem 2016)
Interpret this... (PHPem 2016)Interpret this... (PHPem 2016)
Interpret this... (PHPem 2016)
 
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)Climbing the Abstract Syntax Tree (ScotlandPHP 2018)
Climbing the Abstract Syntax Tree (ScotlandPHP 2018)
 
Climbing the Abstract Syntax Tree (DPC 2017)
Climbing the Abstract Syntax Tree (DPC 2017)Climbing the Abstract Syntax Tree (DPC 2017)
Climbing the Abstract Syntax Tree (DPC 2017)
 
Climbing the Abstract Syntax Tree (phpDay 2017)
Climbing the Abstract Syntax Tree (phpDay 2017)Climbing the Abstract Syntax Tree (phpDay 2017)
Climbing the Abstract Syntax Tree (phpDay 2017)
 
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
Climbing the Abstract Syntax Tree (Bulgaria PHP 2016)
 
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
Climbing the Abstract Syntax Tree (CodeiD PHP Odessa 2017)
 
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)Climbing the Abstract Syntax Tree (PHP South Africa 2017)
Climbing the Abstract Syntax Tree (PHP South Africa 2017)
 
QA Auotmation Java programs,theory
QA Auotmation Java programs,theory QA Auotmation Java programs,theory
QA Auotmation Java programs,theory
 
Climbing the Abstract Syntax Tree (PHP UK 2018)
Climbing the Abstract Syntax Tree (PHP UK 2018)Climbing the Abstract Syntax Tree (PHP UK 2018)
Climbing the Abstract Syntax Tree (PHP UK 2018)
 
Climbing the Abstract Syntax Tree (Southeast PHP 2018)
Climbing the Abstract Syntax Tree (Southeast PHP 2018)Climbing the Abstract Syntax Tree (Southeast PHP 2018)
Climbing the Abstract Syntax Tree (Southeast PHP 2018)
 
Climbing the Abstract Syntax Tree (Forum PHP 2017)
Climbing the Abstract Syntax Tree (Forum PHP 2017)Climbing the Abstract Syntax Tree (Forum PHP 2017)
Climbing the Abstract Syntax Tree (Forum PHP 2017)
 
Climbing the Abstract Syntax Tree (PHP Russia 2019)
Climbing the Abstract Syntax Tree (PHP Russia 2019)Climbing the Abstract Syntax Tree (PHP Russia 2019)
Climbing the Abstract Syntax Tree (PHP Russia 2019)
 
Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)Hacking parse.y (RubyKansai38)
Hacking parse.y (RubyKansai38)
 
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
Climbing the Abstract Syntax Tree (PHP Developer Days Dresden 2018)
 
week-18x
week-18xweek-18x
week-18x
 
week-17x
week-17xweek-17x
week-17x
 
Implementing Software Machines in C and Go
Implementing Software Machines in C and GoImplementing Software Machines in C and Go
Implementing Software Machines in C and Go
 

Mehr von albertinous

Local functions preceded_calls.h
Local functions preceded_calls.hLocal functions preceded_calls.h
Local functions preceded_calls.halbertinous
 
Func menu mostrar.c
Func menu mostrar.cFunc menu mostrar.c
Func menu mostrar.calbertinous
 
Func dyn statement_set.c
Func dyn statement_set.cFunc dyn statement_set.c
Func dyn statement_set.calbertinous
 
Func dyn column_set.c
Func dyn column_set.cFunc dyn column_set.c
Func dyn column_set.calbertinous
 
Extern functions funciones_auxiliares.h
Extern functions funciones_auxiliares.hExtern functions funciones_auxiliares.h
Extern functions funciones_auxiliares.halbertinous
 
Decode name mode.c
Decode name mode.cDecode name mode.c
Decode name mode.calbertinous
 
Decode name lock.c
Decode name lock.cDecode name lock.c
Decode name lock.calbertinous
 
Decode lock mode.c
Decode lock mode.cDecode lock mode.c
Decode lock mode.calbertinous
 
Decode command oracle.c
Decode command oracle.cDecode command oracle.c
Decode command oracle.calbertinous
 
Constant oracle versions.h
Constant oracle versions.hConstant oracle versions.h
Constant oracle versions.halbertinous
 
Constant definition.h
Constant definition.hConstant definition.h
Constant definition.halbertinous
 
Case constant sql_stmt_def.h
Case constant sql_stmt_def.hCase constant sql_stmt_def.h
Case constant sql_stmt_def.halbertinous
 
Case constant func_def.h
Case constant func_def.hCase constant func_def.h
Case constant func_def.halbertinous
 
Case constant definition.h
Case constant definition.hCase constant definition.h
Case constant definition.halbertinous
 
Ver menu opcion.c
Ver menu opcion.cVer menu opcion.c
Ver menu opcion.calbertinous
 

Mehr von albertinous (17)

Resource1
Resource1Resource1
Resource1
 
Local functions preceded_calls.h
Local functions preceded_calls.hLocal functions preceded_calls.h
Local functions preceded_calls.h
 
Func menu mostrar.c
Func menu mostrar.cFunc menu mostrar.c
Func menu mostrar.c
 
Func dyn statement_set.c
Func dyn statement_set.cFunc dyn statement_set.c
Func dyn statement_set.c
 
Func dyn column_set.c
Func dyn column_set.cFunc dyn column_set.c
Func dyn column_set.c
 
Extern functions funciones_auxiliares.h
Extern functions funciones_auxiliares.hExtern functions funciones_auxiliares.h
Extern functions funciones_auxiliares.h
 
Decode name mode.c
Decode name mode.cDecode name mode.c
Decode name mode.c
 
Decode name lock.c
Decode name lock.cDecode name lock.c
Decode name lock.c
 
Decode lock mode.c
Decode lock mode.cDecode lock mode.c
Decode lock mode.c
 
Decode command oracle.c
Decode command oracle.cDecode command oracle.c
Decode command oracle.c
 
Constant oracle versions.h
Constant oracle versions.hConstant oracle versions.h
Constant oracle versions.h
 
Constant definition.h
Constant definition.hConstant definition.h
Constant definition.h
 
Case constant sql_stmt_def.h
Case constant sql_stmt_def.hCase constant sql_stmt_def.h
Case constant sql_stmt_def.h
 
Case constant func_def.h
Case constant func_def.hCase constant func_def.h
Case constant func_def.h
 
Case constant definition.h
Case constant definition.hCase constant definition.h
Case constant definition.h
 
Ver menu opcion.c
Ver menu opcion.cVer menu opcion.c
Ver menu opcion.c
 
Orasta500.c
Orasta500.cOrasta500.c
Orasta500.c
 

Kürzlich hochgeladen

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Kürzlich hochgeladen (20)

E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Funct format sql_statement.c

  • 1. funct_format_sql_statement.c #include <stdio.h> #include <stdlib.h> #include <string.h> #include "constant_definition.h" #include "case_constant_definition.h" #include "case_constant_sql_stmt_def.h" #include "constant_oracle_versions.h" extern vaciar_cadena(); extern pasar_amayus (); extern stmtsqlncmp (); char *formatear_sql_statement ( void *punt_cadena ) { static char order_stmt [MAX_STMT_SIZE]; static char auxi_stmt [MAX_STMT_SIZE]; static char auxiliar [MAX_WORD_STMT]; int profu_parent =0; int profu_comita =0; int profu_comilla =0; int contador_blanco =0; int largo_cadena=0; int posicion1=0; int posicion2=0; int posicion3=0; int caracter=0; largo_cadena = (int )strlen ((char *) punt_cadena); vaciar_cadena (order_stmt, MAX_STMT_SIZE); vaciar_cadena (auxi_stmt, MAX_STMT_SIZE); posicion2=0; /* ************ Quitando espacios en blanco ************* */ for (posicion1=0; posicion1 <= largo_cadena; posicion1++) { caracter = ((char *) punt_cadena )[posicion1]; if ( caracter == ASCII_SPACE ) if ( contador_blanco == 0 ) { contador_blanco++; auxi_stmt [posicion2]=caracter; posicion2++; } if ( caracter != ASCII_SPACE) { contador_blanco=0; auxi_stmt[posicion2]=caracter; posicion2++; } } auxi_stmt[posicion2]=ASCII_FIN_LINEA; /* ************ ||||||||||||||||||||||||||| ************* */ largo_cadena=(int )strlen(auxi_stmt); posicion2=0; posicion3=0; vaciar_cadena (auxiliar,MAX_WORD_STMT); for (posicion1=0; posicion1 <= largo_cadena; posicion1++) { caracter = auxi_stmt [posicion1]; /* printf ("C [%c=%d] ",caracter,caracter); */ if ( caracter != ASCII_SPACE ) { auxiliar[posicion3] = caracter; Página 1
  • 2. funct_format_sql_statement.c /* order_stmt[posicion2] = caracter; posicion2++; order_stmt[posicion2] = ASCII_FIN_LINEA; */ posicion3++; auxiliar[posicion3] = ASCII_FIN_LINEA; } else if (caracter == ASCII_SPACE ) { if ( ( stmtsqlncmp (auxiliar,"select",6)==0 ) ) { strcat (order_stmt," n"); strcat (order_stmt,auxiliar); strcat (order_stmt," n"); posicion3=0; vaciar_cadena (auxiliar,MAX_WORD_STMT); } else if ( (stmtsqlncmp (auxiliar,"from",4)==0 ) ) { strcat (order_stmt," n"); strcat (order_stmt,auxiliar); strcat (order_stmt," n"); posicion3=0; vaciar_cadena (auxiliar,MAX_WORD_STMT); } else if ( (stmtsqlncmp (auxiliar,"where",5)==0 ) ) { strcat (order_stmt," n"); strcat (order_stmt,auxiliar); strcat (order_stmt," n"); posicion3=0; vaciar_cadena (auxiliar,MAX_WORD_STMT); } else if ( (stmtsqlncmp (auxiliar,"group",5)==0) ) { strcat (order_stmt," n"); strcat (order_stmt,auxiliar); strcat (order_stmt," n"); posicion3=0; vaciar_cadena (auxiliar,MAX_WORD_STMT); } else if ( (stmtsqlncmp (auxiliar,"order",5)==0) ) { strcat (order_stmt," n"); strcat (order_stmt,auxiliar); strcat (order_stmt," n"); posicion3=0; vaciar_cadena (auxiliar,MAX_WORD_STMT); } strcat (order_stmt,auxiliar); strcat (order_stmt," "); posicion3=0; vaciar_cadena (auxiliar,MAX_WORD_STMT); } } return (order_stmt); } Página 2